Meng Wang | 61af684 | 2018-09-10 17:47:55 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Sudheer Papothi | c9dd3be | 2018-04-06 00:51:48 +0530 | [diff] [blame] | 2 | /* Copyright (c) 2015, 2018 The Linux Foundation. All rights reserved. |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 3 | */ |
| 4 | #ifndef WSA881X_TEMP_SENSOR_H |
| 5 | #define WSA881X_TEMP_SENSOR_H |
| 6 | |
| 7 | #include <linux/thermal.h> |
| 8 | #include <sound/soc.h> |
| 9 | |
| 10 | struct wsa_temp_register { |
| 11 | u8 d1_msb; |
| 12 | u8 d1_lsb; |
| 13 | u8 d2_msb; |
| 14 | u8 d2_lsb; |
| 15 | u8 dmeas_msb; |
| 16 | u8 dmeas_lsb; |
| 17 | }; |
Meng Wang | 15c825d | 2018-09-06 10:49:18 +0800 | [diff] [blame^] | 18 | typedef int32_t (*wsa_temp_register_read)(struct snd_soc_component *component, |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 19 | struct wsa_temp_register *wsa_temp_reg); |
| 20 | struct wsa881x_tz_priv { |
| 21 | struct thermal_zone_device *tz_dev; |
Meng Wang | 15c825d | 2018-09-06 10:49:18 +0800 | [diff] [blame^] | 22 | struct snd_soc_component *component; |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 23 | struct wsa_temp_register *wsa_temp_reg; |
| 24 | char name[80]; |
| 25 | wsa_temp_register_read wsa_temp_reg_read; |
Sudheer Papothi | c9dd3be | 2018-04-06 00:51:48 +0530 | [diff] [blame] | 26 | struct notifier_block pm_nb; |
| 27 | atomic_t is_suspend_spk; |
| 28 | int t0_init; |
| 29 | int curr_temp; |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | int wsa881x_get_temp(struct thermal_zone_device *tz_dev, int *temp); |
| 33 | int wsa881x_init_thermal(struct wsa881x_tz_priv *tz_pdata); |
| 34 | void wsa881x_deinit_thermal(struct thermal_zone_device *tz_dev); |
| 35 | #endif |