diff options
author | Fabio Baltieri <fabio.baltieri@gmail.com> | 2012-12-18 21:50:55 +0400 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2013-01-26 19:58:59 +0400 |
commit | 996a953de02ffb852c9ac736f4e892008ed68884 (patch) | |
tree | dcf301c575ee47331f34c961c36f5658ce32da32 /drivers/net/can/Kconfig | |
parent | 0024d8ad1639e32d717445c69ca813fd19c2a91c (diff) | |
download | linux-996a953de02ffb852c9ac736f4e892008ed68884.tar.xz |
can: add tx/rx LED trigger support
This patch implements the functions to add two LED triggers, named
<ifname>-tx and <ifname>-rx, to a canbus device driver.
Triggers are called from specific handlers by each CAN device driver and
can be disabled altogether with a Kconfig option.
The implementation keeps the LED on when the interface is UP and blinks
the LED on network activity at a configurable rate.
This only supports can-dev based drivers, as it uses some support field
in the can_priv structure.
Supported drivers should call devm_can_led_init() and can_led_event() as
needed.
Cleanup is handled automatically by devres, so no *_exit function is
needed.
Supported events are:
- CAN_LED_EVENT_OPEN: turn on tx/rx LEDs
- CAN_LED_EVENT_STOP: turn off tx/rx LEDs
- CAN_LED_EVENT_TX: trigger tx LED blink
- CAN_LED_EVENT_RX: trigger tx LED blink
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/Kconfig')
-rw-r--r-- | drivers/net/can/Kconfig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig index 0c5a65682d01..1cca19f1c490 100644 --- a/drivers/net/can/Kconfig +++ b/drivers/net/can/Kconfig @@ -51,6 +51,17 @@ config CAN_CALC_BITTIMING arguments "tq", "prop_seg", "phase_seg1", "phase_seg2" and "sjw". If unsure, say Y. +config CAN_LEDS + bool "Enable LED triggers for Netlink based drivers" + depends on LEDS_CLASS + select LEDS_TRIGGERS + ---help--- + This option adds two LED triggers for packet receive and transmit + events on each supported CAN device. + + Say Y here if you are working on a system with led-class supported + LEDs and you want to use them as canbus activity indicators. + config CAN_AT91 tristate "Atmel AT91 onchip CAN controller" depends on ARCH_AT91SAM9263 || ARCH_AT91SAM9X5 |