wcnss : Add more arguments to Thermal Mitigation APIs
Thermal mitigation event handle functions needs device
context to handle the event properly.
CRs-fixed: 364094
Change-Id: I2afa87eba755f082018510e9bfa6962392f591fd
Acked-by: Leo Chang <schang@qca.qualcomm.com>
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
diff --git a/drivers/net/wireless/wcnss/wcnss_wlan.c b/drivers/net/wireless/wcnss/wcnss_wlan.c
index cc95fcd..ad9dc7d 100644
--- a/drivers/net/wireless/wcnss/wcnss_wlan.c
+++ b/drivers/net/wireless/wcnss/wcnss_wlan.c
@@ -45,7 +45,7 @@
int smd_channel_ready;
unsigned int serial_number;
int thermal_mitigation;
- void (*tm_notify)(int);
+ void (*tm_notify)(struct device *, int);
struct wcnss_wlan_config wlan_config;
struct delayed_work wcnss_work;
} *penv = NULL;
@@ -99,7 +99,7 @@
return -EINVAL;
penv->thermal_mitigation = value;
if (penv->tm_notify)
- (penv->tm_notify)(value);
+ (penv->tm_notify)(dev, value);
return count;
}
@@ -275,14 +275,16 @@
}
EXPORT_SYMBOL(wcnss_wlan_unregister_pm_ops);
-void wcnss_register_thermal_mitigation(void (*tm_notify)(int))
+void wcnss_register_thermal_mitigation(struct device *dev,
+ void (*tm_notify)(struct device *, int))
{
- if (penv && tm_notify)
+ if (penv && dev && tm_notify)
penv->tm_notify = tm_notify;
}
EXPORT_SYMBOL(wcnss_register_thermal_mitigation);
-void wcnss_unregister_thermal_mitigation(void (*tm_notify)(int))
+void wcnss_unregister_thermal_mitigation(
+ void (*tm_notify)(struct device *, int))
{
if (penv && tm_notify) {
if (tm_notify != penv->tm_notify)
diff --git a/include/linux/wcnss_wlan.h b/include/linux/wcnss_wlan.h
index 1c492f9..d7e65b0 100644
--- a/include/linux/wcnss_wlan.h
+++ b/include/linux/wcnss_wlan.h
@@ -35,8 +35,10 @@
const struct dev_pm_ops *pm_ops);
void wcnss_wlan_unregister_pm_ops(struct device *dev,
const struct dev_pm_ops *pm_ops);
-void wcnss_register_thermal_mitigation(void (*tm_notify)(int));
-void wcnss_unregister_thermal_mitigation(void (*tm_notify)(int));
+void wcnss_register_thermal_mitigation(struct device *dev,
+ void (*tm_notify)(struct device *dev, int));
+void wcnss_unregister_thermal_mitigation(
+ void (*tm_notify)(struct device *dev, int));
struct platform_device *wcnss_get_platform_device(void);
struct wcnss_wlan_config *wcnss_get_wlan_config(void);
int wcnss_wlan_power(struct device *dev,