All of lore.kernel.org
 help / color / mirror / Atom feed
* LEDs: documentation
@ 2015-03-12  9:21 Yegor Yefremov
  2015-03-12 14:00 ` Yegor Yefremov
       [not found] ` <CAJ=nTssN6M13-aiAHA=jY7EhGsRbYqrFDoTb-o43YFYtndgb1A@mail.gmail.com>
  0 siblings, 2 replies; 9+ messages in thread
From: Yegor Yefremov @ 2015-03-12  9:21 UTC (permalink / raw)
  To: linux-can; +Cc: fabio.baltieri

I have am335x based system and would like to use LED feature. Where
can I find info about CAN LEDs subsystem? How can I configure LEDs via
device tree?

So far I couldn't find anything related under
Documentation/devicetree/bindings/net/can/ or in
Documentation/networking/can.txt.

Yegor

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

* Re: LEDs: documentation
  2015-03-12  9:21 LEDs: documentation Yegor Yefremov
@ 2015-03-12 14:00 ` Yegor Yefremov
  2015-03-13 13:01   ` Mirza Krak
       [not found] ` <CAJ=nTssN6M13-aiAHA=jY7EhGsRbYqrFDoTb-o43YFYtndgb1A@mail.gmail.com>
  1 sibling, 1 reply; 9+ messages in thread
From: Yegor Yefremov @ 2015-03-12 14:00 UTC (permalink / raw)
  To: linux-can; +Cc: fabio.baltieri

On Thu, Mar 12, 2015 at 10:21 AM, Yegor Yefremov
<yegorslists@googlemail.com> wrote:
> I have am335x based system and would like to use LED feature. Where
> can I find info about CAN LEDs subsystem? How can I configure LEDs via
> device tree?
>
> So far I couldn't find anything related under
> Documentation/devicetree/bindings/net/can/ or in
> Documentation/networking/can.txt.

So I got "can0-tx" running. But I have only one LED, that is called
"Data" and it just shows activity. It seems like one cannot combine
two triggers for one LED. Do I see it right? If yes, what about
creating another event called iface-rxtx or iface-activity like LEDs
in network interfaces?

What about errors? We have also "Error" LED. The main purpose is to
indicate "bus off" state.

Yegor

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

* Re: LEDs: documentation
       [not found] ` <CAJ=nTssN6M13-aiAHA=jY7EhGsRbYqrFDoTb-o43YFYtndgb1A@mail.gmail.com>
@ 2015-03-13 10:46   ` Mirza Krak
  2015-03-13 10:55     ` Yegor Yefremov
  0 siblings, 1 reply; 9+ messages in thread
From: Mirza Krak @ 2015-03-13 10:46 UTC (permalink / raw)
  To: Yegor Yefremov; +Cc: linux-can, fabio.baltieri

And also take a look at CONFIG_CAN_LEDS.

2015-03-13 11:39 GMT+01:00 Mirza Krak <mirza.krak@hostmobility.com>:
> See Documentation/leds/leds-class.
>
> You can use a CAN device as a led trigger.
>
> There is no such thing as a CAN LEDs subsystem.
>
> 2015-03-12 10:21 GMT+01:00 Yegor Yefremov <yegorslists@googlemail.com>:
>>
>> I have am335x based system and would like to use LED feature. Where
>> can I find info about CAN LEDs subsystem? How can I configure LEDs via
>> device tree?
>>
>> So far I couldn't find anything related under
>> Documentation/devicetree/bindings/net/can/ or in
>> Documentation/networking/can.txt.
>>
>> Yegor
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-can" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
>
>
> --
> Med Vänliga Hälsningar / Best Regards
>
> *******************************************************************
> Mirza Krak
> Host Mobility AB
> mirza.krak@hostmobility.com
> Anders Personsgatan 12, 416 64 Göteborg
> Sweden
> http://www.hostmobility.com
> Direct: +46 31 31 32 704
> Phone: +46 31 31 32 700
> Fax: +46 31 80 67 51
> Mobile: +46 730 28 06 22
> *******************************************************************
>



-- 
Med Vänliga Hälsningar / Best Regards

*******************************************************************
Mirza Krak
Host Mobility AB
mirza.krak@hostmobility.com
Anders Personsgatan 12, 416 64 Göteborg
Sweden
http://www.hostmobility.com
Direct: +46 31 31 32 704
Phone: +46 31 31 32 700
Fax: +46 31 80 67 51
Mobile: +46 730 28 06 22
*******************************************************************

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

