Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1350048 > unrolled thread

Re: [PATCH] leds: Add Chrome OS keyboard backlight LEDs driver

Started byJacek Anaszewski <j.anaszewski@samsung.com>
First post2016-03-04 10:40 +0100
Last post2016-03-04 22:50 +0100
Articles 8 — 5 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] leds: Add Chrome OS keyboard backlight LEDs driver Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-03-04 10:40 +0100
    Re: [PATCH] leds: Add Chrome OS keyboard backlight LEDs driver Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-03-04 20:20 +0100
      Re: [PATCH] leds: Add Chrome OS keyboard backlight LEDs driver Evan McClain <aeroevan@gmail.com> - 2016-03-04 21:50 +0100
        Re: [PATCH] leds: Add Chrome OS keyboard backlight LEDs driver Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-03-04 22:00 +0100
          Re: [PATCH] leds: Add Chrome OS keyboard backlight LEDs driver Olof Johansson <olof@lixom.net> - 2016-03-04 23:10 +0100
      Re: [PATCH] leds: Add Chrome OS keyboard backlight LEDs driver Jacek Anaszewski <jacek.anaszewski@gmail.com> - 2016-03-04 22:00 +0100
        Re: [PATCH] leds: Add Chrome OS keyboard backlight LEDs driver Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-03-04 22:10 +0100
          Re: [PATCH] leds: Add Chrome OS keyboard backlight LEDs driver Jacek Anaszewski <jacek.anaszewski@gmail.com> - 2016-03-04 22:50 +0100

#1350048 — Re: [PATCH] leds: Add Chrome OS keyboard backlight LEDs driver

FromJacek Anaszewski <j.anaszewski@samsung.com>
Date2016-03-04 10:40 +0100
SubjectRe: [PATCH] leds: Add Chrome OS keyboard backlight LEDs driver
Message-ID<r8Unh-4Eo-25@gated-at.bofh.it>
Hi Evan,

On 03/04/2016 09:38 AM, Evan McClain wrote:
> On Thu, 2016-03-03 at 15:46 -0800, Dmitry Torokhov wrote:
>> From: Simon Que <sque@chromium.org>
>>
>> This is a driver for ACPI-based keyboard backlight LEDs found on
>> Chromebooks. The driver locates \\_SB.KBLT ACPI device and exports
>> backlight as "chromeos::kbd_backlight" LED class device in sysfs.
>
> Was it ever decided where this driver should live? I was planning on
> submitting to platform/chrome since most keyboard backlights seem to
> live over there but I don't think I got a response.
>

It hasn't been decided yet. I can take it, but could you submit one more
version, without

'owner	= THIS_MODULE' in struct platform_driver keyboard_led_driver ?

It is redundant, because the core will do it.

Also the line with devm_kzalloc has over 80 characters.

-- 
Best regards,
Jacek Anaszewski

[toc] | [next] | [standalone]


#1350533

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2016-03-04 20:20 +0100
Message-ID<r93qz-2YX-49@gated-at.bofh.it>
In reply to#1350048
On Fri, Mar 04, 2016 at 10:38:40AM +0100, Jacek Anaszewski wrote:
> Hi Evan,
> 
> On 03/04/2016 09:38 AM, Evan McClain wrote:
> >On Thu, 2016-03-03 at 15:46 -0800, Dmitry Torokhov wrote:
> >>From: Simon Que <sque@chromium.org>
> >>
> >>This is a driver for ACPI-based keyboard backlight LEDs found on
> >>Chromebooks. The driver locates \\_SB.KBLT ACPI device and exports
> >>backlight as "chromeos::kbd_backlight" LED class device in sysfs.
> >
> >Was it ever decided where this driver should live? I was planning on
> >submitting to platform/chrome since most keyboard backlights seem to
> >live over there but I don't think I got a response.
> >
> 
> It hasn't been decided yet. I can take it, but could you submit one more
> version, without
> 
> 'owner	= THIS_MODULE' in struct platform_driver keyboard_led_driver ?
> 
> It is redundant, because the core will do it.
> 
> Also the line with devm_kzalloc has over 80 characters.

Also:

- preferably use sizeof(*cdev) instead of sizeof(struct ...)
- do not check cdev->flags & LED_SUSPENDED in
  keyboard_led_set_brightness() as it is not going to be called when led
  device is suspended anyway
