hwmon-s3c.h 1.2 KB

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