* How to choeck for a gpio-keys based switch state?
@ 2009-05-15 15:47 Janusz Krzysztofik
2009-05-15 18:58 ` Dmitry Torokhov
0 siblings, 1 reply; 3+ messages in thread
From: Janusz Krzysztofik @ 2009-05-15 15:47 UTC (permalink / raw)
To: linux-input
Hi,
Greetings from new list member.
I am trying to create a gpio-keys based platform device driver for a
hook switch. I am wondering if there is a possibility to check for the
switch state before the first event comes up. I think this feature could
be essential for correct user experience - an application should know
the switch state from the start.
As I am not able to find such functionality in the current gpio-keys
driver, I wonder if this could be done over gpiolib sysfs interface by
adding optional gpio_export() call to the driver init function. I can
try to provide a patch if this sounds reasonable to you.
Thanks,
Janusz
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to choeck for a gpio-keys based switch state?
2009-05-15 15:47 How to choeck for a gpio-keys based switch state? Janusz Krzysztofik
@ 2009-05-15 18:58 ` Dmitry Torokhov
2009-05-16 8:30 ` Janusz Krzysztofik
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2009-05-15 18:58 UTC (permalink / raw)
To: postmaster; +Cc: linux-input
Hi Janusz,
On Fri, May 15, 2009 at 05:47:55PM +0200, Janusz Krzysztofik wrote:
> Hi,
>
> Greetings from new list member.
>
> I am trying to create a gpio-keys based platform device driver for a
> hook switch. I am wondering if there is a possibility to check for the
> switch state before the first event comes up. I think this feature could
> be essential for correct user experience - an application should know
> the switch state from the start.
> As I am not able to find such functionality in the current gpio-keys
> driver, I wonder if this could be done over gpiolib sysfs interface by
> adding optional gpio_export() call to the driver init function. I can
> try to provide a patch if this sounds reasonable to you.
>
Your application should use EVIOCGSW ioctl to query the initial state of
the switches.
--
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to choeck for a gpio-keys based switch state?
2009-05-15 18:58 ` Dmitry Torokhov
@ 2009-05-16 8:30 ` Janusz Krzysztofik
0 siblings, 0 replies; 3+ messages in thread
From: Janusz Krzysztofik @ 2009-05-16 8:30 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input
Hi Dimitry,
Thanks for you answer.
Friday 15 May 2009 20:58:06 you wrote:
> Your application should use EVIOCGSW ioctl to query the initial state of
> the switches.
I see. Is this ioctl query the only way of getting a switch state from
userspace? Do you know of a utility that could be used from a shell script to
check for the state?
Or maybe you could suggest a different approach, better than using gpio-keys
for the purpose of driving a phone hook switch? Maybe something like rfkill
device, that exposes its state over sysfs in addition to providing input
events, would be better for this purpose?
Thanks,
Janusz
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-05-16 8:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-15 15:47 How to choeck for a gpio-keys based switch state? Janusz Krzysztofik
2009-05-15 18:58 ` Dmitry Torokhov
2009-05-16 8:30 ` Janusz Krzysztofik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).