- change the MODULE_LICENSE from "GPL v2" to "GPL" as to match the
  actual license notice
- report ACPI errors in error messages (since we clobber them)
- preferably use ENXIO instead of ENODEV
- maybe add "depends on CHROME_PLATFORMS || COMPILE_TEST" so that we do
  not prompt for it on non-Chrome platforms

Thanks.

-- 
Dmitry

[toc] | [prev] | [next] | [standalone]


#1350577

FromEvan McClain <aeroevan@gmail.com>
Date2016-03-04 21:50 +0100
Message-ID<r94PE-3Vt-19@gated-at.bofh.it>
In reply to#1350533

[Multipart message — attachments visible in raw view] — view raw

On Fri, 2016-03-04 at 11:13 -0800, Dmitry Torokhov wrote:
> On Fri, Mar 04, 2016 at 10:38:40AM +0100, Jacek Anaszewski wrote:
> > 
> > Hi Evan,
> > 
> > On 03/04/2016 09:38 AM, Evan McClain wrote:
> > > 
> > > On Thu, 2016-03-03 at 15:46 -0800, Dmitry Torokhov wrote:
> > > > 
> > > > From: Simon Que <sque@chromium.org>
> > > > 
> > > > This is a driver for ACPI-based keyboard backlight LEDs found
> > > > on
> > > > Chromebooks. The driver locates \\_SB.KBLT ACPI device and
> > > > exports
> > > > backlight as "chromeos::kbd_backlight" LED class device in
> > > > sysfs.
> > > Was it ever decided where this driver should live? I was planning
> > > on
> > > submitting to platform/chrome since most keyboard backlights seem
> > > to
> > > live over there but I don't think I got a response.
> > > 
> > It hasn't been decided yet. I can take it, but could you submit one
> > more
> > version, without
> > 
> > 'owner	= THIS_MODULE' in struct platform_driver
> > keyboard_led_driver ?
> > 
> > It is redundant, because the core will do it.
> > 
> > Also the line with devm_kzalloc has over 80 characters.
> Also:
> 
> - preferably use sizeof(*cdev) instead of sizeof(struct ...)
> - do not check cdev->flags & LED_SUSPENDED in
>   keyboard_led_set_brightness() as it is not going to be called when
> led
>   device is suspended anyway

Your patch is definitely better, I was only taking Simon's original
submission and doing the minimal cleanup to help get it submitted (as
someone using mainline linux on a pixel 2/samus).

> - change the MODULE_LICENSE from "GPL v2" to "GPL" as to match the
>   actual license notice

I think this got changed in one of the revisions in error.

> - report ACPI errors in error messages (since we clobber them)
> - preferably use ENXIO instead of ENODEV

Most other drivers seem to use ENODEV on probe, but I'm in the 'learn
through grep' level of understanding for parts of linux.

> - maybe add "depends on CHROME_PLATFORMS || COMPILE_TEST" so that we
> do
>   not prompt for it on non-Chrome platforms

Adding depends on CHROME_PLATFORMS definitely makes sense, but also
might support putting this driver in platform/chrome. Either way I just
selfishly want better mainline support for this laptop.

The only change I made (other than the changes suggested by Jacek) was
to remove the line setting brightness to max_brightness on probe. I can
resubmit a cleaned up patch incorporating your changes unless you would
like to take over.

Thanks
-- 
Evan McClain
https://keybase.io/aeroevan

[toc] | [prev] | [next] | [standalone]


