Re: [patch] leds: add driver for Mellanox systems leds

2016-09-15 Thread Jacek Anaszewski

Hi Pavel,

On 09/15/2016 02:52 PM, Pavel Machek wrote:

Hi!


+++ b/MAINTAINERS
@@ -7655,6 +7655,14 @@ W:   http://www.mellanox.com
 Q: http://patchwork.ozlabs.org/project/netdev/list/
 F: drivers/net/ethernet/mellanox/mlxsw/

+MELLANOX MLXCPLD LED DRIVER
+M: Vadim Pasternak 
+L: linux-l...@vger.kernel.org
+S: Supported
+W: http://www.mellanox.com


Unless you have web page specificly about the LED hardware, I don't
think W: tag is useful here.



I raised also similar objections during review. Eventually I left
the entry after skimming through the MAINTAINERS and noticing few
other similar examples.

In fact, the link to the main page doesn't convey any better information
than can be obtained after searching google. I'm dropping the entry
then.

--
Best regards,
Jacek Anaszewski


Re: [patch] leds: add driver for Mellanox systems leds

2016-09-15 Thread Jacek Anaszewski

Hi Pavel,

On 09/15/2016 02:52 PM, Pavel Machek wrote:

Hi!


+++ b/MAINTAINERS
@@ -7655,6 +7655,14 @@ W:   http://www.mellanox.com
 Q: http://patchwork.ozlabs.org/project/netdev/list/
 F: drivers/net/ethernet/mellanox/mlxsw/

+MELLANOX MLXCPLD LED DRIVER
+M: Vadim Pasternak 
+L: linux-l...@vger.kernel.org
+S: Supported
+W: http://www.mellanox.com


Unless you have web page specificly about the LED hardware, I don't
think W: tag is useful here.



I raised also similar objections during review. Eventually I left
the entry after skimming through the MAINTAINERS and noticing few
other similar examples.

In fact, the link to the main page doesn't convey any better information
than can be obtained after searching google. I'm dropping the entry
then.

--
Best regards,
Jacek Anaszewski


Re: [patch] leds: add driver for Mellanox systems leds

2016-09-15 Thread Pavel Machek
Hi!

> +++ b/MAINTAINERS
> @@ -7655,6 +7655,14 @@ W: http://www.mellanox.com
>  Q:   http://patchwork.ozlabs.org/project/netdev/list/
>  F:   drivers/net/ethernet/mellanox/mlxsw/
>  
> +MELLANOX MLXCPLD LED DRIVER
> +M:   Vadim Pasternak 
> +L:   linux-l...@vger.kernel.org
> +S:   Supported
> +W:   http://www.mellanox.com

Unless you have web page specificly about the LED hardware, I don't
think W: tag is useful here.

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


Re: [patch] leds: add driver for Mellanox systems leds

2016-09-15 Thread Pavel Machek
Hi!

> +++ b/MAINTAINERS
> @@ -7655,6 +7655,14 @@ W: http://www.mellanox.com
>  Q:   http://patchwork.ozlabs.org/project/netdev/list/
>  F:   drivers/net/ethernet/mellanox/mlxsw/
>  
> +MELLANOX MLXCPLD LED DRIVER
> +M:   Vadim Pasternak 
> +L:   linux-l...@vger.kernel.org
> +S:   Supported
> +W:   http://www.mellanox.com

Unless you have web page specificly about the LED hardware, I don't
think W: tag is useful here.

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


RE: [patch] leds: add driver for Mellanox systems leds

2016-09-07 Thread Vadim Pasternak
Hi Jacek,

Thank you for your comments.

> -Original Message-
> From: Jacek Anaszewski [mailto:j.anaszew...@samsung.com]
> Sent: Wednesday, September 07, 2016 3:49 PM
> To: Vadim Pasternak <vad...@mellanox.com>; rpur...@rpsys.net
> Cc: linux-l...@vger.kernel.org; linux-kernel@vger.kernel.org; 
> j...@resnulli.us;
> Michael Shych <michae...@mellanox.com>
> Subject: Re: [patch] leds: add driver for Mellanox systems leds
> 
> Hi Vadim,
> 
> On 09/07/2016 03:35 PM, vad...@mellanox.com wrote:
> > From: Vadim Pasternak <vad...@mellanox.com>
> >
> > This makes it possible to create a set of LEDs for Mellanox systems:
> > "msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
> > "msb7800", "msn2740", "msn2100".
> >
> > Driver obtains led devices according to system configuration, provided
> > through system DMI data, like fan1:green, fan1:red and creates devices
> > in
> > form: "devicename:colour:function".
> >
> > led setting is controlled through on board CPLD Lattice device.
> > For setting particular led off, solid, blink (blink requires
> > ledtrig-timer module):
> > echo 0 > /sys/class/leds/status\:green/brightness
> > echo 1 > /sys/class/leds/status\:green/brightness
> > echo timer > /sys/class/leds/status\:green/trigger
> >
> 
> Thanks for the update, will review it soon.
> 
> One important detail - please update patch version each time you're sending a
> new one, like [PATCH v2].
> 
Will do it in this format next time.
Thanks for this input.
Best regards,
Vadim.

> --
> Best regards,
> Jacek Anaszewski


RE: [patch] leds: add driver for Mellanox systems leds

2016-09-07 Thread Vadim Pasternak
Hi Jacek,

Thank you for your comments.

