From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Machek Subject: Re: [PATCH v5 3/3] platform/chrome: Standardize Chrome OS keyboard backlight name Date: Sun, 7 Apr 2019 00:17:56 +0200 Message-ID: <20190406221756.GA4472@amd> References: <20190404202042.GF29984@amd> <20190404204207.GH29984@amd> <20190404220509.GA14690@amd> <469dfb68-a7ab-668d-15cb-9e021c0d3f0c@gmail.com> <20190406095346.GB7546@amd> <1b45b4e8-18b6-62d5-7d42-0feed57c2c73@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="G4iJoqBmSsgzjUCe" Return-path: Content-Disposition: inline In-Reply-To: <1b45b4e8-18b6-62d5-7d42-0feed57c2c73@gmail.com> Sender: linux-kernel-owner@vger.kernel.org To: Jacek Anaszewski Cc: Enric Balletbo i Serra , Guenter Roeck , Dmitry Torokhov , Nick Crews , Benson Leung , linux-leds@vger.kernel.org, Alexandre Belloni , Alessandro Zummo , linux-rtc@vger.kernel.org, linux-kernel , Duncan Laurie , Simon Glass List-Id: linux-leds@vger.kernel.org --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > >I am not sure about existing driver. Important thing for me is that > >new drivers use consistent naming. > > > >>In cases like above: > >> > >> keyboardist::kbd_backlight > >> tclnumpad::kbd_backlight > >> > >>we could do with the following: > >> > >> :kbd-backlight > >> :numpad-backlight > >> > >>I used hyphens instead of underscores since we will have this convention > >>in the LED_FUNCTION names, which is more common for Device Tree, and > >>some of existing LED triggers. > > > >Existing userspace already searches for *:kbd_backlight", AFAICT, so > >we probably want to keep the "_". >=20 > OK, but it should be an exception but not a rule. > This "kbd-*" naming is used in input and tty subsystems which register > keyboard triggers with this style: >=20 > ~/kernel$ git grep ".*[\":]kbd-" -- "*.c" > drivers/input/input-leds.c: [LED_NUML] =3D { "numlock", > VT_TRIGGER("kbd-numlock") }, > "kbd_" naming is used only in case of backlight LEDs: >=20 > ~/kernel$ git grep ".*[\":]kbd_" -- "*.c" > drivers/hid/hid-asus.c: drvdata->kbd_backlight->cdev.name =3D > "asus::kbd_backlight"; Yes, but userland already knows about kbd_backlight, so we really can not change this. > With LEDs in platform drivers is that problem that we have the name > compiled into the kernel. Maybe to make it more flexible we could > use kernel config to choose between new "kbd-" and legacy "kbd_" > naming. No, I don't think that is suitable use for config option. > >I don't care much if we use "platform:" or no prefix at all for > >backlight of internal keyboard, as long as it is consistent across all > >devices. > > > >We certainly want to use some prefix (probably inputX:) for backlight > >on USB keyboards. >=20 > For LEDs exposed through the input-LED bridge my get_led_device_info.sh > script nicely reports: >=20 > associated input node: input1 >=20 > It just does: >=20 > readlink input1\:\:numlock/device >=20 > which prints: "../../input1 " Yes, that will probably work for USB keyboards. (But not for internal keyboards on phones, etc). Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --G4iJoqBmSsgzjUCe Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlypJZQACgkQMOfwapXb+vJtUACcDprz07bWGG7owVUANpYCh1Dn nncAn3OE1uj6KGpEPmzK7C18vf/0BB89 =6fQc -----END PGP SIGNATURE----- --G4iJoqBmSsgzjUCe--