linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb_8dev: add LED trigger support
@ 2012-12-17 21:19 Bernd Krumboeck
  2012-12-18 14:05 ` Marc Kleine-Budde
  0 siblings, 1 reply; 4+ messages in thread
From: Bernd Krumboeck @ 2012-12-17 21:19 UTC (permalink / raw)
  To: linux-can; +Cc: linux-usb, info, gediminas, fabio.baltieri, Bernd Krumboeck

Add support for canbus activity led indicators on usb_8dev devices by
calling appropriate can_led functions.

These are only enabled when CONFIG_CAN_LEDS is Y, becomes no-op
otherwise.

Signed-off-by: Bernd Krumboeck <krumboeck@universalnet.at>
---
 drivers/net/can/usb/usb_8dev.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/can/usb/usb_8dev.c b/drivers/net/can/usb/usb_8dev.c
index 660b4f87..adec0d2 100644
--- a/drivers/net/can/usb/usb_8dev.c
+++ b/drivers/net/can/usb/usb_8dev.c
@@ -33,6 +33,7 @@
 #include <linux/can.h>
 #include <linux/can/dev.h>
 #include <linux/can/error.h>
+#include <linux/can/led.h>
 
 /* driver constants */
 #define MAX_RX_URBS			10
@@ -504,6 +505,8 @@ static void usb_8dev_rx_can_msg(struct usb_8dev_priv *priv,
 
 		stats->rx_packets++;
 		stats->rx_bytes += cf->can_dlc;
+
+		can_led_event(priv->netdev, CAN_LED_EVENT_RX);
 	} else {
 		netdev_warn(priv->netdev, "frame type %d unknown",
 			 msg->type);
@@ -606,6 +609,8 @@ static void usb_8dev_write_bulk_callback(struct urb *urb)
 
 	can_get_echo_skb(netdev, context->echo_index);
 
+	can_led_event(netdev, CAN_LED_EVENT_TX);
+
 	/* Release context */
 	context->echo_index = MAX_TX_URBS;
 
@@ -830,6 +835,8 @@ static int usb_8dev_open(struct net_device *netdev)
 	if (err)
 		return err;
 
+	can_led_event(netdev, CAN_LED_EVENT_OPEN);
+
 	/* finally start device */
 	err = usb_8dev_start(priv);
 	if (err) {
@@ -882,6 +889,8 @@ static int usb_8dev_close(struct net_device *netdev)
 
 	close_candev(netdev);
 
+	can_led_event(netdev, CAN_LED_EVENT_STOP);
+
 	return err;
 }
 
@@ -990,6 +999,8 @@ static int usb_8dev_probe(struct usb_interface *intf,
 			 (version>>8) & 0xff, version & 0xff);
 	}
 
+	devm_can_led_init(netdev);
+
 	return 0;
 
 cleanup_cmd_msg_buffer:
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb_8dev: add LED trigger support
  2012-12-17 21:19 [PATCH] usb_8dev: add LED trigger support Bernd Krumboeck
@ 2012-12-18 14:05 ` Marc Kleine-Budde
       [not found]   ` <50D07818.9000108-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Marc Kleine-Budde @ 2012-12-18 14:05 UTC (permalink / raw)
  To: Bernd Krumboeck
  Cc: linux-can, linux-usb, info, gediminas, fabio.baltieri,
	Bernd Krumboeck

[-- Attachment #1: Type: text/plain, Size: 712 bytes --]

On 12/17/2012 10:19 PM, Bernd Krumboeck wrote:
> Add support for canbus activity led indicators on usb_8dev devices by
> calling appropriate can_led functions.
> 
> These are only enabled when CONFIG_CAN_LEDS is Y, becomes no-op
> otherwise.
> 
> Signed-off-by: Bernd Krumboeck <krumboeck@universalnet.at>

Thx. Fabio, can you queue this patch your tree and include it in your
series when you send the next iteration?

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb_8dev: add LED trigger support
       [not found]   ` <50D07818.9000108-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2012-12-18 14:18     ` Fabio Baltieri
       [not found]       ` <20121218141801.GA29522-lYxsXyORJ9v/PtFMR13I2A@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Fabio Baltieri @ 2012-12-18 14:18 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: Bernd Krumboeck, linux-can-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	info-La43T0Mi4bH5xCKuJOYmCvaTkwRoYoCU,
	gediminas-LljXPT5IorFWk0Htik3J/w, Bernd Krumboeck

On Tue, Dec 18, 2012 at 03:05:12PM +0100, Marc Kleine-Budde wrote:
> On 12/17/2012 10:19 PM, Bernd Krumboeck wrote:
> > Add support for canbus activity led indicators on usb_8dev devices by
> > calling appropriate can_led functions.
> > 
> > These are only enabled when CONFIG_CAN_LEDS is Y, becomes no-op
> > otherwise.
> > 
> > Signed-off-by: Bernd Krumboeck <krumboeck-Hi41barv6paIERSsAYjmKA@public.gmane.org>
> 
> Thx. Fabio, can you queue this patch your tree and include it in your
> series when you send the next iteration?

Ok I will. Should I add my Signed-off-by to all the patches I'm sending
as I'm on the submissiom path?

I'll resend the series later tonight.

Thanks,
Fabio

-- 
Fabio Baltieri
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb_8dev: add LED trigger support
       [not found]       ` <20121218141801.GA29522-lYxsXyORJ9v/PtFMR13I2A@public.gmane.org>
@ 2012-12-18 15:15         ` Marc Kleine-Budde
  0 siblings, 0 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2012-12-18 15:15 UTC (permalink / raw)
  To: Fabio Baltieri
  Cc: Bernd Krumboeck, linux-can-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	info-La43T0Mi4bH5xCKuJOYmCvaTkwRoYoCU,
	gediminas-LljXPT5IorFWk0Htik3J/w, Bernd Krumboeck

[-- Attachment #1: Type: text/plain, Size: 1019 bytes --]

On 12/18/2012 03:18 PM, Fabio Baltieri wrote:
> On Tue, Dec 18, 2012 at 03:05:12PM +0100, Marc Kleine-Budde wrote:
>> On 12/17/2012 10:19 PM, Bernd Krumboeck wrote:
>>> Add support for canbus activity led indicators on usb_8dev devices by
>>> calling appropriate can_led functions.
>>>
>>> These are only enabled when CONFIG_CAN_LEDS is Y, becomes no-op
>>> otherwise.
>>>
>>> Signed-off-by: Bernd Krumboeck <krumboeck-Hi41barv6paIERSsAYjmKA@public.gmane.org>
>>
>> Thx. Fabio, can you queue this patch your tree and include it in your
>> series when you send the next iteration?
> 
> Ok I will. Should I add my Signed-off-by to all the patches I'm sending
> as I'm on the submissiom path?

Yes, correct.

Thanks,
Marc


-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-12-18 15:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-17 21:19 [PATCH] usb_8dev: add LED trigger support Bernd Krumboeck
2012-12-18 14:05 ` Marc Kleine-Budde
     [not found]   ` <50D07818.9000108-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-12-18 14:18     ` Fabio Baltieri
     [not found]       ` <20121218141801.GA29522-lYxsXyORJ9v/PtFMR13I2A@public.gmane.org>
2012-12-18 15:15         ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).