> -Original Message-
> From: Jacek Anaszewski [mailto:j.anaszew...@samsung.com]
> Sent: Wednesday, September 07, 2016 3:49 PM
> To: Vadim Pasternak ; rpur...@rpsys.net
> Cc: linux-l...@vger.kernel.org; linux-kernel@vger.kernel.org; 
> j...@resnulli.us;
> Michael Shych 
> Subject: Re: [patch] leds: add driver for Mellanox systems leds
> 
> Hi Vadim,
> 
> On 09/07/2016 03:35 PM, vad...@mellanox.com wrote:
> > From: Vadim Pasternak 
> >
> > This makes it possible to create a set of LEDs for Mellanox systems:
> > "msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
> > "msb7800", "msn2740", "msn2100".
> >
> > Driver obtains led devices according to system configuration, provided
> > through system DMI data, like fan1:green, fan1:red and creates devices
> > in
> > form: "devicename:colour:function".
> >
> > led setting is controlled through on board CPLD Lattice device.
> > For setting particular led off, solid, blink (blink requires
> > ledtrig-timer module):
> > echo 0 > /sys/class/leds/status\:green/brightness
> > echo 1 > /sys/class/leds/status\:green/brightness
> > echo timer > /sys/class/leds/status\:green/trigger
> >
> 
> Thanks for the update, will review it soon.
> 
> One important detail - please update patch version each time you're sending a
> new one, like [PATCH v2].
> 
Will do it in this format next time.
Thanks for this input.
Best regards,
Vadim.

> --
> Best regards,
> Jacek Anaszewski


Re: [patch] leds: add driver for Mellanox systems leds

2016-09-07 Thread Jiri Pirko
Wed, Sep 07, 2016 at 02:49:00PM CEST, j.anaszew...@samsung.com wrote:
>Hi Vadim,
>
>On 09/07/2016 03:35 PM, vad...@mellanox.com wrote:
>> From: Vadim Pasternak 
>> 
>> This makes it possible to create a set of LEDs for Mellanox systems:
>> "msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
>> "msb7800", "msn2740", "msn2100".
>> 
>> Driver obtains led devices according to system configuration, provided
>> through system DMI data, like fan1:green, fan1:red and creates devices in
>> form: "devicename:colour:function".
>> 
>> led setting is controlled through on board CPLD Lattice device.
>> For setting particular led off, solid,
>> blink (blink requires ledtrig-timer module):
>> echo 0 > /sys/class/leds/status\:green/brightness
>> echo 1 > /sys/class/leds/status\:green/brightness
>> echo timer > /sys/class/leds/status\:green/trigger
>> 
>
>Thanks for the update, will review it soon.
>
>One important detail - please update patch version each time
>you're sending a new one, like [PATCH v2].

Also a brief history of changes made would help.


>
>-- 
>Best regards,
>Jacek Anaszewski


Re: [patch] leds: add driver for Mellanox systems leds

2016-09-07 Thread Jiri Pirko
Wed, Sep 07, 2016 at 02:49:00PM CEST, j.anaszew...@samsung.com wrote:
>Hi Vadim,
>
>On 09/07/2016 03:35 PM, vad...@mellanox.com wrote:
>> From: Vadim Pasternak 
>> 
>> This makes it possible to create a set of LEDs for Mellanox systems:
>> "msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
>> "msb7800", "msn2740", "msn2100".
>> 
>> Driver obtains led devices according to system configuration, provided
>> through system DMI data, like fan1:green, fan1:red and creates devices in
>> form: "devicename:colour:function".
>> 
>> led setting is controlled through on board CPLD Lattice device.
>> For setting particular led off, solid,
>> blink (blink requires ledtrig-timer module):
>> echo 0 > /sys/class/leds/status\:green/brightness
>> echo 1 > /sys/class/leds/status\:green/brightness
>> echo timer > /sys/class/leds/status\:green/trigger
>> 
>
>Thanks for the update, will review it soon.
>
>One important detail - please update patch version each time
>you're sending a new one, like [PATCH v2].

Also a brief history of changes made would help.


>
>-- 
>Best regards,
>Jacek Anaszewski


Re: [patch] leds: add driver for Mellanox systems leds

2016-09-07 Thread Jacek Anaszewski

Hi Vadim,

On 09/07/2016 03:35 PM, vad...@mellanox.com wrote:

From: Vadim Pasternak 

This makes it possible to create a set of LEDs for Mellanox systems:
"msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
"msb7800", "msn2740", "msn2100".

Driver obtains led devices according to system configuration, provided
through system DMI data, like fan1:green, fan1:red and creates devices in
form: "devicename:colour:function".

led setting is controlled through on board CPLD Lattice device.
For setting particular led off, solid,
blink (blink requires ledtrig-timer module):
echo 0 > /sys/class/leds/status\:green/brightness
echo 1 > /sys/class/leds/status\:green/brightness
echo timer > /sys/class/leds/status\:green/trigger



Thanks for the update, will review it soon.

One important detail - please update patch version each time
you're sending a new one, like [PATCH v2].

--
Best regards,
Jacek Anaszewski


Re: [patch] leds: add driver for Mellanox systems leds

2016-09-07 Thread Jacek Anaszewski

Hi Vadim,

On 09/07/2016 03:35 PM, vad...@mellanox.com wrote:

From: Vadim Pasternak 

This makes it possible to create a set of LEDs for Mellanox systems:
"msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
"msb7800", "msn2740", "msn2100".