* Re: LEDs: documentation
  2015-03-13 10:46   ` Mirza Krak
@ 2015-03-13 10:55     ` Yegor Yefremov
  0 siblings, 0 replies; 9+ messages in thread
From: Yegor Yefremov @ 2015-03-13 10:55 UTC (permalink / raw)
  To: Mirza Krak; +Cc: linux-can, fabio.baltieri

Thanks for the info. Have you read my second post? I got CAN LEDs
working. The only problem I have now is, that CAN driver provides
separate events for rx and tx. But I have only one LED, that should
show both, i.e. CAN port activity.

On Fri, Mar 13, 2015 at 11:46 AM, Mirza Krak
<mirza.krak@hostmobility.com> wrote:
> And also take a look at CONFIG_CAN_LEDS.
>
> 2015-03-13 11:39 GMT+01:00 Mirza Krak <mirza.krak@hostmobility.com>:
>> See Documentation/leds/leds-class.
>>
>> You can use a CAN device as a led trigger.
>>
>> There is no such thing as a CAN LEDs subsystem.
>>
>> 2015-03-12 10:21 GMT+01:00 Yegor Yefremov <yegorslists@googlemail.com>:
>>>
>>> I have am335x based system and would like to use LED feature. Where
>>> can I find info about CAN LEDs subsystem? How can I configure LEDs via
>>> device tree?
>>>
>>> So far I couldn't find anything related under
>>> Documentation/devicetree/bindings/net/can/ or in
>>> Documentation/networking/can.txt.
>>>
>>> Yegor
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-can" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>>
>>
>>
>> --
>> Med Vänliga Hälsningar / Best Regards
>>
>> *******************************************************************
>> Mirza Krak
>> Host Mobility AB
>> mirza.krak@hostmobility.com
>> Anders Personsgatan 12, 416 64 Göteborg
>> Sweden
>> http://www.hostmobility.com
>> Direct: +46 31 31 32 704
>> Phone: +46 31 31 32 700
>> Fax: +46 31 80 67 51
>> Mobile: +46 730 28 06 22
>> *******************************************************************
>>
>
>
>
> --
> Med Vänliga Hälsningar / Best Regards
>
> *******************************************************************
> Mirza Krak
> Host Mobility AB
> mirza.krak@hostmobility.com
> Anders Personsgatan 12, 416 64 Göteborg
> Sweden
> http://www.hostmobility.com
> Direct: +46 31 31 32 704
> Phone: +46 31 31 32 700
> Fax: +46 31 80 67 51
> Mobile: +46 730 28 06 22
> *******************************************************************

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

* Re: LEDs: documentation
  2015-03-12 14:00 ` Yegor Yefremov
@ 2015-03-13 13:01   ` Mirza Krak
  2015-03-13 13:19     ` Yegor Yefremov
  2015-03-13 13:21     ` Mirza Krak
  0 siblings, 2 replies; 9+ messages in thread
From: Mirza Krak @ 2015-03-13 13:01 UTC (permalink / raw)
  To: Yegor Yefremov; +Cc: linux-can, fabio.baltieri

I haven't actually ever tried running events on CAN device but I have
on network devices and it would surprise me if it does not work in the
same way (can is a network interface? :)).

There you can combine events trough the "mode" attribute.

/sys/class/leds/mx4-wifi# ls
brightness      device_name     max_brightness  power           trigger
device          interval        mode            subsystem       uevent

/sys/class/leds/mx4-wifi# cat mode
link tx rx

/sys/class/leds/mx4-wifi# cat trigger
none nand-disk mmc0 [netdev]

/sys/class/leds/mx4-wifi# cat device_name
wlan0

2015-03-12 15:00 GMT+01:00 Yegor Yefremov <yegorslists@googlemail.com>:
> On Thu, Mar 12, 2015 at 10:21 AM, Yegor Yefremov
> <yegorslists@googlemail.com> wrote:
>> I have am335x based system and would like to use LED feature. Where
>> can I find info about CAN LEDs subsystem? How can I configure LEDs via
>> device tree?
>>
>> So far I couldn't find anything related under
>> Documentation/devicetree/bindings/net/can/ or in
>> Documentation/networking/can.txt.
>
> So I got "can0-tx" running. But I have only one LED, that is called
> "Data" and it just shows activity. It seems like one cannot combine
> two triggers for one LED. Do I see it right? If yes, what about
> creating another event called iface-rxtx or iface-activity like LEDs
> in network interfaces?
>
> What about errors? We have also "Error" LED. The main purpose is to
> indicate "bus off" state.
>
> Yegor
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Med Vänliga Hälsningar / Best Regards

