Re: [PATCH 2/2] eeepc-laptop: Use standard interfaces

From: Henrique de Moraes Holschuh
Date: Mon Aug 04 2008 - 17:21:30 EST


On Mon, 04 Aug 2008, Matthew Garrett wrote:
> On Mon, Aug 04, 2008 at 07:53:38PM +0200, Ivo van Doorn wrote:
> > On Monday 04 August 2008, Matthew Garrett wrote:
> > > eeepc-laptop currently only sends key events via ACPI and has
> > > non-standard rfkill control. Add an input device and use the rfkill
> > > infrastructure.
> > >
> > > Signed-off-by: Matthew Garrett <mjg@xxxxxxxxxx>
> >
> > Please use the rfkill_force_state() to report state changes,
> > that will ensure that the events are immediately send to the
> > rfkill layer.
>
> Why does writing to the sysfs file not generate an update implicitly?

It does. rfkill_force_state() is used to propagate state changes done by
outside sources back into rfkill. All internal changes caused by rfkill or
known to rfkill are dealt with by rfkill itself.

If there are no such outside sources, you don't need rfkill_force_state() or
get_state() at all, as long as you set rfkill->state properly before you
call rfkill_register.

BTW: if it has a hardware rfkill switch that overrides the rfkill
controller, that DOES count as an outside source of changes.

--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/