Driver obtains led devices according to system configuration, provided
through system DMI data, like fan1:green, fan1:red and creates devices in
form: "devicename:colour:function".

led setting is controlled through on board CPLD Lattice device.
For setting particular led off, solid,
blink (blink requires ledtrig-timer module):
echo 0 > /sys/class/leds/status\:green/brightness
echo 1 > /sys/class/leds/status\:green/brightness
echo timer > /sys/class/leds/status\:green/trigger



Thanks for the update, will review it soon.

One important detail - please update patch version each time
you're sending a new one, like [PATCH v2].

--
Best regards,
Jacek Anaszewski


Re: [patch] leds: add driver for Mellanox systems leds

2016-09-07 Thread Dr. David Alan Gilbert
* vad...@mellanox.com (vad...@mellanox.com) wrote:
> From: Vadim Pasternak 
> 
> This makes it possible to create a set of LEDs for Mellanox systems:
> "msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
> "msb7800", "msn2740", "msn2100".
> 
> Driver obtains led devices according to system configuration, provided
> through system DMI data, like fan1:green, fan1:red and creates devices in
> form: "devicename:colour:function".
> 
> led setting is controlled through on board CPLD Lattice device.
> For setting particular led off, solid,
> blink (blink requires ledtrig-timer module):
> echo 0 > /sys/class/leds/status\:green/brightness
> echo 1 > /sys/class/leds/status\:green/brightness
> echo timer > /sys/class/leds/status\:green/trigger
> 
> On module probing all leds are set green, on removing - off.
> 
> Last setting overwrites previous, f.e. sequence for
> changing led from green - red - green:
> echo 1 > /sys/class/leds/psu\:green/brightness
> echo 1 > /sys/class/leds/psu\:red/brightness
> echo 1 > /sys/class/leds/psu\:green/brightness
> Note: leds cannot be turned on/off simultaneously.
> 
> The Kconfig currently controlling compilation of this code is:
> drivers/leds/Kconfig:config LEDS_MLXCPLD
> 
> Signed-off-by: Vadim Pasternak 
> Reviewed-by: Jiri Pirko 
> ---
>  Documentation/leds/leds-mlxcpld.txt |  88 
>  MAINTAINERS |   8 +
>  drivers/leds/Kconfig|   8 +
>  drivers/leds/Makefile   |   1 +
>  drivers/leds/leds-mlxcpld.c | 399 
> 
>  5 files changed, 504 insertions(+)
>  create mode 100644 Documentation/leds/leds-mlxcpld.txt
>  create mode 100644 drivers/leds/leds-mlxcpld.c
> 
> diff --git a/Documentation/leds/leds-mlxcpld.txt 
> b/Documentation/leds/leds-mlxcpld.txt
> new file mode 100644
> index 000..575d765
> --- /dev/null
> +++ b/Documentation/leds/leds-mlxcpld.txt
> @@ -0,0 +1,88 @@
> +ver leds-mlxcpld
> +==
> +Driver for Mellanox systems leds.
> +Provide system led support for the nex Mellanox systems:
> +"msx6710", "msx6720", "msb7700", "msn2700", "msx1410",
> +"msn2410", "msb7800", "msn2740", "msn2100".
> +
> +Description
> +---
> +Driver provides the following leds for the systems "msx6710", "msx6720",
> +"msb7700", "msn2700", "msx1410", "msn2410", "msb7800", "msn2740":
> +
> + "status"
> +  CPLD reg offset: 0x20
> +  Bits [3:0]
> +
> + "psu"
> +  CPLD reg offset: 0x20
> +  Bits [7:4]
> +
> + "fan1"
> +  CPLD reg offset: 0x21
> +  Bits [3:0]
> +
> + "fan2"
> +  CPLD reg offset: 0x21
> +  Bits [7:4]
> +
> + "fan3"
> +  CPLD reg offset: 0x22
> +  Bits [3:0]
> +
> + "fan4"
> +  CPLD reg offset: 0x22
> +  Bits [7:4]
> +
> + Color mask for all the above leds:
> +  [bit3,bit2,bit1,bit0] or
> +  [bit7,bit6,bit5,bit4]:
> + [0,0,0,0] = LED OFF
> + [0,1,0,1] = Red static ON
> + [1,1,0,1] = Green static ON
> + [0,1,1,0] = Red blink 3Hz
> + [1,1,1,0] = Green blink 3Hz
> + [0,1,1,1] = Red blink 6Hz
> + [1,1,1,1] = Green blink 6Hz
> +
> +Driver provides the following leds for the system "msn2100":
> + "status"
> +  CPLD reg offset: 0x20
> +  Bits [3:0]
> +
> + "fan"
> +  CPLD reg offset: 0x21
> +  Bits [3:0]
> +
> + "psu1"
> +  CPLD reg offset: 0x23
> +  Bits [3:0]
> +
> + "psu2"
> +  CPLD reg offset: 0x23
> +  Bits [7:4]
> +
> + "uid"
> +  CPLD reg offset: 0x24
> +  Bits [3:0]
> +
> + Color mask for all the above leds, excepted uid:
> +  [bit3,bit2,bit1,bit0] or
> +  [bit7,bit6,bit5,bit4]:
> + [0,0,0,0] = LED OFF
> + [0,1,0,1] = Red static ON
> + [1,1,0,1] = Green static ON
> + [0,1,1,0] = Red blink 3Hz
> + [1,1,1,0] = Green blink 3Hz
> + [0,1,1,1] = Red blink 6Hz
> + [1,1,1,1] = Green blink 6Hz
> +
> + Color mask for uid led:
> +  [bit3,bit2,bit1,bit0]:
> + [0,0,0,0] = LED OFF
> + [1,1,0,1] = Blue static ON
> + [1,1,1,0] = Blue blink 3Hz
> + [1,1,1,1] = Blue blink 6Hz
> +
> +Driver supports HW blinking at 3Hz and 6Hz frequency (50% duty cycle).
> +For 3Hz it is about 40 msec off and 40 msec on, for 6Hz - 80 msec off and on.
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 0bbe4b1..adb9e9b 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -7655,6 +7655,14 @@ W: http://www.mellanox.com
>  Q:   http://patchwork.ozlabs.org/project/netdev/list/
>  F:   drivers/net/ethernet/mellanox/mlxsw/
>  
> +MELLANOX MLXCPLD LED DRIVER
> +M:   Vadim Pasternak 
> +L:   linux-l...@vger.kernel.org
> +S:   Supported
> +W:   http://www.mellanox.com
> +F:   drivers/leds/leds-mlxcpld.c
> +F:   Documentation/leds/leds-mlxcpld.txt
> +
>  SOFT-ROCE DRIVER (rxe)
>  M:   Moni Shoua 
>  L:   linux-r...@vger.kernel.org
> diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> index 9dcc9b1..4cd85be 100644
> --- a/drivers/leds/Kconfig
> +++ b/drivers/leds/Kconfig
> @@ -631,6 +631,14 @@ config 

