wsa881x-temp-sensor.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* Copyright (c) 2015, The Linux Foundation. All rights reserved.
  2. *
  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. #include <linux/thermal.h>
  15. #include <sound/soc.h>
  16. struct wsa_temp_register {
  17. u8 d1_msb;
  18. u8 d1_lsb;
  19. u8 d2_msb;
  20. u8 d2_lsb;
  21. u8 dmeas_msb;
  22. u8 dmeas_lsb;
  23. };
  24. typedef int32_t (*wsa_temp_register_read)(struct snd_soc_codec *codec,
  25. struct wsa_temp_register *wsa_temp_reg);
  26. struct wsa881x_tz_priv {
  27. struct thermal_zone_device *tz_dev;
  28. struct snd_soc_codec *codec;
  29. struct wsa_temp_register *wsa_temp_reg;
  30. char name[80];
  31. wsa_temp_register_read wsa_temp_reg_read;
  32. };
  33. int wsa881x_get_temp(struct thermal_zone_device *tz_dev, int *temp);
  34. int wsa881x_init_thermal(struct wsa881x_tz_priv *tz_pdata);
  35. void wsa881x_deinit_thermal(struct thermal_zone_device *tz_dev);
  36. #endif