From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Date: Thu, 03 Dec 2009 03:12:51 +0000 Subject: Re: udev keymaps: support for force_release quirk Message-Id: <20091203031250.GC9121@core.coreip.homeip.net> List-Id: References: <20091126173912.GA25185@sig21.net> In-Reply-To: <20091126173912.GA25185@sig21.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org On Tue, Dec 01, 2009 at 03:21:20AM +0100, Johannes Stezenbach wrote: > On Tue, Dec 01, 2009 at 02:55:27AM +0100, Kay Sievers wrote: > > On Tue, Dec 1, 2009 at 02:52, Johannes Stezenbach wrote: > > > On Mon, Nov 30, 2009 at 05:37:04PM -0800, Dmitry Torokhov wrote: > > >> On Tue, Dec 01, 2009 at 02:28:06AM +0100, Kay Sievers wrote: > > >> > On Tue, Dec 1, 2009 at 00:27, Johannes Stezenbach w= rote: > > >> > > + =A0 =A0 =A0 strncat(fn, "/device/device/force_release", sizeof= (fn)); > > >> > > > >> > You can only select a parent device by it's subsystem/devtype. Any > > >> > hardcoded assumption about the order of parents is wrong, and the > > >> > "device" link is deprecated, it must not appear anywhere in udev c= ode. > > > > > > I have to admit I have no clue how else to do it. =A0I'd be glad > > > to hear your advice. > >=20 > > For udev it would be something like: > > udev_device_get_parent_with_subsystem_devtype(..., "serio", NULL); > >=20 > > To find the first parent device which is a device on the "serio" bus. >=20 > I saw your other mail the moment after I sent mine... >=20 > I'll wait for Martin's comments but at the moment I'm thinking > it might be easier and cleaner with the seperate utility > and a rule for SUBSYSTEM=3D"serio". Because, on second thought, > in theory there could be keys which need the force_release quirk > but no keycode remapping? No idea if that's the case in practice, > and it could be handled with a dummy keycode assignment, but > that's unclean. Maybe >=20 > ./force_release /sys/devices/platform/i8042/serio0 samsung-other-force-= release >=20 > with samsung-other-force-release looking like >=20 > 0x82 # Fn+F4 CRT/LCD (high keycode: "displaytoggle") > 0x83 # Fn+F2 > 0x84 # Fn+F5 backlight on/off > ... >=20 > and rules like >=20 > ACTION!=3D"add", GOTO=3D"force_release_end" > SUBSYSTEM!=3D"serio", GOTO=3D"force_release_end" > KERNEL!=3D"serio*", GOTO=3D"force_release_end" > DRIVERS!=3D"atkbd", GOTO=3D"force_release_end" >=20 > ENV{DMI_VENDOR}=3D"[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product= _name}=3D"*N130*", RUN+"force_release $sys$devname samsung-other-force-rele= ase" >=20 > LABEL=3D"force_release_end" >=20 > Would that work? > Yes, I would go with separate utilities and separate maps. They are conceptually different, work on different devices and map is not necessarily the same. It will be much cleaner this way. --=20 Dmitry