Commit ebc18afd0a150b0285c643a4d3c898e19323683b

Authored by Igor Grinberg
Committed by Tom Rini
1 parent e19a482fdd

cm-t35: use gpio_led driver for status led

Switch to using the generic gpio_led driver instead of the private to
cm_t35 board led implementation.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Tested-by: Nikita Kiryanov <nikita@compulab.co.il>

Showing 3 changed files with 6 additions and 38 deletions Side-by-side Diff

board/compulab/cm_t35/Makefile
... ... @@ -7,5 +7,5 @@
7 7 # SPDX-License-Identifier: GPL-2.0+
8 8 #
9 9  
10   -obj-y += cm_t35.o leds.o
  10 +obj-y += cm_t35.o
board/compulab/cm_t35/leds.c
1   -/*
2   - * (C) Copyright 2011 - 2013 CompuLab, Ltd. <www.compulab.co.il>
3   - *
4   - * Author: Igor Grinberg <grinberg@compulab.co.il>
5   - *
6   - * SPDX-License-Identifier: GPL-2.0+
7   - */
8   -
9   -#include <common.h>
10   -#include <status_led.h>
11   -#include <asm/gpio.h>
12   -
13   -static unsigned int leds[] = { GREEN_LED_GPIO };
14   -
15   -void __led_init(led_id_t mask, int state)
16   -{
17   - if (gpio_request(leds[mask], "") != 0) {
18   - printf("%s: failed requesting GPIO%u\n", __func__, leds[mask]);
19   - return;
20   - }
21   -
22   - gpio_direction_output(leds[mask], 0);
23   -}
24   -
25   -void __led_set(led_id_t mask, int state)
26   -{
27   - gpio_set_value(leds[mask], state == STATUS_LED_ON);
28   -}
29   -
30   -void __led_toggle(led_id_t mask)
31   -{
32   - gpio_set_value(leds[mask], !gpio_get_value(leds[mask]));
33   -}
include/configs/cm_t35.h
... ... @@ -302,12 +302,13 @@
302 302 /* Status LED */
303 303 #define CONFIG_STATUS_LED /* Status LED enabled */
304 304 #define CONFIG_BOARD_SPECIFIC_LED
305   -#define STATUS_LED_GREEN 0
306   -#define STATUS_LED_BIT STATUS_LED_GREEN
  305 +#define CONFIG_GPIO_LED
  306 +#define GREEN_LED_GPIO 186 /* CM-T35 Green LED is GPIO186 */
  307 +#define GREEN_LED_DEV 0
  308 +#define STATUS_LED_BIT GREEN_LED_GPIO
307 309 #define STATUS_LED_STATE STATUS_LED_ON
308 310 #define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2)
309   -#define STATUS_LED_BOOT STATUS_LED_BIT
310   -#define GREEN_LED_GPIO 186 /* CM-T35 Green LED is GPIO186 */
  311 +#define STATUS_LED_BOOT GREEN_LED_DEV
311 312  
312 313 #define CONFIG_SPLASHIMAGE_GUARD
313 314