htc-pasic3.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * HTC PASIC3 driver - LEDs and DS1WM
  3. *
  4. * Copyright (c) 2007 Philipp Zabel <philipp.zabel@gmail.com>
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file COPYING in the main directory of this archive for
  8. * more details.
  9. *
  10. */
  11. #ifndef __PASIC3_H
  12. #define __PASIC3_H
  13. #include <linux/platform_device.h>
  14. #include <linux/leds.h>
  15. extern void pasic3_write_register(struct device *dev, u32 reg, u8 val);
  16. extern u8 pasic3_read_register(struct device *dev, u32 reg);
  17. /*
  18. * mask for registers 0x20,0x21,0x22
  19. */
  20. #define PASIC3_MASK_LED0 0x04
  21. #define PASIC3_MASK_LED1 0x08
  22. #define PASIC3_MASK_LED2 0x40
  23. /*
  24. * bits in register 0x06
  25. */
  26. #define PASIC3_BIT2_LED0 0x08
  27. #define PASIC3_BIT2_LED1 0x10
  28. #define PASIC3_BIT2_LED2 0x20
  29. struct pasic3_led {
  30. struct led_classdev led;
  31. unsigned int hw_num;
  32. unsigned int bit2;
  33. unsigned int mask;
  34. struct pasic3_leds_machinfo *pdata;
  35. };
  36. struct pasic3_leds_machinfo {
  37. unsigned int num_leds;
  38. unsigned int power_gpio;
  39. struct pasic3_led *leds;
  40. };
  41. struct pasic3_platform_data {
  42. struct pasic3_leds_machinfo *led_pdata;
  43. unsigned int clock_rate;
  44. };
  45. #endif