#1350581

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2016-03-04 22:00 +0100
Message-ID<r94Zk-40K-1@gated-at.bofh.it>
In reply to#1350577
On Fri, Mar 04, 2016 at 03:41:36PM -0500, Evan McClain wrote:
> On Fri, 2016-03-04 at 11:13 -0800, Dmitry Torokhov wrote:
> > On Fri, Mar 04, 2016 at 10:38:40AM +0100, Jacek Anaszewski wrote:
> > > 
> > > Hi Evan,
> > > 
> > > On 03/04/2016 09:38 AM, Evan McClain wrote:
> > > > 
> > > > On Thu, 2016-03-03 at 15:46 -0800, Dmitry Torokhov wrote:
> > > > > 
> > > > > From: Simon Que <sque@chromium.org>
> > > > > 
> > > > > This is a driver for ACPI-based keyboard backlight LEDs found
> > > > > on
> > > > > Chromebooks. The driver locates \\_SB.KBLT ACPI device and
> > > > > exports
> > > > > backlight as "chromeos::kbd_backlight" LED class device in
> > > > > sysfs.
> > > > Was it ever decided where this driver should live? I was planning
> > > > on
> > > > submitting to platform/chrome since most keyboard backlights seem
> > > > to
> > > > live over there but I don't think I got a response.
> > > > 
> > > It hasn't been decided yet. I can take it, but could you submit one
> > > more
> > > version, without
> > > 
> > > 'owner	= THIS_MODULE' in struct platform_driver
> > > keyboard_led_driver ?
> > > 
> > > It is redundant, because the core will do it.
> > > 
> > > Also the line with devm_kzalloc has over 80 characters.
> > Also:
> > 
> > - preferably use sizeof(*cdev) instead of sizeof(struct ...)
> > - do not check cdev->flags & LED_SUSPENDED in
> >   keyboard_led_set_brightness() as it is not going to be called when
> > led
> >   device is suspended anyway
> 
> Your patch is definitely better, I was only taking Simon's original
> submission and doing the minimal cleanup to help get it submitted (as
> someone using mainline linux on a pixel 2/samus).
> 
> > - change the MODULE_LICENSE from "GPL v2" to "GPL" as to match the
> >   actual license notice
> 
> I think this got changed in one of the revisions in error.
> 
> > - report ACPI errors in error messages (since we clobber them)
> > - preferably use ENXIO instead of ENODEV
> 
> Most other drivers seem to use ENODEV on probe, but I'm in the 'learn
> through grep' level of understanding for parts of linux.
> 
> > - maybe add "depends on CHROME_PLATFORMS || COMPILE_TEST" so that we
> > do
> >   not prompt for it on non-Chrome platforms
> 
> Adding depends on CHROME_PLATFORMS definitely makes sense, but also
> might support putting this driver in platform/chrome. Either way I just

Olof, do you want it in platform/chrome?

> selfishly want better mainline support for this laptop.
> 
> The only change I made (other than the changes suggested by Jacek) was
> to remove the line setting brightness to max_brightness on probe. I can

I wonder if we should actually read the current brightness before
registering the led device.

Thanks.

-- 
Dmitry

[toc] | [prev] | [next] | [standalone]


#1350638

FromOlof Johansson <olof@lixom.net>
Date2016-03-04 23:10 +0100
Message-ID<r9654-53B-13@gated-at.bofh.it>
In reply to#1350581
On Fri, Mar 4, 2016 at 12:56 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Fri, Mar 04, 2016 at 03:41:36PM -0500, Evan McClain wrote:
>> On Fri, 2016-03-04 at 11:13 -0800, Dmitry Torokhov wrote:
>> > On Fri, Mar 04, 2016 at 10:38:40AM +0100, Jacek Anaszewski wrote:
>> > >
>> > > Hi Evan,
>> > >
>> > > On 03/04/2016 09:38 AM, Evan McClain wrote:
>> > > >
>> > > > On Thu, 2016-03-03 at 15:46 -0800, Dmitry Torokhov wrote:
>> > > > >
>> > > > > From: Simon Que <sque@chromium.org>
>> > > > >
>> > > > > This is a driver for ACPI-based keyboard backlight LEDs found
>> > > > > on
>> > > > > Chromebooks. The driver locates \\_SB.KBLT ACPI device and
>> > > > > exports
>> > > > > backlight as "chromeos::kbd_backlight" LED class device in
>> > > > > sysfs.
>> > > > Was it ever decided where this driver should live? I was planning
>> > > > on
>> > > > submitting to platform/chrome since most keyboard backlights seem
>> > > > to
>> > > > live over there but I don't think I got a response.
>> > > >
>> > > It hasn't been decided yet. I can take it, but could you submit one
>> > > more
>> > > version, without
>> > >
>> > > 'owner    = THIS_MODULE' in struct platform_driver
>> > > keyboard_led_driver ?
>> > >
>> > > It is redundant, because the core will do it.
>> > >
>> > > Also the line with devm_kzalloc has over 80 characters.
>> > Also:
>> >
>> > - preferably use sizeof(*cdev) instead of sizeof(struct ...)
>> > - do not check cdev->flags & LED_SUSPENDED in
>> >   keyboard_led_set_brightness() as it is not going to be called when
>> > led
>> >   device is suspended anyway
>>
>> Your patch is definitely better, I was only taking Simon's original
>> submission and doing the minimal cleanup to help get it submitted (as
>> someone using mainline linux on a pixel 2/samus).
>>
>> > - change the MODULE_LICENSE from "GPL v2" to "GPL" as to match the
>> >   actual license notice
>>
>> I think this got changed in one of the revisions in error.
>>
>> > - report ACPI errors in error messages (since we clobber them)
>> > - preferably use ENXIO instead of ENODEV
>>
>> Most other drivers seem to use ENODEV on probe, but I'm in the 'learn
>> through grep' level of understanding for parts of linux.
>>
>> > - maybe add "depends on CHROME_PLATFORMS || COMPILE_TEST" so that we
>> > do
>> >   not prompt for it on non-Chrome platforms
>>
>> Adding depends on CHROME_PLATFORMS definitely makes sense, but also
>> might support putting this driver in platform/chrome. Either way I just
>
> Olof, do you want it in platform/chrome?

