All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: sergk sergk2mail <sergk.admin@gmail.com>
Cc: Gregor Riepl <onitake@gmail.com>,
	benjamin.tissoires@redhat.com, linux-input@vger.kernel.org
Subject: Re: How to setup Touchscreen IRQ mode?
Date: Tue, 29 Mar 2016 12:52:44 +0300	[thread overview]
Message-ID: <20160329095244.GI2099@lahna.fi.intel.com> (raw)
In-Reply-To: <CA+V1Lzph-W2eXhp22_jjObeu-ywzO===9EYWkKccuGuvdJDYRg@mail.gmail.com>

On Sun, Mar 27, 2016 at 12:05:27AM +0000, sergk sergk2mail wrote:
> Hi Mika, Benjamin, Antonio.
> Kindly would like to invite all of you to this thread because it is
> very closely to http://www.spinics.net/lists/linux-input/msg35935.html
>  : About Goodix-TS on Bay Trail, and ACPI and interrupts
> Let me briefly summarize:
> 1) I have wrote driver that loads FW into the TS chip (icn8228), I am
> able to get polling mode, primary task at the moment is - to setup IRQ
> mode.
> 2) No ACPI, but at the moment I do not take care because just taken
> and guessed all info and passed it hardcoded in my prototype of the
> chipone driver. - later I will back to ACPI moment or if it is not
> possible to setup IRQ in 1) without 2 - priorities will be changed.
> 
> DSDT for chipone icn8528 on Chuwi Vi10 (Baytrail Z3736F) is
> here:http://www.spinics.net/lists/linux-i2c/msg23520.html

It claims to be I2C-HID compatible device so I think it should just use
i2c-hid.c which should handle setting up interrupt automatically. Not
sure about loading the firmware but I suppose it is the job of the
higher level HID driver who knows the details.

> Please assists with in setuping IRQ mode for TS driver, possible IRQ
> is gpio based.
> What I have obtained from Android:  SB_GPO1 : gpio base 102 - > this
> means that gpio controller is used!
> Looking for corresponding gpiochip inside Linux 4.2.2 kernel: I have
> discovered suitable (the same amount of ngpio) this one: chip382,
> label: INT33FC:01.
> Also guessing (enumerating all)  gpios via userspace kernel interface
> I have discovered that gpios: 393 and 391,392 - blank off/on
> touchscreen by setting /sys/class/gpio39X/value to 0/1.
> 
> Here is my draft debug code of the driver prototype for Chipone
> icn8528 and irq NOT setuped at the moment :(.
> I think it should be gpio based, in Android it is so:  cat /proc/interrupts
> 
> 389  29 3 0 0  VLV-GPIO-gpio icn85xx_ts.
> 
> Inside my code irq setuping:
> IRQ begin:
> https://gitlab.com/SergK/icn8528/blob/master/myicn.c#L1393
> 
> icn85xx_request_irq
> https://gitlab.com/SergK/icn8528/blob/master/myicn.c#L993

In order to use GPIO as interrupt you need to first request and
configure it like:

	struct gpio_desc *desc;
	int irq;
	
	desc = gpiod_get(dev, NULL, GPIOD_IN);
	irq = gpiod_to_irq(desc);

	request_irq(irq, ...);
	
But in you case, looking at the DSDT there is one Interrupt() resource
below the TCS5 device. That should be handled automatically by the I2C
core and filled in client->irq.

  reply	other threads:[~2016-03-29  9:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-21  0:43 How to setup Touchscreen IRQ mode? sergk sergk2mail
2016-03-21  0:51 ` Gregor Riepl
2016-03-27  0:05   ` sergk sergk2mail
2016-03-29  9:52     ` Mika Westerberg [this message]
2016-03-29 12:52       ` sergk sergk2mail
     [not found]       ` <CA+V1LzqzMyxoAQv=DDFvWr_MOTThVnhJwTt8uS_piwVhGJtWgQ@mail.gmail.com>
     [not found]         ` <20160329125642.GM2099@lahna.fi.intel.com>
     [not found]           ` <CA+V1Lzov4WXXjERAwAV03VdMEQKDC_=ADAgr2-0p-k=gYC8i3w@mail.gmail.com>
     [not found]             ` <20160329133307.GO2099@lahna.fi.intel.com>
2016-03-30  0:03               ` sergk sergk2mail
2016-03-30  0:09                 ` sergk sergk2mail
2016-03-30  9:41                 ` Mika Westerberg
2016-03-30 10:28                   ` sergk sergk2mail
2016-03-30 11:03                     ` Mika Westerberg

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=20160329095244.GI2099@lahna.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=linux-input@vger.kernel.org \
    --cc=onitake@gmail.com \
    --cc=sergk.admin@gmail.com \
    /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.