Re: [patch] leds: add driver for Mellanox systems leds

2016-09-07 Thread Dr. David Alan Gilbert
* vad...@mellanox.com (vad...@mellanox.com) wrote:
> From: Vadim Pasternak 
> 
> This makes it possible to create a set of LEDs for Mellanox systems:
> "msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
> "msb7800", "msn2740", "msn2100".
> 
> Driver obtains led devices according to system configuration, provided
> through system DMI data, like fan1:green, fan1:red and creates devices in
> form: "devicename:colour:function".
> 
> led setting is controlled through on board CPLD Lattice device.
> For setting particular led off, solid,
> blink (blink requires ledtrig-timer module):
> echo 0 > /sys/class/leds/status\:green/brightness
> echo 1 > /sys/class/leds/status\:green/brightness
> echo timer > /sys/class/leds/status\:green/trigger
> 
> On module probing all leds are set green, on removing - off.
> 
> Last setting overwrites previous, f.e. sequence for
> changing led from green - red - green:
> echo 1 > /sys/class/leds/psu\:green/brightness
> echo 1 > /sys/class/leds/psu\:red/brightness
> echo 1 > /sys/class/leds/psu\:green/brightness
> Note: leds cannot be turned on/off simultaneously.
> 
> The Kconfig currently controlling compilation of this code is:
> drivers/leds/Kconfig:config LEDS_MLXCPLD
> 
> Signed-off-by: Vadim Pasternak 
> Reviewed-by: Jiri Pirko 
> ---
>  Documentation/leds/leds-mlxcpld.txt |  88 
>  MAINTAINERS |   8 +
>  drivers/leds/Kconfig|   8 +
>  drivers/leds/Makefile   |   1 +
>  drivers/leds/leds-mlxcpld.c | 399 
> 
>  5 files changed, 504 insertions(+)
>  create mode 100644 Documentation/leds/leds-mlxcpld.txt
>  create mode 100644 drivers/leds/leds-mlxcpld.c
> 
> diff --git a/Documentation/leds/leds-mlxcpld.txt 
> b/Documentation/leds/leds-mlxcpld.txt
> new file mode 100644
> index 000..575d765
> --- /dev/null
> +++ b/Documentation/leds/leds-mlxcpld.txt
> @@ -0,0 +1,88 @@
> +ver leds-mlxcpld
> +==
> +Driver for Mellanox systems leds.
> +Provide system led support for the nex Mellanox systems:
> +"msx6710", "msx6720", "msb7700", "msn2700", "msx1410",
> +"msn2410", "msb7800", "msn2740", "msn2100".
> +
> +Description
> +---
> +Driver provides the following leds for the systems "msx6710", "msx6720",
> +"msb7700", "msn2700", "msx1410", "msn2410", "msb7800", "msn2740":
> +
> + "status"
> +  CPLD reg offset: 0x20
> +  Bits [3:0]
> +
> + "psu"
> +  CPLD reg offset: 0x20
> +  Bits [7:4]
> +
> + "fan1"
> +  CPLD reg offset: 0x21
> +  Bits [3:0]
> +
> + "fan2"
> +  CPLD reg offset: 0x21
> +  Bits [7:4]
> +
> + "fan3"
> +  CPLD reg offset: 0x22
> +  Bits [3:0]
> +
> + "fan4"
> +  CPLD reg offset: 0x22
> +  Bits [7:4]
> +
> + Color mask for all the above leds:
> +  [bit3,bit2,bit1,bit0] or
> +  [bit7,bit6,bit5,bit4]:
> + [0,0,0,0] = LED OFF
> + [0,1,0,1] = Red static ON
> + [1,1,0,1] = Green static ON
> + [0,1,1,0] = Red blink 3Hz
> + [1,1,1,0] = Green blink 3Hz
> + [0,1,1,1] = Red blink 6Hz
> + [1,1,1,1] = Green blink 6Hz
> +
> +Driver provides the following leds for the system "msn2100":
> + "status"
> +  CPLD reg offset: 0x20
> +  Bits [3:0]
> +
> + "fan"
> +  CPLD reg offset: 0x21
> +  Bits [3:0]
> +
> + "psu1"
> +  CPLD reg offset: 0x23
> +  Bits [3:0]
> +
> + "psu2"
> +  CPLD reg offset: 0x23
> +  Bits [7:4]
> +
> + "uid"
> +  CPLD reg offset: 0x24
> +  Bits [3:0]
> +
> + Color mask for all the above leds, excepted uid:
> +  [bit3,bit2,bit1,bit0] or
> +  [bit7,bit6,bit5,bit4]:
> + [0,0,0,0] = LED OFF
> + [0,1,0,1] = Red static ON
> + [1,1,0,1] = Green static ON
> + [0,1,1,0] = Red blink 3Hz
> + [1,1,1,0] = Green blink 3Hz
> + [0,1,1,1] = Red blink 6Hz
> + [1,1,1,1] = Green blink 6Hz
> +
> + Color mask for uid led:
> +  [bit3,bit2,bit1,bit0]:
> + [0,0,0,0] = LED OFF
> + [1,1,0,1] = Blue static ON
> + [1,1,1,0] = Blue blink 3Hz
> + [1,1,1,1] = Blue blink 6Hz
> +
> +Driver supports HW blinking at 3Hz and 6Hz frequency (50% duty cycle).
> +For 3Hz it is about 40 msec off and 40 msec on, for 6Hz - 80 msec off and on.
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 0bbe4b1..adb9e9b 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -7655,6 +7655,14 @@ W: http://www.mellanox.com
>  Q:   http://patchwork.ozlabs.org/project/netdev/list/
>  F:   drivers/net/ethernet/mellanox/mlxsw/
>  
> +MELLANOX MLXCPLD LED DRIVER
> +M:   Vadim Pasternak 
> +L:   linux-l...@vger.kernel.org
> +S:   Supported
> +W:   http://www.mellanox.com
> +F:   drivers/leds/leds-mlxcpld.c
> +F:   Documentation/leds/leds-mlxcpld.txt
> +
>  SOFT-ROCE DRIVER (rxe)
>  M:   Moni Shoua 
>  L:   linux-r...@vger.kernel.org
> diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> index 9dcc9b1..4cd85be 100644
> --- a/drivers/leds/Kconfig
> +++ b/drivers/leds/Kconfig
> @@ -631,6 +631,14 @@ config LEDS_VERSATILE
> This option enabled support for the LEDs on the ARM Versatile
> and RealView 

