From: Matthew Garrett <mjg59@srcf.ucam.org>
To: AceLan Kao <acelan.kao@canonical.com>
Cc: platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH] dell-laptop: support Synaptics/Alps touchpad led
Date: Thu, 18 Aug 2011 20:36:27 +0100 [thread overview]
Message-ID: <20110818193626.GA12449@srcf.ucam.org> (raw)
In-Reply-To: <1313658248-6964-1-git-send-email-acelan.kao@canonical.com>
On Thu, Aug 18, 2011 at 05:04:08PM +0800, AceLan Kao wrote:
> +static void dell_touchpadled_on()
> +{
> + while (inb(0x64) & 0x02)
> + msleep(20);
> + outb(0x97, 0x64);
> +
> + while (inb(0x64) & 0x02)
> + msleep(20);
> + outb(1, 0x60);
> +
> + touchpad_led_status = 1;
> +}
No. You're hitting the keyboard controller without any coordination with
the i8042 driver. What happens if the user hits a key while you're in
the middle of this?
> + * Called for each KEY_F22 key press event.
> + */
> +static void dell_touchpadled_update(struct work_struct *work)
> +{
> + touchpad_led_status = 1 - touchpad_led_status;
> +
> + if (touchpad_led_status == 1)
> + dell_touchpadled_on();
> + else
> + dell_touchpadled_off();
> +}
No, this should be handled in userspace. Expose the LED via the LED
class and have gnome-settings-daemon (or equivalent) coordinate the
policy - otherwise you'll end up with situations where userspace and the
LED state are out of sync.
--
Matthew Garrett | mjg59@srcf.ucam.org
next prev parent reply other threads:[~2011-08-18 19:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-18 9:04 [PATCH] dell-laptop: support Synaptics/Alps touchpad led AceLan Kao
2011-08-18 19:36 ` Matthew Garrett [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-10-04 5:28 AceLan Kao
2011-10-04 8:25 ` AceLan Kao
2011-10-12 8:04 ` AceLan Kao
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=20110818193626.GA12449@srcf.ucam.org \
--to=mjg59@srcf.ucam.org \
--cc=acelan.kao@canonical.com \
--cc=platform-driver-x86@vger.kernel.org \
/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.