aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorUri Mashiach2017-01-19 10:51:45 +0200
committerTom Rini2017-01-21 15:12:33 -0500
commit2d8d190c8394b43c0989cdb04a50cb48d4e1f8da (patch)
treea19e034f406aba9bfc07e8ef0d4fafc6fa4a04b7 /drivers/misc
parent79267edd10fde0815c382157b9cb280166637fac (diff)
status_led: Kconfig migration
Move all of the status LED feature to drivers/led/Kconfig. The LED status definitions were moved from the board configuration files to the defconfig files. TBD: Move all of the definitions in the include/status_led.h to the relevant board's defconfig files. Tested boards: CL-SOM-AM57x, CM-T335 Signed-off-by: Uri Mashiach <uri.mashiach@compulab.co.il>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/Makefile4
-rw-r--r--drivers/misc/gpio_led.c26
-rw-r--r--drivers/misc/pca9551_led.c2
-rw-r--r--drivers/misc/status_led.c76
4 files changed, 54 insertions, 54 deletions
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 9fbb5a7880c..e3151ea097c 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -18,7 +18,7 @@ obj-$(CONFIG_CROS_EC_SANDBOX) += cros_ec_sandbox.o
obj-$(CONFIG_CROS_EC_SPI) += cros_ec_spi.o
endif
obj-$(CONFIG_FSL_IIM) += fsl_iim.o
-obj-$(CONFIG_GPIO_LED) += gpio_led.o
+obj-$(CONFIG_LED_STATUS_GPIO) += gpio_led.o
obj-$(CONFIG_I2C_EEPROM) += i2c_eeprom.o
obj-$(CONFIG_FSL_MC9SDZ60) += mc9sdz60.o
obj-$(CONFIG_MXC_OCOTP) += mxc_ocotp.o
@@ -34,7 +34,7 @@ endif
endif
obj-$(CONFIG_SMSC_LPC47M) += smsc_lpc47m.o
obj-$(CONFIG_SMSC_SIO1007) += smsc_sio1007.o
-obj-$(CONFIG_STATUS_LED) += status_led.o
+obj-$(CONFIG_LED_STATUS) += status_led.o
obj-$(CONFIG_SANDBOX) += swap_case.o
ifdef CONFIG_SPL_OF_PLATDATA
ifdef CONFIG_SPL_BUILD
diff --git a/drivers/misc/gpio_led.c b/drivers/misc/gpio_led.c
index 164c30db382..b913069849a 100644
--- a/drivers/misc/gpio_led.c
+++ b/drivers/misc/gpio_led.c
@@ -17,7 +17,7 @@ static led_id_t gpio_led_inv[] = CONFIG_GPIO_LED_INVERTED_TABLE;
static int gpio_led_gpio_value(led_id_t mask, int state)
{
- int i, gpio_value = (state == STATUS_LED_ON);
+ int i, gpio_value = (state == CONFIG_LED_STATUS_ON);
for (i = 0; i < ARRAY_SIZE(gpio_led_inv); i++) {
if (gpio_led_inv[i] == mask)
@@ -56,51 +56,51 @@ void __led_toggle(led_id_t mask)
/* 'generic' override of colored LED stubs, to use GPIO functions instead */
-#ifdef STATUS_LED_RED
+#ifdef CONFIG_LED_STATUS_RED
void red_led_on(void)
{
- __led_set(STATUS_LED_RED, STATUS_LED_ON);
+ __led_set(CONFIG_LED_STATUS_RED, CONFIG_LED_STATUS_ON);
}
void red_led_off(void)
{
- __led_set(STATUS_LED_RED, STATUS_LED_OFF);
+ __led_set(CONFIG_LED_STATUS_RED, CONFIG_LED_STATUS_OFF);
}
#endif
-#ifdef STATUS_LED_GREEN
+#ifdef CONFIG_LED_STATUS_GREEN
void green_led_on(void)
{
- __led_set(STATUS_LED_GREEN, STATUS_LED_ON);
+ __led_set(CONFIG_LED_STATUS_GREEN, CONFIG_LED_STATUS_ON);
}
void green_led_off(void)
{
- __led_set(STATUS_LED_GREEN, STATUS_LED_OFF);
+ __led_set(CONFIG_LED_STATUS_GREEN, CONFIG_LED_STATUS_OFF);
}
#endif
-#ifdef STATUS_LED_YELLOW
+#ifdef CONFIG_LED_STATUS_YELLOW
void yellow_led_on(void)
{
- __led_set(STATUS_LED_YELLOW, STATUS_LED_ON);
+ __led_set(CONFIG_LED_STATUS_YELLOW, CONFIG_LED_STATUS_ON);
}
void yellow_led_off(void)
{
- __led_set(STATUS_LED_YELLOW, STATUS_LED_OFF);
+ __led_set(CONFIG_LED_STATUS_YELLOW, CONFIG_LED_STATUS_OFF);
}
#endif
-#ifdef STATUS_LED_BLUE
+#ifdef CONFIG_LED_STATUS_BLUE
void blue_led_on(void)
{
- __led_set(STATUS_LED_BLUE, STATUS_LED_ON);
+ __led_set(CONFIG_LED_STATUS_BLUE, CONFIG_LED_STATUS_ON);
}
void blue_led_off(void)
{
- __led_set(STATUS_LED_BLUE, STATUS_LED_OFF);
+ __led_set(CONFIG_LED_STATUS_BLUE, CONFIG_LED_STATUS_OFF);
}
#endif
diff --git a/drivers/misc/pca9551_led.c b/drivers/misc/pca9551_led.c
index 4da031985f7..226a31ab1b9 100644
--- a/drivers/misc/pca9551_led.c
+++ b/drivers/misc/pca9551_led.c
@@ -124,7 +124,7 @@ void __led_init(led_id_t id, int state)
void __led_set(led_id_t mask, int state)
{
- if (state == STATUS_LED_OFF)
+ if (state == CONFIG_LED_STATUS_OFF)
pca9551_led_set_state(mask, PCA9551_LED_STATE_OFF);
else
pca9551_led_set_state(mask, PCA9551_LED_STATE_ON);
diff --git a/drivers/misc/status_led.c b/drivers/misc/status_led.c
index 31e88319d15..3773c85424f 100644
--- a/drivers/misc/status_led.c
+++ b/drivers/misc/status_led.c
@@ -27,45 +27,45 @@ typedef struct {
} led_dev_t;
led_dev_t led_dev[] = {
- { STATUS_LED_BIT,
- STATUS_LED_STATE,
- STATUS_LED_PERIOD,
- 0,
- },
-#if defined(STATUS_LED_BIT1)
- { STATUS_LED_BIT1,
- STATUS_LED_STATE1,
- STATUS_LED_PERIOD1,
- 0,
- },
+ { CONFIG_LED_STATUS_BIT,
+ CONFIG_LED_STATUS_STATE,
+ LED_STATUS_PERIOD,
+ 0,
+ },
+#if defined(CONFIG_LED_STATUS1)
+ { CONFIG_LED_STATUS_BIT1,
+ CONFIG_LED_STATUS_STATE1,
+ LED_STATUS_PERIOD1,
+ 0,
+ },
#endif
-#if defined(STATUS_LED_BIT2)
- { STATUS_LED_BIT2,
- STATUS_LED_STATE2,
- STATUS_LED_PERIOD2,
- 0,
- },
+#if defined(CONFIG_LED_STATUS2)
+ { CONFIG_LED_STATUS_BIT2,
+ CONFIG_LED_STATUS_STATE2,
+ LED_STATUS_PERIOD2,
+ 0,
+ },
#endif
-#if defined(STATUS_LED_BIT3)
- { STATUS_LED_BIT3,
- STATUS_LED_STATE3,
- STATUS_LED_PERIOD3,
- 0,
- },
+#if defined(CONFIG_LED_STATUS3)
+ { CONFIG_LED_STATUS_BIT3,
+ CONFIG_LED_STATUS_STATE3,
+ LED_STATUS_PERIOD3,
+ 0,
+ },
#endif
-#if defined(STATUS_LED_BIT4)
- { STATUS_LED_BIT4,
- STATUS_LED_STATE4,
- STATUS_LED_PERIOD4,
- 0,
- },
+#if defined(CONFIG_LED_STATUS4)
+ { CONFIG_LED_STATUS_BIT4,
+ CONFIG_LED_STATUS_STATE4,
+ LED_STATUS_PERIOD4,
+ 0,
+ },
#endif
-#if defined(STATUS_LED_BIT5)
- { STATUS_LED_BIT5,
- STATUS_LED_STATE5,
- STATUS_LED_PERIOD5,
- 0,
- },
+#if defined(CONFIG_LED_STATUS5)
+ { CONFIG_LED_STATUS_BIT5,
+ CONFIG_LED_STATUS_STATE5,
+ LED_STATUS_PERIOD5,
+ 0,
+ },
#endif
};
@@ -93,7 +93,7 @@ void status_led_tick (ulong timestamp)
for (i = 0, ld = led_dev; i < MAX_LED_DEV; i++, ld++) {
- if (ld->state != STATUS_LED_BLINKING)
+ if (ld->state != CONFIG_LED_STATUS_BLINKING)
continue;
if (++ld->cnt >= ld->period) {
@@ -117,9 +117,9 @@ void status_led_set (int led, int state)
ld = &led_dev[led];
ld->state = state;
- if (state == STATUS_LED_BLINKING) {
+ if (state == CONFIG_LED_STATUS_BLINKING) {
ld->cnt = 0; /* always start with full period */
- state = STATUS_LED_ON; /* always start with LED _ON_ */
+ state = CONFIG_LED_STATUS_ON; /* always start with LED _ON_ */
}
__led_set (ld->mask, state);
}