RE: [patch] leds: add driver for Mellanox systems leds

2016-09-07 Thread Vadim Pasternak


> -Original Message-
> From: Dr. David Alan Gilbert [mailto:d...@treblig.org]
> Sent: Wednesday, September 07, 2016 3:11 PM
> To: Vadim Pasternak <vad...@mellanox.com>
> Cc: rpur...@rpsys.net; j.anaszew...@samsung.com; linux-
> l...@vger.kernel.org; linux-kernel@vger.kernel.org; j...@resnulli.us; Michael
> Shych <michae...@mellanox.com>
> Subject: Re: [patch] leds: add driver for Mellanox systems leds
> 
> * vad...@mellanox.com (vad...@mellanox.com) wrote:
> > From: Vadim Pasternak <vad...@mellanox.com>
> >
> > This makes it possible to create a set of LEDs for Mellanox systems:
> > "msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
> > "msb7800", "msn2740", "msn2100".
> >
> > Driver obtains led devices according to system configuration, provided
> > through system DMI data, like fan1:green, fan1:red and creates devices
> > in
> > form: "devicename:colour:function".
> >
> > led setting is controlled through on board CPLD Lattice device.
> > For setting particular led off, solid, blink (blink requires
> > ledtrig-timer module):
> > echo 0 > /sys/class/leds/status\:green/brightness
> > echo 1 > /sys/class/leds/status\:green/brightness
> > echo timer > /sys/class/leds/status\:green/trigger
> >
> > On module probing all leds are set green, on removing - off.
> >
> > Last setting overwrites previous, f.e. sequence for changing led from
> > green - red - green:
> > echo 1 > /sys/class/leds/psu\:green/brightness
> > echo 1 > /sys/class/leds/psu\:red/brightness
> > echo 1 > /sys/class/leds/psu\:green/brightness
> > Note: leds cannot be turned on/off simultaneously.
> >
> > The Kconfig currently controlling compilation of this code is:
> > drivers/leds/Kconfig:config LEDS_MLXCPLD
> >
> > Signed-off-by: Vadim Pasternak <vad...@mellanox.com>
> > Reviewed-by: Jiri Pirko <j...@mellanox.com>
> > ---
> >  Documentation/leds/leds-mlxcpld.txt |  88 
> >  MAINTAINERS |   8 +
> >  drivers/leds/Kconfig|   8 +
> >  drivers/leds/Makefile   |   1 +
> >  drivers/leds/leds-mlxcpld.c | 399
> 
> >  5 files changed, 504 insertions(+)
> >  create mode 100644 Documentation/leds/leds-mlxcpld.txt
> >  create mode 100644 drivers/leds/leds-mlxcpld.c
> >
> > diff --git a/Documentation/leds/leds-mlxcpld.txt
> > b/Documentation/leds/leds-mlxcpld.txt
> > new file mode 100644
> > index 000..575d765
> > --- /dev/null
> > +++ b/Documentation/leds/leds-mlxcpld.txt
> > @@ -0,0 +1,88 @@
> > +ver leds-mlxcpld
> > +==
> > +Driver for Mellanox systems leds.
> > +Provide system led support for the nex Mellanox systems:
> > +"msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
> > +"msb7800", "msn2740", "msn2100".
> > +
> > +Description
> > +---
> > +Driver provides the following leds for the systems "msx6710",
> > +"msx6720", "msb7700", "msn2700", "msx1410", "msn2410", "msb7800",
> "msn2740":
> > +
> > + "status"
> > +  CPLD reg offset: 0x20
> > +  Bits [3:0]
> > +
> > + "psu"
> > +  CPLD reg offset: 0x20
> > +  Bits [7:4]
> > +
> > + "fan1"
> > +  CPLD reg offset: 0x21
> > +  Bits [3:0]
> > +
> > + "fan2"
> > +  CPLD reg offset: 0x21
> > +  Bits [7:4]
> > +
> > + "fan3"
> > +  CPLD reg offset: 0x22
> > +  Bits [3:0]
> > +
> > + "fan4"
> > +  CPLD reg offset: 0x22
> > +  Bits [7:4]
> > +
> > + Color mask for all the above leds:
> > +  [bit3,bit2,bit1,bit0] or
> > +  [bit7,bit6,bit5,bit4]:
> > +   [0,0,0,0] = LED OFF
> > +   [0,1,0,1] = Red static ON
> > +   [1,1,0,1] = Green static ON
> > +   [0,1,1,0] = Red blink 3Hz
> > +   [1,1,1,0] = Green blink 3Hz
> > +   [0,1,1,1] = Red blink 6Hz
> > +   [1,1,1,1] = Green blink 6Hz
> > +
> > +Driver provides the following leds for the system "msn2100":
> > + "status"
> > +  CPLD reg offset: 0x20
> > +  Bits [3:0]
> > +
> > + "fan"
> > +  CPLD reg offset: 0x21
> > +  Bits [3:0]
> > +

