Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * pca9532.h - platform data structure for pca9532 led controller
0004  *
0005  * Copyright (C) 2008 Riku Voipio <riku.voipio@movial.fi>
0006  *
0007  * Datasheet: http://www.nxp.com/acrobat/datasheets/PCA9532_3.pdf
0008  */
0009 
0010 #ifndef __LINUX_PCA9532_H
0011 #define __LINUX_PCA9532_H
0012 
0013 #include <linux/leds.h>
0014 #include <linux/workqueue.h>
0015 #include <dt-bindings/leds/leds-pca9532.h>
0016 
0017 enum pca9532_state {
0018     PCA9532_OFF  = 0x0,
0019     PCA9532_ON   = 0x1,
0020     PCA9532_PWM0 = 0x2,
0021     PCA9532_PWM1 = 0x3,
0022     PCA9532_KEEP = 0xff,
0023 };
0024 
0025 struct pca9532_led {
0026     u8 id;
0027     struct i2c_client *client;
0028     const char *name;
0029     const char *default_trigger;
0030     struct led_classdev ldev;
0031     struct work_struct work;
0032     u32 type;
0033     enum pca9532_state state;
0034 };
0035 
0036 struct pca9532_platform_data {
0037     struct pca9532_led leds[16];
0038     u8 pwm[2];
0039     u8 psc[2];
0040     int gpio_base;
0041 };
0042 
0043 #endif /* __LINUX_PCA9532_H */