Based on in-person discussion, I can take them through there, sure.


-Olof

[toc] | [prev] | [next] | [standalone]


#1350585

FromJacek Anaszewski <jacek.anaszewski@gmail.com>
Date2016-03-04 22:00 +0100
Message-ID<r94Zl-40K-21@gated-at.bofh.it>
In reply to#1350533
On 03/04/2016 08:13 PM, Dmitry Torokhov wrote:
> On Fri, Mar 04, 2016 at 10:38:40AM +0100, Jacek Anaszewski wrote:
>> Hi Evan,
>>
>> On 03/04/2016 09:38 AM, Evan McClain wrote:
>>> On Thu, 2016-03-03 at 15:46 -0800, Dmitry Torokhov wrote:
>>>> From: Simon Que <sque@chromium.org>
>>>>
>>>> This is a driver for ACPI-based keyboard backlight LEDs found on
>>>> Chromebooks. The driver locates \\_SB.KBLT ACPI device and exports
>>>> backlight as "chromeos::kbd_backlight" LED class device in sysfs.
>>>
>>> Was it ever decided where this driver should live? I was planning on
>>> submitting to platform/chrome since most keyboard backlights seem to
>>> live over there but I don't think I got a response.
>>>
>>
>> It hasn't been decided yet. I can take it, but could you submit one more
>> version, without
>>
>> 'owner	= THIS_MODULE' in struct platform_driver keyboard_led_driver ?
>>
>> It is redundant, because the core will do it.
>>
>> Also the line with devm_kzalloc has over 80 characters.
>
> Also:
>
> - preferably use sizeof(*cdev) instead of sizeof(struct ...)
> - do not check cdev->flags & LED_SUSPENDED in
>    keyboard_led_set_brightness() as it is not going to be called when led
>    device is suspended anyway
> - change the MODULE_LICENSE from "GPL v2" to "GPL" as to match the

I can see "either version 2 of the License" in the license notice.

>    actual license notice
> - report ACPI errors in error messages (since we clobber them)
> - preferably use ENXIO instead of ENODEV
> - maybe add "depends on CHROME_PLATFORMS || COMPILE_TEST" so that we do
>    not prompt for it on non-Chrome platforms

I agree with the remaining items.

-- 
Best Regards,
Jacek Anaszewski

[toc] | [prev] | [next] | [standalone]