RE: [patch] leds: add driver for Mellanox systems leds

2016-09-07 Thread Vadim Pasternak


> -Original Message-
> From: Dr. David Alan Gilbert [mailto:d...@treblig.org]
> Sent: Wednesday, September 07, 2016 3:11 PM
> To: Vadim Pasternak 
> Cc: rpur...@rpsys.net; j.anaszew...@samsung.com; linux-
> l...@vger.kernel.org; linux-kernel@vger.kernel.org; j...@resnulli.us; Michael
> Shych 
> Subject: Re: [patch] leds: add driver for Mellanox systems leds
> 
> * vad...@mellanox.com (vad...@mellanox.com) wrote:
> > From: Vadim Pasternak 
> >
> > This makes it possible to create a set of LEDs for Mellanox systems:
> > "msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
> > "msb7800", "msn2740", "msn2100".
> >
> > Driver obtains led devices according to system configuration, provided
> > through system DMI data, like fan1:green, fan1:red and creates devices
> > in
> > form: "devicename:colour:function".
> >
> > led setting is controlled through on board CPLD Lattice device.
> > For setting particular led off, solid, blink (blink requires
> > ledtrig-timer module):
> > echo 0 > /sys/class/leds/status\:green/brightness
> > echo 1 > /sys/class/leds/status\:green/brightness
> > echo timer > /sys/class/leds/status\:green/trigger
> >
> > On module probing all leds are set green, on removing - off.
> >
> > Last setting overwrites previous, f.e. sequence for changing led from
> > green - red - green:
> > echo 1 > /sys/class/leds/psu\:green/brightness
> > echo 1 > /sys/class/leds/psu\:red/brightness
> > echo 1 > /sys/class/leds/psu\:green/brightness
> > Note: leds cannot be turned on/off simultaneously.
> >
> > The Kconfig currently controlling compilation of this code is:
> > drivers/leds/Kconfig:config LEDS_MLXCPLD
> >
> > Signed-off-by: Vadim Pasternak 
> > Reviewed-by: Jiri Pirko 
> > ---
> >  Documentation/leds/leds-mlxcpld.txt |  88 
> >  MAINTAINERS |   8 +
> >  drivers/leds/Kconfig|   8 +
> >  drivers/leds/Makefile   |   1 +
> >  drivers/leds/leds-mlxcpld.c | 399
> 
> >  5 files changed, 504 insertions(+)
> >  create mode 100644 Documentation/leds/leds-mlxcpld.txt
> >  create mode 100644 drivers/leds/leds-mlxcpld.c
> >
> > diff --git a/Documentation/leds/leds-mlxcpld.txt
> > b/Documentation/leds/leds-mlxcpld.txt
> > new file mode 100644
> > index 000..575d765
> > --- /dev/null
> > +++ b/Documentation/leds/leds-mlxcpld.txt
> > @@ -0,0 +1,88 @@
> > +ver leds-mlxcpld
> > +==
> > +Driver for Mellanox systems leds.
> > +Provide system led support for the nex Mellanox systems:
> > +"msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
> > +"msb7800", "msn2740", "msn2100".
> > +
> > +Description
> > +---
> > +Driver provides the following leds for the systems "msx6710",
> > +"msx6720", "msb7700", "msn2700", "msx1410", "msn2410", "msb7800",
> "msn2740":
> > +
> > + "status"
> > +  CPLD reg offset: 0x20
> > +  Bits [3:0]
> > +
> > + "psu"
> > +  CPLD reg offset: 0x20
> > +  Bits [7:4]
> > +
> > + "fan1"
> > +  CPLD reg offset: 0x21
> > +  Bits [3:0]
> > +
> > + "fan2"
> > +  CPLD reg offset: 0x21
> > +  Bits [7:4]
> > +
> > + "fan3"
> > +  CPLD reg offset: 0x22
> > +  Bits [3:0]
> > +
> > + "fan4"
> > +  CPLD reg offset: 0x22
> > +  Bits [7:4]
> > +
> > + Color mask for all the above leds:
> > +  [bit3,bit2,bit1,bit0] or
> > +  [bit7,bit6,bit5,bit4]:
> > +   [0,0,0,0] = LED OFF
> > +   [0,1,0,1] = Red static ON
> > +   [1,1,0,1] = Green static ON
> > +   [0,1,1,0] = Red blink 3Hz
> > +   [1,1,1,0] = Green blink 3Hz
> > +   [0,1,1,1] = Red blink 6Hz
> > +   [1,1,1,1] = Green blink 6Hz
> > +
> > +Driver provides the following leds for the system "msn2100":
> > + "status"
> > +  CPLD reg offset: 0x20
> > +  Bits [3:0]
> > +
> > + "fan"
> > +  CPLD reg offset: 0x21
> > +  Bits [3:0]
> > +
> > + "psu1"
> > +  CPLD reg offset: 0x23
> > +  Bits [3:0]
> > +
> > + "psu2"
> &

