All of lore.kernel.org
 help / color / mirror / Atom feed
From: dmitry.torokhov@gmail.com (Dmitry Torokhov)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [PATCH] updated hdaps driver.
Date: Wed, 14 Sep 2005 01:24:33 +0000	[thread overview]
Message-ID: <d120d50005091316235912bcf9@mail.gmail.com> (raw)
In-Reply-To: <1126555518797@kroah.com>

On 9/12/05, Greg KH <gregkh@suse.de> wrote:

> +static void hdaps_mousedev_enable(void)
> +{
> +       down(&hdaps_sem);
> +
> +       /* calibrate the device before enabling */
> +       hdaps_calibrate();
> +
> +       /* initialize the input class */
> +       init_input_dev(&hdaps_idev);
> +       hdaps_idev.dev = &pdev->dev;
> +       hdaps_idev.evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
> +       hdaps_idev.relbit[0] = BIT(REL_X) | BIT(REL_Y);
> +       hdaps_idev.keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT);
> +       input_register_device(&hdaps_idev);
> +

I do not see the device ever reporting BTN_LEFT, why is its presence advertised?

> +
> +/*
> + * hdaps_mousedev_disable - disable the input class device.  Caller must hold
> + * hdaps_sem.
> + */
> +static void hdaps_mousedev_disable(void)
> +{
> +       down(&hdaps_sem);

Bad comment. The function itself holds the semaphore.

> +
> +       if (hdaps_mousedev)
> +               hdaps_mousedev_enable();
> +

Please consider converting the input device to an absolute device
(reporting ABS_X/ABS_Y). This way it will be bound to a joystick
interface (/dev/input/jsX) and won't mess your /dev/input/mice so you
won't have to fiddle with enabling/disabling and will be able to have
the device turned on unconditionally.

-- 
Dmitry

      reply	other threads:[~2005-09-14  1:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-12 22:10 [lm-sensors] [PATCH] updated hdaps driver Greg KH
2005-09-14  1:24 ` Dmitry Torokhov [this message]

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=d120d50005091316235912bcf9@mail.gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=lm-sensors@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.