leds-pca9532.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * pca9532.h - platform data structure for pca9532 led controller
  3. *
  4. * Copyright (C) 2008 Riku Voipio <riku.voipio@movial.fi>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; version 2 of the License.
  9. *
  10. * Datasheet: http://www.nxp.com/acrobat/datasheets/PCA9532_3.pdf
  11. *
  12. */
  13. #ifndef __LINUX_PCA9532_H
  14. #define __LINUX_PCA9532_H
  15. #include <linux/leds.h>
  16. #include <linux/workqueue.h>
  17. enum pca9532_state {
  18. PCA9532_OFF = 0x0,
  19. PCA9532_ON = 0x1,
  20. PCA9532_PWM0 = 0x2,
  21. PCA9532_PWM1 = 0x3
  22. };
  23. enum pca9532_type { PCA9532_TYPE_NONE, PCA9532_TYPE_LED,
  24. PCA9532_TYPE_N2100_BEEP, PCA9532_TYPE_GPIO };
  25. struct pca9532_led {
  26. u8 id;
  27. struct i2c_client *client;
  28. char *name;
  29. struct led_classdev ldev;
  30. struct work_struct work;
  31. enum pca9532_type type;
  32. enum pca9532_state state;
  33. };
  34. struct pca9532_platform_data {
  35. struct pca9532_led leds[16];
  36. u8 pwm[2];
  37. u8 psc[2];
  38. int gpio_base;
  39. };
  40. #endif /* __LINUX_PCA9532_H */