*******************************************************************
Mirza Krak
Host Mobility AB
mirza.krak@hostmobility.com
Anders Personsgatan 12, 416 64 Göteborg
Sweden
http://www.hostmobility.com
Direct: +46 31 31 32 704
Phone: +46 31 31 32 700
Fax: +46 31 80 67 51
Mobile: +46 730 28 06 22
*******************************************************************

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

* Re: LEDs: documentation
  2015-03-13 13:01   ` Mirza Krak
@ 2015-03-13 13:19     ` Yegor Yefremov
  2015-03-13 13:21     ` Mirza Krak
  1 sibling, 0 replies; 9+ messages in thread
From: Yegor Yefremov @ 2015-03-13 13:19 UTC (permalink / raw)
  To: Mirza Krak; +Cc: linux-can, fabio.baltieri

I have a gpio-based LED entry and it doesn't provide a mode option:

rightness max_brightness subsystem uevent device power trigger

Trigger is:

none nand-disk [can0-tx] can0-rx timer oneshot heartbeat backlight
gpio cpu0 default-on transient mmc0 mmc1 phy0rx phy0tx phy0assoc
phy0radio

As you can see tx and rx are separate events/triggers

On Fri, Mar 13, 2015 at 2:01 PM, Mirza Krak <mirza.krak@hostmobility.com> wrote:
> I haven't actually ever tried running events on CAN device but I have
> on network devices and it would surprise me if it does not work in the
> same way (can is a network interface? :)).
>
> There you can combine events trough the "mode" attribute.
>
> /sys/class/leds/mx4-wifi# ls
> brightness      device_name     max_brightness  power           trigger
> device          interval        mode            subsystem       uevent
>
> /sys/class/leds/mx4-wifi# cat mode
> link tx rx
>
> /sys/class/leds/mx4-wifi# cat trigger
> none nand-disk mmc0 [netdev]
>
> /sys/class/leds/mx4-wifi# cat device_name
> wlan0
>
> 2015-03-12 15:00 GMT+01:00 Yegor Yefremov <yegorslists@googlemail.com>:
>> On Thu, Mar 12, 2015 at 10:21 AM, Yegor Yefremov
>> <yegorslists@googlemail.com> wrote:
>>> I have am335x based system and would like to use LED feature. Where
>>> can I find info about CAN LEDs subsystem? How can I configure LEDs via
>>> device tree?
>>>
>>> So far I couldn't find anything related under
>>> Documentation/devicetree/bindings/net/can/ or in
>>> Documentation/networking/can.txt.
>>
>> So I got "can0-tx" running. But I have only one LED, that is called
>> "Data" and it just shows activity. It seems like one cannot combine
>> two triggers for one LED. Do I see it right? If yes, what about
>> creating another event called iface-rxtx or iface-activity like LEDs
>> in network interfaces?
>>
>> What about errors? We have also "Error" LED. The main purpose is to
>> indicate "bus off" state.
>>
>> Yegor
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-can" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
>
> --
> Med Vänliga Hälsningar / Best Regards
>
> *******************************************************************
> Mirza Krak
> Host Mobility AB
> mirza.krak@hostmobility.com
> Anders Personsgatan 12, 416 64 Göteborg
> Sweden
> http://www.hostmobility.com
> Direct: +46 31 31 32 704
> Phone: +46 31 31 32 700
> Fax: +46 31 80 67 51
> Mobile: +46 730 28 06 22
> *******************************************************************

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

* Re: LEDs: documentation
  2015-03-13 13:01   ` Mirza Krak
  2015-03-13 13:19     ` Yegor Yefremov
@ 2015-03-13 13:21     ` Mirza Krak
  2015-03-13 14:12       ` Yegor Yefremov
  2015-03-13 14:19       ` Fabio Baltieri
  1 sibling, 2 replies; 9+ messages in thread
From: Mirza Krak @ 2015-03-13 13:21 UTC (permalink / raw)
  To: Yegor Yefremov; +Cc: linux-can, fabio.baltieri

Realized now that the ledtrig-netdev driver is not mainline :).

Found it here https://lkml.org/lkml/2010/11/14/116.

Tested it with a CAN device now, and it works great.

