hwmon-s3c.h 1.3 KB

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