leds-pca9532.h 866 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * pca9532.h - platform data structure for pca9532 led controller
  4. *
  5. * Copyright (C) 2008 Riku Voipio <riku.voipio@movial.fi>
  6. *
  7. * Datasheet: http://www.nxp.com/acrobat/datasheets/PCA9532_3.pdf
  8. */
  9. #ifndef __LINUX_PCA9532_H
  10. #define __LINUX_PCA9532_H
  11. #include <linux/leds.h>
  12. #include <linux/workqueue.h>
  13. #include <dt-bindings/leds/leds-pca9532.h>
  14. enum pca9532_state {
  15. PCA9532_OFF = 0x0,
  16. PCA9532_ON = 0x1,
  17. PCA9532_PWM0 = 0x2,
  18. PCA9532_PWM1 = 0x3,
  19. PCA9532_KEEP = 0xff,
  20. };
  21. struct pca9532_led {
  22. u8 id;
  23. struct i2c_client *client;
  24. const char *name;
  25. const char *default_trigger;
  26. struct led_classdev ldev;
  27. struct work_struct work;
  28. u32 type;
  29. enum pca9532_state state;
  30. };
  31. struct pca9532_platform_data {
  32. struct pca9532_led leds[16];
  33. u8 pwm[2];
  34. u8 psc[2];
  35. int gpio_base;
  36. };
  37. #endif /* __LINUX_PCA9532_H */