blob: fbb5941abab68fb7bfee151d82478655e9797bb2 [file] [log] [blame]
Meng Wang43bbb872018-12-10 12:32:05 +08001/* SPDX-License-Identifier: GPL-2.0-only */
Sudheer Papothic9dd3be2018-04-06 00:51:48 +05302/* Copyright (c) 2015, 2018 The Linux Foundation. All rights reserved.
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05303 */
4#ifndef WSA881X_TEMP_SENSOR_H
5#define WSA881X_TEMP_SENSOR_H
6
7#include <linux/thermal.h>
8#include <sound/soc.h>
9
10struct 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 Wang15c825d2018-09-06 10:49:18 +080018typedef int32_t (*wsa_temp_register_read)(struct snd_soc_component *component,
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053019 struct wsa_temp_register *wsa_temp_reg);
20struct wsa881x_tz_priv {
21 struct thermal_zone_device *tz_dev;
Meng Wang15c825d2018-09-06 10:49:18 +080022 struct snd_soc_component *component;
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053023 struct wsa_temp_register *wsa_temp_reg;
24 char name[80];
25 wsa_temp_register_read wsa_temp_reg_read;
Sudheer Papothic9dd3be2018-04-06 00:51:48 +053026 struct notifier_block pm_nb;
27 atomic_t is_suspend_spk;
28 int t0_init;
29 int curr_temp;
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053030};
31
32int wsa881x_get_temp(struct thermal_zone_device *tz_dev, int *temp);
33int wsa881x_init_thermal(struct wsa881x_tz_priv *tz_pdata);
34void wsa881x_deinit_thermal(struct thermal_zone_device *tz_dev);
35#endif