Re: [patch] leds: add driver for Mellanox systems LEDs

2016-08-31 Thread Jacek Anaszewski

Hi Vadim,

Thanks for the patch. See my comments below.

On 08/29/2016 08:07 PM, vad...@mellanox.com wrote:

From: Vadim Pasternak 

This makes it possible to create a set of LEDs for Mellanox systems:
"msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
"msb7800", "msn2740", "msn2100".

Drivers creates led devices according to  system configuration, provided


s/Drivers/Driver/

and s/led/LED/ here and in case of all other occurrences in the
in-driver comments.


through system DMA data, like
fan1:green fan1:red status:green status:red


Documentation/leds/leds-class.txt states the LED class device
name should match the following pattern:

devicename:colour:function



LED setting is controlled through on board CPLD Lattice device.
For setting particular led off, solid,
blink (blink required ledtrig-timer module):


s/required/requires/


echo 0 > /sys/class/leds/status\:green/brightness
echo 1 > /sys/class/leds/status\:green/brightness
echo timer > /sys/class/leds/status\:green/trigger

On module probing all leds are set green, on removing - off.

Last setting overwrites previous, f.e. sequence for
changing led from green - red - green:
echo 1 > /sys/class/leds/psu\:green/brightness
echo 1 > /sys/class/leds/psu\:red/brightness
echo 1 > /sys/class/leds/psu\:green/brightness


It seems that there are many LEDs connected to the
same iout and they cannot be turned on simultaneously.
Am I right?


The Kconfig currently controlling compilation of this code is:
drivers/leds/Kconfig:config LEDS_MLXCPLD

Signed-off-by: Vadim Pasternak 
Reviewed-by: Jiri Pirko 
---
 MAINTAINERS |   7 +
 drivers/leds/Kconfig|   8 +
 drivers/leds/Makefile   |   1 +
 drivers/leds/leds-mlxcpld.c | 385 
 4 files changed, 401 insertions(+)
 create mode 100644 drivers/leds/leds-mlxcpld.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 0bbe4b1..31cffdd 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7655,6 +7655,13 @@ W:   http://www.mellanox.com
 Q: http://patchwork.ozlabs.org/project/netdev/list/
 F: drivers/net/ethernet/mellanox/mlxsw/

+MELLANOX MLXCPLD LED DRIVER
+M: Vadim Pasternak 
+L: linux-kernel@vger.kernel.org


s/linux-kernel/linux-leds/


+S: Supported
+W: http://www.mellanox.com


Could you please provide a direct link to the datasheet?


+F: drivers/leds/leds-mlxcpld.c
+
 SOFT-ROCE DRIVER (rxe)
 M: Moni Shoua 
 L: linux-r...@vger.kernel.org
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 9dcc9b1..4cd85be 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -631,6 +631,14 @@ config LEDS_VERSATILE
  This option enabled support for the LEDs on the ARM Versatile
  and RealView boards. Say Y to enabled these.

+config LEDS_MLXCPLD
+   tristate "LED support for the Mellanox boards"
+   depends on X86_64 && DMI
+   depends on LEDS_CLASS
+   help
+ This option enabled support for the LEDs on the Mellanox
+ boards. Say Y to enabled these.
+
 comment "LED Triggers"
 source "drivers/leds/trigger/Kconfig"

diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index 0684c86..9a2494b 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -68,6 +68,7 @@ obj-$(CONFIG_LEDS_KTD2692)+= leds-ktd2692.o
 obj-$(CONFIG_LEDS_POWERNV) += leds-powernv.o
 obj-$(CONFIG_LEDS_SEAD3)   += leds-sead3.o
 obj-$(CONFIG_LEDS_IS31FL32XX)  += leds-is31fl32xx.o
