From 76e5e82e791de7f3370a9c4bc8da209e5ef7fd45 Mon Sep 17 00:00:00 2001 From: "Vangala, Amarnath" Date: Sun, 13 Sep 2020 01:02:56 +0530 Subject: [PATCH] ASOC: add support to disable WSA881x temperature sensor Add support to disable compilation of temperature sensor for wsa881x analog module, when not needed. Change-Id: I054e90d4b1abae3c0cdc6623b1f688120ba87dbd Signed-off-by: Vangala, Amarnath --- asoc/codecs/Kbuild | 2 ++ asoc/codecs/wsa881x-temp-sensor.h | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/asoc/codecs/Kbuild b/asoc/codecs/Kbuild index 3d302bd7c2..e861791dd1 100644 --- a/asoc/codecs/Kbuild +++ b/asoc/codecs/Kbuild @@ -164,8 +164,10 @@ ifdef CONFIG_SND_SOC_WSA881X_ANALOG WSA881X_ANALOG_OBJS += wsa881x-analog.o WSA881X_ANALOG_OBJS += wsa881x-tables-analog.o WSA881X_ANALOG_OBJS += wsa881x-regmap-analog.o +ifndef CONFIG_WSA881X_TEMP_SENSOR_DISABLE WSA881X_ANALOG_OBJS += wsa881x-temp-sensor.o endif +endif ifdef CONFIG_SND_SOC_MSM_STUB STUB_OBJS += msm_stub.o endif diff --git a/asoc/codecs/wsa881x-temp-sensor.h b/asoc/codecs/wsa881x-temp-sensor.h index fbb5941aba..483560db2b 100644 --- a/asoc/codecs/wsa881x-temp-sensor.h +++ b/asoc/codecs/wsa881x-temp-sensor.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -/* Copyright (c) 2015, 2018 The Linux Foundation. All rights reserved. +/* Copyright (c) 2015, 2018, 2020 The Linux Foundation. All rights reserved. */ #ifndef WSA881X_TEMP_SENSOR_H #define WSA881X_TEMP_SENSOR_H @@ -29,7 +29,13 @@ struct wsa881x_tz_priv { int curr_temp; }; -int wsa881x_get_temp(struct thermal_zone_device *tz_dev, int *temp); +#ifndef CONFIG_WSA881X_TEMP_SENSOR_DISABLE int wsa881x_init_thermal(struct wsa881x_tz_priv *tz_pdata); void wsa881x_deinit_thermal(struct thermal_zone_device *tz_dev); +int wsa881x_get_temp(struct thermal_zone_device *tz_dev, int *temp); +#else +int wsa881x_init_thermal(struct wsa881x_tz_priv *tz_pdata){ return 0; } +void wsa881x_deinit_thermal(struct thermal_zone_device *tz_dev){} +int wsa881x_get_temp(struct thermal_zone_device *tz_dev, int *temp){ return 0; } +#endif #endif