]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
wcn36xx: get chip type from platform ops
authorAndy Green <andy.green@linaro.org>
Sat, 17 Jan 2015 04:39:15 +0000 (12:39 +0800)
committerSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Mon, 11 Jan 2016 09:55:23 +0000 (09:55 +0000)
Autodetecting the chip type does not work well.
Stop attempting to do it and require a platform op
that tells us what the chip is.

Signed-off-by: Andy Green <andy.green@linaro.org>
drivers/net/wireless/ath/wcn36xx/main.c
drivers/net/wireless/ath/wcn36xx/wcn36xx.h

index 7c169abdbafee95ccfe8f461e670fbb8ab5ca5eb..f2b8be033c7b2cf2113401b75409cd193d83d23f 100644 (file)
@@ -221,17 +221,6 @@ static void wcn36xx_feat_caps_info(struct wcn36xx *wcn)
        }
 }
 
-static void wcn36xx_detect_chip_version(struct wcn36xx *wcn)
-{
-       if (get_feat_caps(wcn->fw_feat_caps, DOT11AC)) {
-               wcn36xx_info("Chip is 3680\n");
-               wcn->chip_version = WCN36XX_CHIP_3680;
-       } else {
-               wcn36xx_info("Chip is 3660\n");
-               wcn->chip_version = WCN36XX_CHIP_3660;
-       }
-}
-
 static int wcn36xx_start(struct ieee80211_hw *hw)
 {
        struct wcn36xx *wcn = hw->priv;
@@ -286,8 +275,6 @@ static int wcn36xx_start(struct ieee80211_hw *hw)
                        wcn36xx_feat_caps_info(wcn);
        }
 
-       wcn36xx_detect_chip_version(wcn);
-
        /* DMA channel initialization */
        ret = wcn36xx_dxe_init(wcn);
        if (ret) {
@@ -1037,6 +1024,11 @@ static int wcn36xx_probe(struct platform_device *pdev)
        wcn->hw = hw;
        wcn->dev = &pdev->dev;
        wcn->ctrl_ops = pdev->dev.platform_data;
+       if (!wcn->ctrl_ops->get_chip_type) {
+               dev_err(&pdev->dev, "Missing ops->get_chip_type\n");
+               return -EINVAL;
+       }
+       wcn->chip_version = wcn->ctrl_ops->get_chip_type();
 
        mutex_init(&wcn->hal_mutex);
 
index abb9bb13fa3885dfbe307a5330cc73a8d9f58f0c..9ca730c1df54f59b73c7770be859b565a55b3d37 100644 (file)
@@ -120,6 +120,7 @@ struct wcn36xx_platform_ctrl_ops {
        void (*close)(void);
        int (*tx)(char *buf, size_t len);
        int (*get_hw_mac)(u8 *addr);
+       int (*get_chip_type)(void);
        int (*smsm_change_state)(u32 clear_mask, u32 set_mask);
 };