From: xuwei9 Date: Fri, 15 Feb 2019 13:25:10 +0000 (+0800) Subject: kernel:thermal bat thermistor change X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1eb4e0d8d9a32001948b793eb3edccc7843439ef;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git kernel:thermal bat thermistor change use thermal temperature as battery temp Change-Id: I264cd804814cf46fbc4de4b257f64b12d625e0c4 Signed-off-by: xuwei9 Reviewed-on: https://gerrit.mot.com/1310122 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c index 3f4ccdb682c4..f4b7a71110ec 100755 --- a/drivers/hwmon/ntc_thermistor.c +++ b/drivers/hwmon/ntc_thermistor.c @@ -261,6 +261,19 @@ struct ntc_data { struct ntc_data *data_ntc = NULL; #if defined(CONFIG_OF) && IS_ENABLED(CONFIG_IIO) +static bool battery_therm_data(struct ntc_data *data, struct device *dev) +{ + struct device_node *np = dev->of_node; + + if (!np) + return false; + + if (memcmp(np->name, "battery_thermistor", 18) == 0) { + data_ntc = data; + } + + return true; +} static int ntc_adc_iio_read(struct ntc_thermistor_platform_data *pdata) { struct iio_channel *channel = pdata->chan; @@ -641,7 +654,7 @@ static int ntc_thermistor_probe(struct platform_device *pdev) pdev_id = of_id ? of_id->data : platform_get_device_id(pdev); data->pdata = pdata; - data_ntc = data; + battery_therm_data(data, dev); switch (pdev_id->driver_data) { case TYPE_NCPXXWB473: