ntc_thermistor.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * ntc_thermistor.h - NTC Thermistors
  3. *
  4. * Copyright (C) 2010 Samsung Electronics
  5. * MyungJoo Ham <myungjoo.ham@samsung.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #ifndef _LINUX_NTC_H
  22. #define _LINUX_NTC_H
  23. struct iio_channel;
  24. enum ntc_thermistor_type {
  25. TYPE_NCPXXWB473,
  26. TYPE_NCPXXWL333,
  27. TYPE_B57330V2103,
  28. };
  29. struct ntc_thermistor_platform_data {
  30. /*
  31. * One (not both) of read_uV and read_ohm should be provided and only
  32. * one of the two should be provided.
  33. * Both functions should return negative value for an error case.
  34. *
  35. * pullup_uV, pullup_ohm, pulldown_ohm, and connect are required to use
  36. * read_uV()
  37. *
  38. * How to setup pullup_ohm, pulldown_ohm, and connect is
  39. * described at Documentation/hwmon/ntc_thermistor
  40. *
  41. * pullup/down_ohm: 0 for infinite / not-connected
  42. *
  43. * chan: iio_channel pointer to communicate with the ADC which the
  44. * thermistor is using for conversion of the analog values.
  45. */
  46. int (*read_uv)(struct ntc_thermistor_platform_data *);
  47. unsigned int pullup_uv;
  48. unsigned int pullup_ohm;
  49. unsigned int pulldown_ohm;
  50. enum { NTC_CONNECTED_POSITIVE, NTC_CONNECTED_GROUND } connect;
  51. struct iio_channel *chan;
  52. int (*read_ohm)(void);
  53. };
  54. #endif /* _LINUX_NTC_H */