+obj-$(CONFIG_LEDS_MLXCPLD) += leds-mlxcpld.o

 # LED SPI Drivers
 obj-$(CONFIG_LEDS_DAC124S085)  += leds-dac124s085.o
diff --git a/drivers/leds/leds-mlxcpld.c b/drivers/leds/leds-mlxcpld.c
new file mode 100644
index 000..b79342c
--- /dev/null
+++ b/drivers/leds/leds-mlxcpld.c
@@ -0,0 +1,385 @@
+/*
+ * drivers/leds/leds-mlxcpld.c
+ * Copyright (c) 2016 Mellanox Technologies. All rights reserved.
+ * Copyright (c) 2016 Vadim Pasternak 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ *contributors may be used to endorse or promote products derived from
+ *this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * 

Re: [patch] leds: add driver for Mellanox systems LEDs

2016-08-31 Thread Jacek Anaszewski

Hi Vadim,

Thanks for the patch. See my comments below.

On 08/29/2016 08:07 PM, vad...@mellanox.com wrote:

From: Vadim Pasternak 

This makes it possible to create a set of LEDs for Mellanox systems:
"msx6710", "msx6720", "msb7700", "msn2700", "msx1410", "msn2410",
"msb7800", "msn2740", "msn2100".

Drivers creates led devices according to  system configuration, provided


s/Drivers/Driver/

and s/led/LED/ here and in case of all other occurrences in the
in-driver comments.


through system DMA data, like
fan1:green fan1:red status:green status:red


Documentation/leds/leds-class.txt states the LED class device
name should match the following pattern:

devicename:colour:function



LED setting is controlled through on board CPLD Lattice device.
For setting particular led off, solid,
blink (blink required ledtrig-timer module):


s/required/requires/


echo 0 > /sys/class/leds/status\:green/brightness
echo 1 > /sys/class/leds/status\:green/brightness
echo timer > /sys/class/leds/status\:green/trigger

On module probing all leds are set green, on removing - off.

Last setting overwrites previous, f.e. sequence for
changing led from green - red - green:
echo 1 > /sys/class/leds/psu\:green/brightness
echo 1 > /sys/class/leds/psu\:red/brightness
echo 1 > /sys/class/leds/psu\:green/brightness


It seems that there are many LEDs connected to the
same iout and they cannot be turned on simultaneously.
Am I right?


The Kconfig currently controlling compilation of this code is:
drivers/leds/Kconfig:config LEDS_MLXCPLD

Signed-off-by: Vadim Pasternak 
Reviewed-by: Jiri Pirko 
---
 MAINTAINERS |   7 +
 drivers/leds/Kconfig|   8 +
 drivers/leds/Makefile   |   1 +
 drivers/leds/leds-mlxcpld.c | 385 
 4 files changed, 401 insertions(+)
 create mode 100644 drivers/leds/leds-mlxcpld.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 0bbe4b1..31cffdd 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7655,6 +7655,13 @@ W:   http://www.mellanox.com
 Q: http://patchwork.ozlabs.org/project/netdev/list/
 F: drivers/net/ethernet/mellanox/mlxsw/

+MELLANOX MLXCPLD LED DRIVER
+M: Vadim Pasternak 
+L: linux-kernel@vger.kernel.org


s/linux-kernel/linux-leds/


+S: Supported
+W: http://www.mellanox.com


Could you please provide a direct link to the datasheet?


+F: drivers/leds/leds-mlxcpld.c
+
 SOFT-ROCE DRIVER (rxe)
 M: Moni Shoua 
 L: linux-r...@vger.kernel.org
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 9dcc9b1..4cd85be 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -631,6 +631,14 @@ config LEDS_VERSATILE
  This option enabled support for the LEDs on the ARM Versatile
  and RealView boards. Say Y to enabled these.

+config LEDS_MLXCPLD
+   tristate "LED support for the Mellanox boards"
+   depends on X86_64 && DMI
+   depends on LEDS_CLASS
+   help
+ This option enabled support for the LEDs on the Mellanox
+ boards. Say Y to enabled these.
+
 comment "LED Triggers"
 source "drivers/leds/trigger/Kconfig"

diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index 0684c86..9a2494b 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -68,6 +68,7 @@ obj-$(CONFIG_LEDS_KTD2692)+= leds-ktd2692.o
 obj-$(CONFIG_LEDS_POWERNV) += leds-powernv.o
 obj-$(CONFIG_LEDS_SEAD3)   += leds-sead3.o
 obj-$(CONFIG_LEDS_IS31FL32XX)  += leds-is31fl32xx.o
+obj-$(CONFIG_LEDS_MLXCPLD) += leds-mlxcpld.o

 # LED SPI Drivers
 obj-$(CONFIG_LEDS_DAC124S085)  += leds-dac124s085.o
diff --git a/drivers/leds/leds-mlxcpld.c b/drivers/leds/leds-mlxcpld.c
new file mode 100644
index 000..b79342c
--- /dev/null
+++ b/drivers/leds/leds-mlxcpld.c
@@ -0,0 +1,385 @@
+/*
+ * drivers/leds/leds-mlxcpld.c
+ * Copyright (c) 2016 Mellanox Technologies. All rights reserved.
+ * Copyright (c) 2016 Vadim Pasternak 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ *contributors may be used to endorse or promote products derived from
+ *this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS