net: wireless: read edp consumer name from DT
Manikanta [Sat, 4 Oct 2014 12:10:26 +0000 (17:10 +0530)]
bug 1553821
bug 1556694

Change-Id: Ibe19dc7ee2550ec2dbcea17eaf3da86038999f50
Signed-off-by: Manikanta <mmaddireddy@nvidia.com>
Reviewed-on: http://git-master/r/553596
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>

drivers/net/wireless/bcmdhd/dhd_linux.h
drivers/net/wireless/bcmdhd/dhd_linux_platdev.c
drivers/net/wireless/bcmdhd2/dhd_linux.h
drivers/net/wireless/bcmdhd2/dhd_linux_platdev.c

index 02bc928..8e653f8 100644 (file)
@@ -56,6 +56,7 @@ typedef struct wifi_adapter_info {
        uint            intr_flags;
        int             wlan_pwr;
        int             wlan_rst;
+       const char      *edp_name;
        const char      *fw_path;
        const char      *nv_path;
        void            *wifi_plat_data;        /* wifi ctrl func, for backward compatibility */
index 70b8db3..d4cc36d 100644 (file)
@@ -358,6 +358,14 @@ static int wifi_plat_dev_drv_probe(struct platform_device *pdev)
                        irq_flags = irqd_get_trigger_type(irq_data);
                        adapter->intr_flags = irq_flags & IRQF_TRIGGER_MASK;
                }
+
+               if (of_property_read_string(node, "edp-consumer-name", &adapter->edp_name)) {
+                       adapter->sysedpc = NULL;
+                       DHD_ERROR(("%s: property 'edp-consumer-name' missing or invalid\n",
+                                                                       __FUNCTION__));
+               } else {
+                       adapter->sysedpc = sysedp_create_consumer("primary-wifi", adapter->edp_name);
+               }
        } else {
                resource = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "bcmdhd_wlan_irq");
                if (resource == NULL)
@@ -366,10 +374,9 @@ static int wifi_plat_dev_drv_probe(struct platform_device *pdev)
                        adapter->irq_num = resource->start;
                        adapter->intr_flags = resource->flags & IRQF_TRIGGER_MASK;
                }
+               adapter->sysedpc = sysedp_create_consumer("wifi", "wifi");
        }
 
-       adapter->sysedpc = sysedp_create_consumer("wifi", "wifi");
-
        wifi_plat_dev_probe_ret = dhd_wifi_platform_load();
        return wifi_plat_dev_probe_ret;
 }
index 907e48b..06bdf29 100755 (executable)
@@ -45,6 +45,7 @@ typedef struct wifi_adapter_info {
        uint            intr_flags;
        int             wlan_pwr;
        int             wlan_rst;
+       const char      *edp_name;
        const char      *fw_path;
        const char      *nv_path;
        void            *wifi_plat_data;        /* wifi ctrl func, for backward compatibility */
index 54c92d9..ff15679 100755 (executable)
@@ -362,6 +362,14 @@ static int wifi_plat_dev_drv_probe(struct platform_device *pdev)
                        irq_flags = irqd_get_trigger_type(irq_data);
                        adapter->intr_flags = irq_flags & IRQF_TRIGGER_MASK;
                }
+
+               if (of_property_read_string(node, "edp-consumer-name", &adapter->edp_name)) {
+                       adapter->sysedpc = NULL;
+                       DHD_ERROR(("%s: property 'edp-consumer-name' missing or invalid\n",
+                                                                       __FUNCTION__));
+               } else {
+                       adapter->sysedpc = sysedp_create_consumer("secondary-wifi", adapter->edp_name);
+               }
        } else {
 #ifdef BCMDHD2
                resource = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "bcmdhd_wlan2_irq");
@@ -378,9 +386,9 @@ static int wifi_plat_dev_drv_probe(struct platform_device *pdev)
                        adapter->irq_num = resource->start;
                        adapter->intr_flags = resource->flags & IRQF_TRIGGER_MASK;
                }
+               adapter->sysedpc = sysedp_create_consumer("secondary-wifi", "secondary-wifi");
        }
 
-       adapter->sysedpc = sysedp_create_consumer("secondary-wifi", "secondary-wifi");
        wifi_plat_dev_probe_ret = dhd_wifi_platform_load();
        return wifi_plat_dev_probe_ret;
 }