diff options
Diffstat (limited to 'drivers/net/can/flexcan.c')
-rw-r--r-- | drivers/net/can/flexcan.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index 0289a6d86f66..769d29ed106d 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/can.h> | 23 | #include <linux/can.h> |
24 | #include <linux/can/dev.h> | 24 | #include <linux/can/dev.h> |
25 | #include <linux/can/error.h> | 25 | #include <linux/can/error.h> |
26 | #include <linux/can/led.h> | ||
26 | #include <linux/can/platform/flexcan.h> | 27 | #include <linux/can/platform/flexcan.h> |
27 | #include <linux/clk.h> | 28 | #include <linux/clk.h> |
28 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
@@ -564,6 +565,8 @@ static int flexcan_read_frame(struct net_device *dev) | |||
564 | stats->rx_packets++; | 565 | stats->rx_packets++; |
565 | stats->rx_bytes += cf->can_dlc; | 566 | stats->rx_bytes += cf->can_dlc; |
566 | 567 | ||
568 | can_led_event(dev, CAN_LED_EVENT_RX); | ||
569 | |||
567 | return 1; | 570 | return 1; |
568 | } | 571 | } |
569 | 572 | ||
@@ -652,6 +655,7 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id) | |||
652 | if (reg_iflag1 & (1 << FLEXCAN_TX_BUF_ID)) { | 655 | if (reg_iflag1 & (1 << FLEXCAN_TX_BUF_ID)) { |
653 | stats->tx_bytes += can_get_echo_skb(dev, 0); | 656 | stats->tx_bytes += can_get_echo_skb(dev, 0); |
654 | stats->tx_packets++; | 657 | stats->tx_packets++; |
658 | can_led_event(dev, CAN_LED_EVENT_TX); | ||
655 | flexcan_write((1 << FLEXCAN_TX_BUF_ID), ®s->iflag1); | 659 | flexcan_write((1 << FLEXCAN_TX_BUF_ID), ®s->iflag1); |
656 | netif_wake_queue(dev); | 660 | netif_wake_queue(dev); |
657 | } | 661 | } |
@@ -865,6 +869,9 @@ static int flexcan_open(struct net_device *dev) | |||
865 | err = flexcan_chip_start(dev); | 869 | err = flexcan_chip_start(dev); |
866 | if (err) | 870 | if (err) |
867 | goto out_close; | 871 | goto out_close; |
872 | |||
873 | can_led_event(dev, CAN_LED_EVENT_OPEN); | ||
874 | |||
868 | napi_enable(&priv->napi); | 875 | napi_enable(&priv->napi); |
869 | netif_start_queue(dev); | 876 | netif_start_queue(dev); |
870 | 877 | ||
@@ -893,6 +900,8 @@ static int flexcan_close(struct net_device *dev) | |||
893 | 900 | ||
894 | close_candev(dev); | 901 | close_candev(dev); |
895 | 902 | ||
903 | can_led_event(dev, CAN_LED_EVENT_STOP); | ||
904 | |||
896 | return 0; | 905 | return 0; |
897 | } | 906 | } |
898 | 907 | ||
@@ -1092,6 +1101,8 @@ static int flexcan_probe(struct platform_device *pdev) | |||
1092 | goto failed_register; | 1101 | goto failed_register; |
1093 | } | 1102 | } |
1094 | 1103 | ||
1104 | devm_can_led_init(dev); | ||
1105 | |||
1095 | dev_info(&pdev->dev, "device registered (reg_base=%p, irq=%d)\n", | 1106 | dev_info(&pdev->dev, "device registered (reg_base=%p, irq=%d)\n", |
1096 | priv->base, dev->irq); | 1107 | priv->base, dev->irq); |
1097 | 1108 | ||