linux/include/linux/platform_data/leds-lp55xx.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0-only */
   2/*
   3 * LP55XX Platform Data Header
   4 *
   5 * Copyright (C) 2012 Texas Instruments
   6 *
   7 * Author: Milo(Woogyom) Kim <milo.kim@ti.com>
   8 *
   9 * Derived from leds-lp5521.h, leds-lp5523.h
  10 */
  11
  12#ifndef _LEDS_LP55XX_H
  13#define _LEDS_LP55XX_H
  14
  15/* Clock configuration */
  16#define LP55XX_CLOCK_AUTO       0
  17#define LP55XX_CLOCK_INT        1
  18#define LP55XX_CLOCK_EXT        2
  19
  20struct lp55xx_led_config {
  21        const char *name;
  22        const char *default_trigger;
  23        u8 chan_nr;
  24        u8 led_current; /* mA x10, 0 if led is not connected */
  25        u8 max_current;
  26};
  27
  28struct lp55xx_predef_pattern {
  29        const u8 *r;
  30        const u8 *g;
  31        const u8 *b;
  32        u8 size_r;
  33        u8 size_g;
  34        u8 size_b;
  35};
  36
  37enum lp8501_pwr_sel {
  38        LP8501_ALL_VDD,         /* D1~9 are connected to VDD */
  39        LP8501_6VDD_3VOUT,      /* D1~6 with VDD, D7~9 with VOUT */
  40        LP8501_3VDD_6VOUT,      /* D1~6 with VOUT, D7~9 with VDD */
  41        LP8501_ALL_VOUT,        /* D1~9 are connected to VOUT */
  42};
  43
  44/*
  45 * struct lp55xx_platform_data
  46 * @led_config        : Configurable led class device
  47 * @num_channels      : Number of LED channels
  48 * @label             : Used for naming LEDs
  49 * @clock_mode        : Input clock mode. LP55XX_CLOCK_AUTO or _INT or _EXT
  50 * @setup_resources   : Platform specific function before enabling the chip
  51 * @release_resources : Platform specific function after  disabling the chip
  52 * @enable            : EN pin control by platform side
  53 * @patterns          : Predefined pattern data for RGB channels
  54 * @num_patterns      : Number of patterns
  55 * @update_config     : Value of CONFIG register
  56 */
  57struct lp55xx_platform_data {
  58
  59        /* LED channel configuration */
  60        struct lp55xx_led_config *led_config;
  61        u8 num_channels;
  62        const char *label;
  63
  64        /* Clock configuration */
  65        u8 clock_mode;
  66
  67        /* optional enable GPIO */
  68        int enable_gpio;
  69
  70        /* Predefined pattern data */
  71        struct lp55xx_predef_pattern *patterns;
  72        unsigned int num_patterns;
  73
  74        /* LP8501 specific */
  75        enum lp8501_pwr_sel pwr_sel;
  76};
  77
  78#endif /* _LEDS_LP55XX_H */
  79