Line data Source code
1 0 : /* 2 : * Copyright (c) 2020 Seagate Technology LLC 3 : * Copyright (c) 2022 Grinn 4 : * 5 : * SPDX-License-Identifier: Apache-2.0 6 : */ 7 : 8 : 9 : #ifndef ZEPHYR_INCLUDE_DRIVERS_LED_LP50XX_H_ 10 : #define ZEPHYR_INCLUDE_DRIVERS_LED_LP50XX_H_ 11 : 12 0 : #define LP50XX_COLORS_PER_LED 3 13 : 14 0 : #define LP5009_MAX_LEDS 3 15 0 : #define LP5012_MAX_LEDS 4 16 0 : #define LP5018_MAX_LEDS 6 17 0 : #define LP5024_MAX_LEDS 8 18 0 : #define LP5030_MAX_LEDS 10 19 0 : #define LP5036_MAX_LEDS 12 20 : 21 : /* 22 : * LED channels mapping. 23 : */ 24 : 25 : /* Bank channels */ 26 0 : #define LP50XX_BANK_CHAN_BASE 0 27 0 : #define LP50XX_BANK_BRIGHT_CHAN LP50XX_BANK_CHAN_BASE 28 0 : #define LP50XX_BANK_COL1_CHAN(led) (LP50XX_BANK_CHAN_BASE + 1) 29 0 : #define LP50XX_BANK_COL2_CHAN(led) (LP50XX_BANK_CHAN_BASE + 2) 30 0 : #define LP50XX_BANK_COL3_CHAN(led) (LP50XX_BANK_CHAN_BASE + 3) 31 : 32 : /* LED brightness channels. */ 33 0 : #define LP50XX_LED_BRIGHT_CHAN_BASE 4 34 0 : #define LP50XX_LED_BRIGHT_CHAN(led) (LP50XX_LED_BRIGHT_CHAN_BASE + led) 35 : 36 : /* 37 : * LED color channels. 38 : * 39 : * Each channel definition is compatible with the following chips: 40 : * - LP5012_XXX => LP5009 / LP5012 41 : * - LP5024_XXX => LP5018 / LP5024 42 : * - LP5036_XXX => LP5030 / LP5036 43 : */ 44 0 : #define LP5012_LED_COL_CHAN_BASE 8 45 0 : #define LP5012_LED_COL1_CHAN(led) \ 46 : (LP5012_LED_COL_CHAN_BASE + led * LP50XX_COLORS_PER_LED) 47 0 : #define LP5012_LED_COL2_CHAN(led) \ 48 : (LP5012_LED_COL_CHAN_BASE + led * LP50XX_COLORS_PER_LED + 1) 49 0 : #define LP5012_LED_COL3_CHAN(led) \ 50 : (LP5012_LED_COL_CHAN_BASE + led * LP50XX_COLORS_PER_LED + 2) 51 : 52 0 : #define LP5024_LED_COL_CHAN_BASE 12 53 0 : #define LP5024_LED_COL1_CHAN(led) \ 54 : (LP5024_LED_COL_CHAN_BASE + led * LP50XX_COLORS_PER_LED) 55 0 : #define LP5024_LED_COL2_CHAN(led) \ 56 : (LP5024_LED_COL_CHAN_BASE + led * LP50XX_COLORS_PER_LED + 1) 57 0 : #define LP5024_LED_COL3_CHAN(led) \ 58 : (LP5024_LED_COL_CHAN_BASE + led * LP50XX_COLORS_PER_LED + 2) 59 : 60 0 : #define LP5036_LED_COL_CHAN_BASE 16 61 0 : #define LP5036_LED_COL1_CHAN(led) \ 62 : (LP5036_LED_COL_CHAN_BASE + led * LP50XX_COLORS_PER_LED) 63 0 : #define LP5036_LED_COL2_CHAN(led) \ 64 : (LP5036_LED_COL_CHAN_BASE + led * LP50XX_COLORS_PER_LED + 1) 65 0 : #define LP5036_LED_COL3_CHAN(led) \ 66 : (LP5036_LED_COL_CHAN_BASE + led * LP50XX_COLORS_PER_LED + 2) 67 : 68 : #endif /* ZEPHYR_INCLUDE_DRIVERS_LED_LP50XX_H_ */