1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * LP55XX Platform Data Header
5 * Copyright (C) 2012 Texas Instruments
9 * Derived from leds-lp5521.h, leds-lp5523.h
12 #ifndef _LEDS_LP55XX_H
13 #define _LEDS_LP55XX_H
15 #include <linux/gpio/consumer.h>
16 #include <linux/led-class-multicolor.h>
18 /* Clock configuration */
19 #define LP55XX_CLOCK_AUTO 0
20 #define LP55XX_CLOCK_INT 1
21 #define LP55XX_CLOCK_EXT 2
23 #define LP55XX_MAX_GROUPED_CHAN 4
25 struct lp55xx_led_config {
27 const char *default_trigger;
29 u8 led_current; /* mA x10, 0 if led is not connected */
32 unsigned int max_channel;
33 int color_id[LED_COLOR_ID_MAX];
34 int output_num[LED_COLOR_ID_MAX];
37 struct lp55xx_predef_pattern {
47 LP8501_ALL_VDD, /* D1~9 are connected to VDD */
48 LP8501_6VDD_3VOUT, /* D1~6 with VDD, D7~9 with VOUT */
49 LP8501_3VDD_6VOUT, /* D1~6 with VOUT, D7~9 with VDD */
50 LP8501_ALL_VOUT, /* D1~9 are connected to VOUT */
54 * struct lp55xx_platform_data
55 * @led_config : Configurable led class device
56 * @num_channels : Number of LED channels
57 * @label : Used for naming LEDs
58 * @clock_mode : Input clock mode. LP55XX_CLOCK_AUTO or _INT or _EXT
59 * @setup_resources : Platform specific function before enabling the chip
60 * @release_resources : Platform specific function after disabling the chip
61 * @enable_gpiod : enable GPIO descriptor
62 * @patterns : Predefined pattern data for RGB channels
63 * @num_patterns : Number of patterns
64 * @update_config : Value of CONFIG register
66 struct lp55xx_platform_data {
68 /* LED channel configuration */
69 struct lp55xx_led_config *led_config;
73 /* Clock configuration */
76 /* Charge pump mode */
79 /* optional enable GPIO */
80 struct gpio_desc *enable_gpiod;
82 /* Predefined pattern data */
83 struct lp55xx_predef_pattern *patterns;
84 unsigned int num_patterns;
87 enum lp8501_pwr_sel pwr_sel;
90 #endif /* _LEDS_LP55XX_H */