linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gregor Riepl <onitake@gmail.com>
To: linux-input@vger.kernel.org
Subject: Re: How to use ACPI for touchscreen
Date: Tue, 1 Mar 2016 11:02:47 +0100	[thread overview]
Message-ID: <56D568C7.20203@gmail.com> (raw)
In-Reply-To: <CA+V1LzqohgdNChrBUO+VqUiPD-9gPGvSCiu0t3L7aUk5dRyD1w@mail.gmail.com>

Hi Serge,

> Howto use ACPI for touchscreen:
>
>   1) is it possible to detect via ACPI GPIO pin to INT/WAKE Touch?
>    2) If yes how to find out equivalent of this gpio pin in
> /sys/class/gpio? (to have userspace interface to it via export
> gpioPINNUMBER> /sys/class/gpio/export
> 3) From the bellow DSDT table touch is dependant from I2C5  while
> i2c-dev creates devices i2c-0...i2c-4. Does this mean that in ACPI
> base is 1 and I2C5 is identical to i2c-4 dev ?

In a kernel driver, you don't have to do all of this yourself, as the kernel
will take care of ACPI parsing and device configuration when you request it.

If your driver lives in user space, you need to do this mapping yourself.

This is all the relevant information:

>                        I2cSerialBus (0x0030, ControllerInitiated, 0x00061A80,
>                             AddressingMode7Bit, "\\_SB.I2C4",
>                             0x00, ResourceConsumer, ,
>                             )
>                         Interrupt (ResourceConsumer, Level,
> ActiveHigh, Exclusive, ,, )
>                         {
>                             0x00000044,
>                         }
>                         GpioIo (Exclusive, PullDefault, 0x0000,
> 0x0000, IoRestrictionOutputOnly,
>                             "\\_SB.GPO1", 0x00, ResourceConsumer, ,
>                             )
>                             {   // Pin list
>                                 0x001A
>                             }
>     

Device on I2C address 0x30 (with 7-bit addressing), on I2C controller I2C4
(not I2C5, I believe this dependency is a bug in the DSDT entry of many
touchscreen devices), speed 400kHz.
One IRQ line (pin number 0x44), high level triggered. This maps directly to
the physical pin on Baytrail AFAIK. I'm not sure how to access it from user
space. Perhaps GPIO works, and perhaps it's not needed at all if you do polling.
One output GPIO pin, number 0x1a on GPO1 with default pullup settings. This is
most likely the "wakeup" pin on the controller.

I don't quite remember how the GPIO pin mapping works on Baytrail. Usually,
each "chip" has a base pin number, and the pin number from the DSDT entry is
added to that. Maybe check all /sys/class/gpio/gpiochip*/label entries and see
if you can find GPO1? You can then map the logical pin number (base + 0x1a)
using /sys/class/gpio/export


  reply	other threads:[~2016-03-01 10:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-28 22:30 How to use ACPI for touchscreen sergk sergk2mail
2016-03-01 10:02 ` Gregor Riepl [this message]
2016-03-01 16:30   ` sergk sergk2mail
2016-03-01 16:55     ` sergk sergk2mail
2016-03-02 17:52       ` Dmitry Torokhov
2016-03-02 18:13         ` sergk sergk2mail
2016-03-02 18:25           ` Gregor Riepl
2016-03-02 19:00             ` sergk sergk2mail
2016-03-02 19:01               ` sergk sergk2mail
2016-03-02 19:11               ` sergk sergk2mail
2016-03-02 21:19           ` Dmitry Torokhov
2016-03-02 23:01             ` sergk sergk2mail
2016-03-13  0:15               ` sergk sergk2mail
2016-03-01 22:32   ` sergk sergk2mail
2016-03-01 22:56     ` Gregor Riepl
2016-03-02 12:50       ` sergk sergk2mail
2016-03-02 13:07         ` Gregor Riepl
2016-03-02 15:17           ` sergk sergk2mail
2016-03-02 16:49             ` Gregor Riepl
2016-03-02 15:56           ` sergk sergk2mail

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=56D568C7.20203@gmail.com \
    --to=onitake@gmail.com \
    --cc=linux-input@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 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).