hwmon.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* linux/arch/arm/plat-s3c/include/plat/hwmon.h
  2. *
  3. * Copyright 2005 Simtec Electronics
  4. * Ben Dooks <ben@simtec.co.uk>
  5. * http://armlinux.simtec.co.uk/
  6. *
  7. * S3C - HWMon interface for ADC
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. #ifndef __ASM_ARCH_ADC_HWMON_H
  14. #define __ASM_ARCH_ADC_HWMON_H __FILE__
  15. /**
  16. * s3c_hwmon_chcfg - channel configuration
  17. * @name: The name to give this channel.
  18. * @mult: Multiply the ADC value read by this.
  19. * @div: Divide the value from the ADC by this.
  20. *
  21. * The value read from the ADC is converted to a value that
  22. * hwmon expects (mV) by result = (value_read * @mult) / @div.
  23. */
  24. struct s3c_hwmon_chcfg {
  25. const char *name;
  26. unsigned int mult;
  27. unsigned int div;
  28. };
  29. /**
  30. * s3c_hwmon_pdata - HWMON platform data
  31. * @in: One configuration for each possible channel used.
  32. */
  33. struct s3c_hwmon_pdata {
  34. struct s3c_hwmon_chcfg *in[8];
  35. };
  36. /**
  37. * s3c_hwmon_set_platdata - Set platform data for S3C HWMON device
  38. * @pd: Platform data to register to device.
  39. *
  40. * Register the given platform data for use with the S3C HWMON device.
  41. * The call will copy the platform data, so the board definitions can
  42. * make the structure itself __initdata.
  43. */
  44. extern void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd);
  45. #endif /* __ASM_ARCH_ADC_HWMON_H */