All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <groeck@google.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: Dmitry Torokhov <dtor@google.com>,
	Guenter Roeck <linux@roeck-us.net>,
	Nick Crews <ncrews@chromium.org>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	Benson Leung <bleung@chromium.org>,
	linux-leds@vger.kernel.org,
	Jacek Anaszewski <jacek.anaszewski@gmail.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Alessandro Zummo <a.zummo@towertech.it>,
	linux-rtc@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>,
	Duncan Laurie <dlaurie@chromium.org>,
	Simon Glass <sjg@google.com>
Subject: Re: Keyboard backlight LED naming was Re: [PATCH v5 2/3] platform/chrome: Add Wilco EC keyboard backlight LEDs support
Date: Mon, 8 Apr 2019 06:31:44 -0700	[thread overview]
Message-ID: <CABXOdTcrQELWVc5SwPHAk6BP5wq=kQg6K_g-7p+Y73tPFAFTdQ@mail.gmail.com> (raw)
In-Reply-To: <20190408094113.GB30958@amd>

On Mon, Apr 8, 2019 at 2:41 AM Pavel Machek <pavel@ucw.cz> wrote:
>
> Hi!
>
> > > > > > This document also states "The naming scheme above leaves scope
> > > > > > for further attributes should they be needed". It does not permit,
> > > > > > however, to redefine one of the fields to mean "location", much less
> > > > > > the declaration that a devicename of "platform" shall refer to an
> > > > > > "internal" backlight, or that there shall be no more than one
> > > > > > "internal" backlight in a given system.
> > > > >
> > > > > "platform" is as good devicename as "wilco" or "chromeos".
> > > >
> > > > No, because "platform" is not a device, it is something that you are
> > > > trying to assign a magic meaning to.
> > >
> > > "chromeos" is not a device, either.
> >
> > I agree, it is not a device name. We do not assign any specific
> > meaning to it though. We could change it to "cros_ec" if so desired
> > and nothing should break.
>
> Yes. And you can also change it to "platform" and nothing will break
> :-). Can we end the discussion here?
>
> If not, lets take a look at existing names:
>
> ./drivers/platform/x86/asus-laptop.c:           cdev->name = "asus::kbd_backlight";
> ./drivers/platform/x86/samsung-laptop.c:                samsung->kbd_led.name = "samsung::kbd_backlight";
> ./drivers/platform/x86/thinkpad_acpi.c:         .name           = "tpacpi::kbd_backlight",
> ./drivers/platform/x86/toshiba_acpi.c:          dev->kbd_led.name = "toshiba::kbd_backlight";
> ./drivers/platform/x86/asus-wmi.c:              asus->kbd_led.name = "asus::kbd_backlight";
> ./drivers/platform/x86/dell-laptop.c:   .name           = "dell::kbd_backlight",
> ./drivers/platform/chrome/cros_kbd_led_backlight.c:     cdev->name = "chromeos::kbd_backlight";
> ./drivers/hwmon/applesmc.c:     .name                   = "smc::kbd_backlight",
> ./drivers/hid/hid-asus.c:       drvdata->kbd_backlight->cdev.name = "asus::kbd_backlight";
> ./drivers/hid/hid-google-hammer.c:      kbd_backlight->cdev.name = "hammer::kbd_backlight";
> ./drivers/input/misc/ims-pcu.c:          "pcu%d::kbd_backlight", pcu->device_no);
>
> asus, samsung, toshiba, asus, dell, chromeos... Those are really not
> device names, either. But in these cases, LED is probably controlled
> by EC, or by ACPI BIOS talking to the EC. People usually call such
> devices "platform devices".
>
> (Linux Platform Device Driver - CodeProject
> https://www.codeproject.com/tips/1080177/linux-platform-device-driver
> A platform device is one which is hardwired on the board and hence not
> hot-pluggable. )
>
> You can take a look at discussion around micmute LED.
>
> Thus "platform" is quite suitable name in your case, and incidentaly,
> it will be more useful for userspace than "cros_ec".
>
No, it isn't. All those name are at least roughly associated with the
driver name, and they all do reflect the abbreviated driver name.
"platform" isn't, and is prone to duplicates.

If you want the location reflected in the led sysfs atttribute name,
say so. "platform" is neither a driver name nor a location. On a side
note, appending a number to the attribute name is not a good idea. In
addition to not being backward compatible, it would be prone to
renumbering at each reboot.

Guenter

>                                                                 Pavel
> --
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2019-04-08 13:31 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04 17:10 [PATCH v5 1/3] platform/chrome: wilco_ec: Standardize mailbox interface Nick Crews
2019-04-04 17:10 ` [PATCH v5 2/3] platform/chrome: Add Wilco EC keyboard backlight LEDs support Nick Crews
2019-04-04 19:52   ` Pavel Machek
2019-04-05 20:15   ` Guenter Roeck
2019-04-06  8:41     ` Pavel Machek
2019-04-07 21:46       ` Dmitry Torokhov
2019-04-07 22:18         ` Pavel Machek
2019-04-07 22:26           ` Dmitry Torokhov
2019-04-08  9:41             ` Keyboard backlight LED naming was " Pavel Machek
2019-04-08 13:31               ` Guenter Roeck [this message]
2019-04-04 17:10 ` [PATCH v5 3/3] platform/chrome: Standardize Chrome OS keyboard backlight name Nick Crews
2019-04-04 17:36   ` Guenter Roeck
2019-04-04 17:43     ` Dmitry Torokhov
2019-04-04 18:41       ` Nick Crews
2019-04-04 18:55         ` Dmitry Torokhov
2019-04-04 18:59           ` Pavel Machek
2019-04-04 19:05             ` Dmitry Torokhov
2019-04-04 19:19               ` Pavel Machek
2019-04-04 19:59                 ` Dmitry Torokhov
2019-04-04 20:06                   ` Pavel Machek
2019-04-04 20:13                     ` Dmitry Torokhov
2019-04-04 20:20                       ` Pavel Machek
2019-04-04 20:26                         ` Dmitry Torokhov
2019-04-04 20:42                           ` Pavel Machek
2019-04-04 21:48                             ` Dmitry Torokhov
2019-04-04 22:05                               ` Pavel Machek
2019-04-04 22:42                                 ` Guenter Roeck
2019-04-05  8:42                                   ` Enric Balletbo i Serra
2019-04-05 20:00                                     ` Jacek Anaszewski
2019-04-06  9:53                                       ` Pavel Machek
2019-04-06 14:15                                         ` Jacek Anaszewski
2019-04-06 22:17                                           ` Pavel Machek
2019-04-07 22:01                                       ` Dmitry Torokhov
2019-04-07 22:01                                         ` Dmitry Torokhov
2019-04-08 20:01                                         ` Jacek Anaszewski
2019-04-04 18:56         ` Pavel Machek
2019-04-08 23:58   ` Nick Crews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABXOdTcrQELWVc5SwPHAk6BP5wq=kQg6K_g-7p+Y73tPFAFTdQ@mail.gmail.com' \
    --to=groeck@google.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bleung@chromium.org \
    --cc=dlaurie@chromium.org \
    --cc=dtor@google.com \
    --cc=enric.balletbo@collabora.com \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=ncrews@chromium.org \
    --cc=pavel@ucw.cz \
    --cc=sjg@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.