All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
To: frank.salomon@wincor-nixdorf.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: EV_MSC / driver/input/input.c (Input Handler)
Date: Thu, 8 Feb 2007 10:15:16 -0500	[thread overview]
Message-ID: <d120d5000702080715u2902bc81oda4b9250892a1bf2@mail.gmail.com> (raw)
In-Reply-To: <45CAE5A1.80409@wincor-nixdorf.com>

On 2/8/07, Frank Salomon <frank.salomon@wincor-nixdorf.com> wrote:
> Hi All,
>
> I had written an additional input_handler :
>
>      static struct input_device_id pcraw_ids[] = {
>             {
>                      .flags = INPUT_DEVICE_ID_MATCH_EVBIT,
>                      .evbit = { BIT(EV_MSC) },
>              },
>             { },    /* Terminating entry */
>      };
>
> to get MSC_RAW events from the atkeyboard :
>
>      input_event (&atkbd->dev, EV_MSC, MSC_RAW, code)
>
> But I only get these events :
>
>      input_event(&atkbd->dev, EV_MSC, MSC_SCAN, code);
>

That is because by default atkbd uses software-emulated raw mode.
bootk with atkbd.softraw=0 or switch it off after boot through sysfs
attribute to get EV_MSC/MSC_RAW passed through).

> I know the reason is in driver/input/input.c :
>
>      case EV_MSC:
>           if (code > MSC_MAX || !test_bit(code, dev->mscbit))
>                return;
>
>           if (dev->event) dev->event(dev, type, code, value);
>           break;
>
> because of (driver/input/keyboard/atkbd.c):
>
>      atkbd->dev.mscbit[0] = atkbd->softraw ? BIT(MSC_SCAN) :
>           BIT(MSC_RAW) | BIT(MSC_SCAN);
>
> I would like to change driver/input/input.c like this :
>
>      case EV_MSC:
>           if (code > MSC_MAX)
>                return;
>
>           if (test_bit(code, dev->mscbit))
>                if (dev->event) dev->event(dev, type, code, value);
>           break;
>
> Any comments ? Maybe I misunderstand the concept of the input events. In
> that case, please give me a short description or let me know were I can
> find any documentation.
>

No, input core should not pass any events device did not claim to support.

What are you trying to do though? Why are you interested in raw atkbd
events? What will your handler do with events from other input devices
that might emit raw events?

-- 
Dmitry

  reply	other threads:[~2007-02-08 15:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-08  8:56 EV_MSC / driver/input/input.c (Input Handler) Frank Salomon
2007-02-08 15:15 ` Dmitry Torokhov [this message]
2007-02-09  7:15   ` Frank Salomon
2007-02-09 14:36     ` Dmitry Torokhov

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=d120d5000702080715u2902bc81oda4b9250892a1bf2@mail.gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=frank.salomon@wincor-nixdorf.com \
    --cc=linux-kernel@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.