#1350587

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2016-03-04 22:10 +0100
Message-ID<r958Z-4m4-5@gated-at.bofh.it>
In reply to#1350585
On Fri, Mar 04, 2016 at 09:55:24PM +0100, Jacek Anaszewski wrote:
> On 03/04/2016 08:13 PM, Dmitry Torokhov wrote:
> >On Fri, Mar 04, 2016 at 10:38:40AM +0100, Jacek Anaszewski wrote:
> >>Hi Evan,
> >>
> >>On 03/04/2016 09:38 AM, Evan McClain wrote:
> >>>On Thu, 2016-03-03 at 15:46 -0800, Dmitry Torokhov wrote:
> >>>>From: Simon Que <sque@chromium.org>
> >>>>
> >>>>This is a driver for ACPI-based keyboard backlight LEDs found on
> >>>>Chromebooks. The driver locates \\_SB.KBLT ACPI device and exports
> >>>>backlight as "chromeos::kbd_backlight" LED class device in sysfs.
> >>>
> >>>Was it ever decided where this driver should live? I was planning on
> >>>submitting to platform/chrome since most keyboard backlights seem to
> >>>live over there but I don't think I got a response.
> >>>
> >>
> >>It hasn't been decided yet. I can take it, but could you submit one more
> >>version, without
> >>
> >>'owner	= THIS_MODULE' in struct platform_driver keyboard_led_driver ?
> >>
> >>It is redundant, because the core will do it.
> >>
> >>Also the line with devm_kzalloc has over 80 characters.
> >
> >Also:
> >
> >- preferably use sizeof(*cdev) instead of sizeof(struct ...)
> >- do not check cdev->flags & LED_SUSPENDED in
> >   keyboard_led_set_brightness() as it is not going to be called when led
> >   device is suspended anyway
> >- change the MODULE_LICENSE from "GPL v2" to "GPL" as to match the
> 
> I can see "either version 2 of the License" in the license notice.

From module.h:

 *	"GPL"				[GNU Public License v2 or later]
 *	"GPL v2"			[GNU Public License v2]

leds-chromeos-keyboard is GPL v2+ so module license should be "GPL".

Thanks.

-- 
Dmitry

[toc] | [prev] | [next] | [standalone]


#1350626

FromJacek Anaszewski <jacek.anaszewski@gmail.com>
Date2016-03-04 22:50 +0100
Message-ID<r95LJ-4GI-23@gated-at.bofh.it>
In reply to#1350587
On 03/04/2016 09:59 PM, Dmitry Torokhov wrote:
> On Fri, Mar 04, 2016 at 09:55:24PM +0100, Jacek Anaszewski wrote:
>> On 03/04/2016 08:13 PM, Dmitry Torokhov wrote:
>>> On Fri, Mar 04, 2016 at 10:38:40AM +0100, Jacek Anaszewski wrote:
>>>> Hi Evan,
>>>>
>>>> On 03/04/2016 09:38 AM, Evan McClain wrote:
>>>>> On Thu, 2016-03-03 at 15:46 -0800, Dmitry Torokhov wrote:
>>>>>> From: Simon Que <sque@chromium.org>
>>>>>>
>>>>>> This is a driver for ACPI-based keyboard backlight LEDs found on
>>>>>> Chromebooks. The driver locates \\_SB.KBLT ACPI device and exports
>>>>>> backlight as "chromeos::kbd_backlight" LED class device in sysfs.
>>>>>
>>>>> Was it ever decided where this driver should live? I was planning on
>>>>> submitting to platform/chrome since most keyboard backlights seem to
>>>>> live over there but I don't think I got a response.
>>>>>
>>>>
>>>> It hasn't been decided yet. I can take it, but could you submit one more
>>>> version, without
>>>>
>>>> 'owner	= THIS_MODULE' in struct platform_driver keyboard_led_driver ?
>>>>
>>>> It is redundant, because the core will do it.
>>>>
>>>> Also the line with devm_kzalloc has over 80 characters.
>>>
>>> Also:
>>>
>>> - preferably use sizeof(*cdev) instead of sizeof(struct ...)
>>> - do not check cdev->flags & LED_SUSPENDED in
>>>    keyboard_led_set_brightness() as it is not going to be called when led
>>>    device is suspended anyway
>>> - change the MODULE_LICENSE from "GPL v2" to "GPL" as to match the
>>
>> I can see "either version 2 of the License" in the license notice.
>
>>From module.h:
>
>   *	"GPL"				[GNU Public License v2 or later]
>   *	"GPL v2"			[GNU Public License v2]
>
> leds-chromeos-keyboard is GPL v2+ so module license should be "GPL".


That's surprising. Thanks for spotting this.

-- 
Best Regards,
Jacek Anaszewski

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web