2015-03-13 14:01 GMT+01:00 Mirza Krak <mirza.krak@hostmobility.com>:
> I haven't actually ever tried running events on CAN device but I have
> on network devices and it would surprise me if it does not work in the
> same way (can is a network interface? :)).
>
> There you can combine events trough the "mode" attribute.
>
> /sys/class/leds/mx4-wifi# ls
> brightness      device_name     max_brightness  power           trigger
> device          interval        mode            subsystem       uevent
>
> /sys/class/leds/mx4-wifi# cat mode
> link tx rx
>
> /sys/class/leds/mx4-wifi# cat trigger
> none nand-disk mmc0 [netdev]
>
> /sys/class/leds/mx4-wifi# cat device_name
> wlan0
>
> 2015-03-12 15:00 GMT+01:00 Yegor Yefremov <yegorslists@googlemail.com>:
>> On Thu, Mar 12, 2015 at 10:21 AM, Yegor Yefremov
>> <yegorslists@googlemail.com> wrote:
>>> I have am335x based system and would like to use LED feature. Where
>>> can I find info about CAN LEDs subsystem? How can I configure LEDs via
>>> device tree?
>>>
>>> So far I couldn't find anything related under
>>> Documentation/devicetree/bindings/net/can/ or in
>>> Documentation/networking/can.txt.
>>
>> So I got "can0-tx" running. But I have only one LED, that is called
>> "Data" and it just shows activity. It seems like one cannot combine
>> two triggers for one LED. Do I see it right? If yes, what about
>> creating another event called iface-rxtx or iface-activity like LEDs
>> in network interfaces?
>>
>> What about errors? We have also "Error" LED. The main purpose is to
>> indicate "bus off" state.
>>
>> Yegor
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-can" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
>
> --
> Med Vänliga Hälsningar / Best Regards
>
> *******************************************************************
> Mirza Krak
> Host Mobility AB
> mirza.krak@hostmobility.com
> Anders Personsgatan 12, 416 64 Göteborg
> Sweden
> http://www.hostmobility.com
> Direct: +46 31 31 32 704
> Phone: +46 31 31 32 700
> Fax: +46 31 80 67 51
> Mobile: +46 730 28 06 22
> *******************************************************************



-- 
Med Vänliga Hälsningar / Best Regards

*******************************************************************
Mirza Krak
Host Mobility AB
mirza.krak@hostmobility.com
Anders Personsgatan 12, 416 64 Göteborg
Sweden
http://www.hostmobility.com
Direct: +46 31 31 32 704
Phone: +46 31 31 32 700
Fax: +46 31 80 67 51
Mobile: +46 730 28 06 22
*******************************************************************

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

