blob: 26828b716d07c26477e9acf3a38f800de1a9752f [file] [log] [blame]
Sudheer Papothid889f1a2018-04-06 00:51:48 +05301/* Copyright (c) 2015, 2018 The Linux Foundation. All rights reserved.
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05302 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12#ifndef WSA881X_TEMP_SENSOR_H
13#define WSA881X_TEMP_SENSOR_H
14
15#include <linux/thermal.h>
16#include <sound/soc.h>
17
18struct wsa_temp_register {
19 u8 d1_msb;
20 u8 d1_lsb;
21 u8 d2_msb;
22 u8 d2_lsb;
23 u8 dmeas_msb;
24 u8 dmeas_lsb;
25};
26typedef int32_t (*wsa_temp_register_read)(struct snd_soc_codec *codec,
27 struct wsa_temp_register *wsa_temp_reg);
28struct wsa881x_tz_priv {
29 struct thermal_zone_device *tz_dev;
30 struct snd_soc_codec *codec;
31 struct wsa_temp_register *wsa_temp_reg;
32 char name[80];
33 wsa_temp_register_read wsa_temp_reg_read;
Sudheer Papothid889f1a2018-04-06 00:51:48 +053034 struct notifier_block pm_nb;
35 atomic_t is_suspend_spk;
36 int t0_init;
37 int curr_temp;
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053038};
39
40int wsa881x_get_temp(struct thermal_zone_device *tz_dev, int *temp);
41int wsa881x_init_thermal(struct wsa881x_tz_priv *tz_pdata);
42void wsa881x_deinit_thermal(struct thermal_zone_device *tz_dev);
43#endif