Re: [PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360

2020-09-11 Thread Jacek Anaszewski
On 9/11/20 1:24 AM, Gene Chen wrote: Pavel Machek 於 2020年9月11日 週五 下午3:05寫道: Hi! +{ +struct mt6360_led *led = container_of(lcdev, struct mt6360_led, flash.led_cdev); +struct mt6360_priv *priv = led->priv; +u32 enable_mask = MT6360_TORCHEN_MASK | MT6360_FLCSEN_MASK(led->led_no); +

Re: [PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360

2020-09-11 Thread Jacek Anaszewski
Hi Pavel, On 9/11/20 9:05 AM, Pavel Machek wrote: Hi! +{ + struct mt6360_led *led = container_of(lcdev, struct mt6360_led, flash.led_cdev); + struct mt6360_priv *priv = led->priv; + u32 enable_mask = MT6360_TORCHEN_MASK | MT6360_FLCSEN_MASK(led->led_no); + u32 val = (l

Re: [PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360

2020-09-11 Thread Gene Chen
Pavel Machek 於 2020年9月11日 週五 下午3:05寫道: > > Hi! > > > >+{ > > >+struct mt6360_led *led = container_of(lcdev, struct mt6360_led, > > >flash.led_cdev); > > >+struct mt6360_priv *priv = led->priv; > > >+u32 enable_mask = MT6360_TORCHEN_MASK | > > >MT6360_FLCSEN_MASK(led->led_no); > > >+

Re: [PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360

2020-09-11 Thread Pavel Machek
Hi! > >+{ > >+struct mt6360_led *led = container_of(lcdev, struct mt6360_led, > >flash.led_cdev); > >+struct mt6360_priv *priv = led->priv; > >+u32 enable_mask = MT6360_TORCHEN_MASK | MT6360_FLCSEN_MASK(led->led_no); > >+u32 val = (level) ? MT6360_FLCSEN_MASK(led->led_no) : 0; > >

Re: [PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360

2020-09-10 Thread Jacek Anaszewski
Hi Gene, Thanks for the update. On 9/7/20 12:27 PM, Gene Chen wrote: From: Gene Chen Add MT6360 LED driver include 2-channel Flash LED with torch/strobe mode, and 4-channel RGB LED support Register/Flash/Breath Mode Signed-off-by: Gene Chen --- drivers/leds/Kconfig | 11 + drivers

Re: [PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360

2020-09-10 Thread Jacek Anaszewski
On 9/10/20 10:25 PM, Pavel Machek wrote: Hi! 1. set FLED1 brightness # echo 1 > /sys/class/leds/white:flash1/flash_brightness 2. enable FLED1 strobe # echo 1 > /sys/class/leds/white:flash1/flash_strobe 3 . turn off FLED1 strobe (just used to gaurantee the strobe mode flash leds must be turned o

Re: [PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360

2020-09-10 Thread Pavel Machek
Hi! > > > 1. set FLED1 brightness > > > # echo 1 > /sys/class/leds/white:flash1/flash_brightness > > > 2. enable FLED1 strobe > > > # echo 1 > /sys/class/leds/white:flash1/flash_strobe > > > 3 . turn off FLED1 strobe (just used to gaurantee the strobe mode > > > flash leds must be turned off) > >

Re: [PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360

2020-09-10 Thread Jacek Anaszewski
On 9/10/20 2:29 PM, Pavel Machek wrote: Hi! +{ + struct mt6360_led *led = container_of(lcdev, struct mt6360_led, flash.led_cdev); + struct mt6360_priv *priv = led->priv; + u32 enable_mask = MT6360_TORCHEN_MASK | MT6360_FLCSEN_MASK(led->led_no); + u32 val = (level) ? MT6360_FLCS

Re: [PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360

2020-09-10 Thread Pavel Machek
Hi! > > > +{ > > > + struct mt6360_led *led = container_of(lcdev, struct mt6360_led, > > > flash.led_cdev); > > > + struct mt6360_priv *priv = led->priv; > > > + u32 enable_mask = MT6360_TORCHEN_MASK | > > > MT6360_FLCSEN_MASK(led->led_no); > > > + u32 val = (level) ? MT6360_FLCS

Re: [PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360

2020-09-10 Thread Pavel Machek
On Thu 2020-09-10 14:34:54, Andy Shevchenko wrote: > On Thu, Sep 10, 2020 at 11:18 AM Pavel Machek wrote: > > ... > > > > > > +enum { > > > > > + MT6360_LED_ISNK1 = 0, > > > > > + MT6360_LED_ISNK2, > > > > > + MT6360_LED_ISNK3, > > > > > + MT6360_LED_ISNK4, > > > > > +

Re: [PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360

2020-09-10 Thread Andy Shevchenko
On Thu, Sep 10, 2020 at 11:11 AM Gene Chen wrote: > Andy Shevchenko 於 2020年9月9日 週三 下午9:48寫道: > > On Mon, Sep 7, 2020 at 1:31 PM Gene Chen > > wrote: > > > From: Gene Chen ... > > > + if (priv->fled_strobe_used) { > > > + dev_warn(lcdev->dev, "Please disable strobe first

Re: [PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360

2020-09-10 Thread Andy Shevchenko
On Thu, Sep 10, 2020 at 11:18 AM Pavel Machek wrote: ... > > > > +enum { > > > > + MT6360_LED_ISNK1 = 0, > > > > + MT6360_LED_ISNK2, > > > > + MT6360_LED_ISNK3, > > > > + MT6360_LED_ISNK4, > > > > + MT6360_LED_FLASH1, > > > > + MT6360_LED_FLASH2, > > > > > > >

Re: [PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360

2020-09-10 Thread Pavel Machek
Hi! > > > +enum { > > > + MT6360_LED_ISNK1 = 0, > > > + MT6360_LED_ISNK2, > > > + MT6360_LED_ISNK3, > > > + MT6360_LED_ISNK4, > > > + MT6360_LED_FLASH1, > > > + MT6360_LED_FLASH2, > > > > > + MT6360_MAX_LEDS, > > > > No comma for terminator entry. > > > >

Re: [PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360

2020-09-10 Thread Gene Chen
Andy Shevchenko 於 2020年9月9日 週三 下午9:48寫道: > > On Mon, Sep 7, 2020 at 1:31 PM Gene Chen wrote: > > > > From: Gene Chen > > > > Add MT6360 LED driver include 2-channel Flash LED with torch/strobe mode, > > and 4-channel RGB LED support Register/Flash/Breath Mode > > I'm wondering why you don't use

Re: [PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360

2020-09-10 Thread Gene Chen
Pavel Machek 於 2020年9月9日 週三 上午6:25寫道: > > Hi! > > > From: Gene Chen > > > > Add MT6360 LED driver include 2-channel Flash LED with torch/strobe mode, > > and 4-channel RGB LED support Register/Flash/Breath Mode > > > > Signed-off-by: Gene Chen > > --- > > drivers/leds/Kconfig | 11 + > >

Re: [PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360

2020-09-09 Thread Andy Shevchenko
On Mon, Sep 7, 2020 at 1:31 PM Gene Chen wrote: > > From: Gene Chen > > Add MT6360 LED driver include 2-channel Flash LED with torch/strobe mode, > and 4-channel RGB LED support Register/Flash/Breath Mode I'm wondering why you don't use struct led_classdev_flash. ... > +// > +// Copyright (C)

Re: [PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360

2020-09-08 Thread Pavel Machek
Hi! > From: Gene Chen > > Add MT6360 LED driver include 2-channel Flash LED with torch/strobe mode, > and 4-channel RGB LED support Register/Flash/Breath Mode > > Signed-off-by: Gene Chen > --- > drivers/leds/Kconfig | 11 + > drivers/leds/Makefile | 1 + > drivers/leds/leds-mt6

Re: [PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360

2020-09-08 Thread Dan Murphy
Gene On 9/7/20 5:27 AM, Gene Chen wrote: From: Gene Chen Add MT6360 LED driver include 2-channel Flash LED with torch/strobe mode, and 4-channel RGB LED support Register/Flash/Breath Mode Signed-off-by: Gene Chen --- drivers/leds/Kconfig | 11 + drivers/leds/Makefile | 1 +

[PATCH v3 1/2] leds: mt6360: Add LED driver for MT6360

2020-09-07 Thread Gene Chen
From: Gene Chen Add MT6360 LED driver include 2-channel Flash LED with torch/strobe mode, and 4-channel RGB LED support Register/Flash/Breath Mode Signed-off-by: Gene Chen --- drivers/leds/Kconfig | 11 + drivers/leds/Makefile | 1 + drivers/leds/leds-mt6360.c | 681 +