* Re: LEDs: documentation
  2015-03-13 13:21     ` Mirza Krak
@ 2015-03-13 14:12       ` Yegor Yefremov
  2015-03-13 14:19       ` Fabio Baltieri
  1 sibling, 0 replies; 9+ messages in thread
From: Yegor Yefremov @ 2015-03-13 14:12 UTC (permalink / raw)
  To: Mirza Krak; +Cc: linux-can, fabio.baltieri

Interesting driver, but not in mainline :-(

Its authors seem to got frustrated after a lot of comments/suggestions. Sad ...

On Fri, Mar 13, 2015 at 2:21 PM, Mirza Krak <mirza.krak@hostmobility.com> wrote:
> Realized now that the ledtrig-netdev driver is not mainline :).
>
> Found it here https://lkml.org/lkml/2010/11/14/116.
>
> Tested it with a CAN device now, and it works great.
>
> 2015-03-13 14:01 GMT+01:00 Mirza Krak <mirza.krak@hostmobility.com>:
>> I haven't actually ever tried running events on CAN device but I have
>> on network devices and it would surprise me if it does not work in the
>> same way (can is a network interface? :)).
>>
>> There you can combine events trough the "mode" attribute.
>>
>> /sys/class/leds/mx4-wifi# ls
>> brightness      device_name     max_brightness  power           trigger
>> device          interval        mode            subsystem       uevent
>>
>> /sys/class/leds/mx4-wifi# cat mode
>> link tx rx
>>
>> /sys/class/leds/mx4-wifi# cat trigger
>> none nand-disk mmc0 [netdev]
>>
>> /sys/class/leds/mx4-wifi# cat device_name
>> wlan0
>>
>> 2015-03-12 15:00 GMT+01:00 Yegor Yefremov <yegorslists@googlemail.com>:
>>> On Thu, Mar 12, 2015 at 10:21 AM, Yegor Yefremov
>>> <yegorslists@googlemail.com> wrote:
>>>> I have am335x based system and would like to use LED feature. Where
>>>> can I find info about CAN LEDs subsystem? How can I configure LEDs via
>>>> device tree?
>>>>
>>>> So far I couldn't find anything related under
>>>> Documentation/devicetree/bindings/net/can/ or in
>>>> Documentation/networking/can.txt.
>>>
>>> So I got "can0-tx" running. But I have only one LED, that is called
>>> "Data" and it just shows activity. It seems like one cannot combine
>>> two triggers for one LED. Do I see it right? If yes, what about
>>> creating another event called iface-rxtx or iface-activity like LEDs
>>> in network interfaces?
>>>
>>> What about errors? We have also "Error" LED. The main purpose is to
>>> indicate "bus off" state.
>>>
>>> Yegor
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-can" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>>
>>
>> --
>> Med Vänliga Hälsningar / Best Regards
>>
>> *******************************************************************
>> Mirza Krak
>> Host Mobility AB
>> mirza.krak@hostmobility.com
>> Anders Personsgatan 12, 416 64 Göteborg
>> Sweden
>> http://www.hostmobility.com
>> Direct: +46 31 31 32 704
>> Phone: +46 31 31 32 700
>> Fax: +46 31 80 67 51
>> Mobile: +46 730 28 06 22
>> *******************************************************************
>
>
>
> --
> Med Vänliga Hälsningar / Best Regards
>
> *******************************************************************
> Mirza Krak
> Host Mobility AB
> mirza.krak@hostmobility.com
> Anders Personsgatan 12, 416 64 Göteborg
> Sweden
> http://www.hostmobility.com
> Direct: +46 31 31 32 704
> Phone: +46 31 31 32 700
> Fax: +46 31 80 67 51
> Mobile: +46 730 28 06 22
> *******************************************************************

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

* Re: LEDs: documentation
  2015-03-13 13:21     ` Mirza Krak
  2015-03-13 14:12       ` Yegor Yefremov
@ 2015-03-13 14:19       ` Fabio Baltieri
  1 sibling, 0 replies; 9+ messages in thread
From: Fabio Baltieri @ 2015-03-13 14:19 UTC (permalink / raw)
  To: Mirza Krak; +Cc: Yegor Yefremov, linux-can

On Fri, Mar 13, 2015 at 1:21 PM, Mirza Krak <mirza.krak@hostmobility.com> wrote:
> Realized now that the ledtrig-netdev driver is not mainline :).
>
> Found it here https://lkml.org/lkml/2010/11/14/116.
>
> Tested it with a CAN device now, and it works great.

I think that that trigger has been developed for dd-wrt or some other
router distro, and it's not going be mainlined since it does not
comply with the sysfs guidelines and no one ever fixed it -- that
would also break compatibility with the existing users so it's not a
trivial issue.

>>> So I got "can0-tx" running. But I have only one LED, that is called
>>> "Data" and it just shows activity. It seems like one cannot combine
>>> two triggers for one LED. Do I see it right? If yes, what about
>>> creating another event called iface-rxtx or iface-activity like LEDs
>>> in network interfaces?

That's correct, the LED subsystem does not have any facility to
combine triggers, and the existing ones are separated and for tx-rx.
If you need a combined version you would either have to hack the
current code to trigger one for both events (which is trivial) or
maybe write some generic combining extension at LED subsystem level...
send patches! :-)

>>> What about errors? We have also "Error" LED. The main purpose is to
>>> indicate "bus off" state.

That would be also easy to implement but since the errors are
propagated through the can netdev and should not be too much traffic
you could probably handle that in userspace (that's what I would do
anyway).

Cheers,
Fabio

-- 
Fabio Baltieri

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

end of thread, other threads:[~2015-03-13 14:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-12  9:21 LEDs: documentation Yegor Yefremov
2015-03-12 14:00 ` Yegor Yefremov
2015-03-13 13:01   ` Mirza Krak
2015-03-13 13:19     ` Yegor Yefremov
2015-03-13 13:21     ` Mirza Krak
2015-03-13 14:12       ` Yegor Yefremov
2015-03-13 14:19       ` Fabio Baltieri
     [not found] ` <CAJ=nTssN6M13-aiAHA=jY7EhGsRbYqrFDoTb-o43YFYtndgb1A@mail.gmail.com>
2015-03-13 10:46   ` Mirza Krak
2015-03-13 10:55     ` Yegor Yefremov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.