blob: f4796d3339742773267ba81665846d7b13199cee [file] [log] [blame]
Thomas Gleixnerb886d832019-06-01 10:08:55 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Riku Voipioe14fa822008-05-31 14:43:41 +01002/*
3 * pca9532.h - platform data structure for pca9532 led controller
4 *
5 * Copyright (C) 2008 Riku Voipio <riku.voipio@movial.fi>
6 *
Riku Voipioe14fa822008-05-31 14:43:41 +01007 * Datasheet: http://www.nxp.com/acrobat/datasheets/PCA9532_3.pdf
Riku Voipioe14fa822008-05-31 14:43:41 +01008 */
9
10#ifndef __LINUX_PCA9532_H
11#define __LINUX_PCA9532_H
12
13#include <linux/leds.h>
Riku Voipio934cd3f2008-12-03 08:21:36 +000014#include <linux/workqueue.h>
Phil Reidfa4191a2016-06-14 15:36:17 +080015#include <dt-bindings/leds/leds-pca9532.h>
Riku Voipioe14fa822008-05-31 14:43:41 +010016
17enum pca9532_state {
18 PCA9532_OFF = 0x0,
19 PCA9532_ON = 0x1,
20 PCA9532_PWM0 = 0x2,
Felix Brack28c5fe92017-04-13 09:51:38 +020021 PCA9532_PWM1 = 0x3,
22 PCA9532_KEEP = 0xff,
Riku Voipioe14fa822008-05-31 14:43:41 +010023};
24
Riku Voipioe14fa822008-05-31 14:43:41 +010025struct pca9532_led {
26 u8 id;
27 struct i2c_client *client;
Phil Reidfa4191a2016-06-14 15:36:17 +080028 const char *name;
29 const char *default_trigger;
Riku Voipioe14fa822008-05-31 14:43:41 +010030 struct led_classdev ldev;
Antonio Ospite9695fff2009-11-28 12:55:51 +010031 struct work_struct work;
Phil Reidfa4191a2016-06-14 15:36:17 +080032 u32 type;
Riku Voipioe14fa822008-05-31 14:43:41 +010033 enum pca9532_state state;
34};
35
36struct pca9532_platform_data {
37 struct pca9532_led leds[16];
38 u8 pwm[2];
39 u8 psc[2];
Joachim Eastwood3c1ab502011-05-24 17:13:23 -070040 int gpio_base;
Riku Voipioe14fa822008-05-31 14:43:41 +010041};
42
43#endif /* __LINUX_PCA9532_H */