All of lore.kernel.org
 help / color / mirror / Atom feed
* How to setup Touchscreen IRQ mode?
@ 2016-03-21  0:43 sergk sergk2mail
  2016-03-21  0:51 ` Gregor Riepl
  0 siblings, 1 reply; 10+ messages in thread
From: sergk sergk2mail @ 2016-03-21  0:43 UTC (permalink / raw)
  To: linux-input

Hi Gurus of linux-input!
Please help with setuping IRQ mode for touchscreen.
It is declared http://linux-sunxi.org/Touchscreen#General_information
the following:
 "In Interrupt mode every time an event on the touchscreen occurs the
INT pin triggers and notifies the CPU. the cpu then read the new event
from the touchscreen"

Could someone please explain the logic (details) howto process IRQ for
touchscreen.

Input info: have initialized successfully TS and loaded its firmware,
standard registers output correct data!
in ACPI irq is 0x44. i2cbus 3, address is 0x30.

Do not know wakeup pin, actually TS available without any gpios for
loading firmware and reading from it.

What was done by myself:

I have registered irq in such way:
//handler

static irqreturn_t icn85xx_ts_interrupt(int irq, void *dev_id){
    struct icn85xx_ts_data *icn85xx_ts = dev_id;

    printk("==========------icn85xx_ts TS Interrupt-----===========\n");
return 0;
}

err = request_irq(icn85xx_ts->irq, icn85xx_ts_interrupt,
IRQ_TYPE_EDGE_FALLING, "icn85xx_ts", icn85xx_ts);
    if (err < 0){
        icn85xx_error("icn85xx_ts_probe: request irq failed\n");
        return err;
    }


As result have received this: (looks like no any occurrences of my
handler for irq 0x44  = dec: 68)

 cat /proc/interrupts
            CPU0       CPU1       CPU2       CPU3
  68:          0          0          0          0  BYT-GPIO   60  icn85xx_ts


Questions:

1) Does this correct IRQ settings for TS? If not - what is procedure?
What I have missed? H

2) What does mean BYT-GPIO 60 in cat /proc/interrupts?
I could not obtain gpio 60 via gpio_request(60, "TS_INT");

3) how it could be in code example setuping irq with gpio for touch?
Is this so:

 a) obtain gpio
 b) setup gpio to in direction
 c) request irg

4) How to find out gpio for setuping irq having decoded ACPI
DSDT,working Android and Windows with this touch.

Kind regards,
                Serge Kolotylo.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How to setup Touchscreen IRQ mode?
  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
  0 siblings, 1 reply; 10+ messages in thread
From: Gregor Riepl @ 2016-03-21  0:51 UTC (permalink / raw)
  To: sergk sergk2mail, linux-input

> err = request_irq(icn85xx_ts->irq, icn85xx_ts_interrupt,
> IRQ_TYPE_EDGE_FALLING, "icn85xx_ts", icn85xx_ts);
>     if (err < 0){
>         icn85xx_error("icn85xx_ts_probe: request irq failed\n");
>         return err;
>     }
> 
> 1) Does this correct IRQ settings for TS? If not - what is procedure?
> What I have missed? H

I recommend using devm_request_threaded_irq instead.
The devm_* functions take care of deallocation automatically, and a threaded
IRQ handler is much better for slow operations like I2C access IMHO.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How to setup Touchscreen IRQ mode?
  2016-03-21  0:51 ` Gregor Riepl
@ 2016-03-27  0:05   ` sergk sergk2mail
  2016-03-29  9:52     ` Mika Westerberg
  0 siblings, 1 reply; 10+ messages in thread
From: sergk sergk2mail @ 2016-03-27  0:05 UTC (permalink / raw)
  To: Gregor Riepl, Mika Westerberg, benjamin.tissoires; +Cc: linux-input

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

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


Thanks in advance for your help!

Regards,
                 Serge Kolotylo.

On Mon, Mar 21, 2016 at 12:51 AM, Gregor Riepl <onitake@gmail.com> wrote:
>> err = request_irq(icn85xx_ts->irq, icn85xx_ts_interrupt,
>> IRQ_TYPE_EDGE_FALLING, "icn85xx_ts", icn85xx_ts);
>>     if (err < 0){
>>         icn85xx_error("icn85xx_ts_probe: request irq failed\n");
>>         return err;
>>     }
>>
>> 1) Does this correct IRQ settings for TS? If not - what is procedure?
>> What I have missed? H
>
> I recommend using devm_request_threaded_irq instead.
> The devm_* functions take care of deallocation automatically, and a threaded
> IRQ handler is much better for slow operations like I2C access IMHO.
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How to setup Touchscreen IRQ mode?
  2016-03-27  0:05   ` sergk sergk2mail
@ 2016-03-29  9:52     ` Mika Westerberg
  2016-03-29 12:52       ` sergk sergk2mail
       [not found]       ` <CA+V1LzqzMyxoAQv=DDFvWr_MOTThVnhJwTt8uS_piwVhGJtWgQ@mail.gmail.com>
  0 siblings, 2 replies; 10+ messages in thread
From: Mika Westerberg @ 2016-03-29  9:52 UTC (permalink / raw)
  To: sergk sergk2mail; +Cc: Gregor Riepl, benjamin.tissoires, linux-input

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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How to setup Touchscreen IRQ mode?
  2016-03-29  9:52     ` Mika Westerberg
@ 2016-03-29 12:52       ` sergk sergk2mail
       [not found]       ` <CA+V1LzqzMyxoAQv=DDFvWr_MOTThVnhJwTt8uS_piwVhGJtWgQ@mail.gmail.com>
  1 sibling, 0 replies; 10+ messages in thread
From: sergk sergk2mail @ 2016-03-29 12:52 UTC (permalink / raw)
  To: Mika Westerberg; +Cc: Gregor Riepl, benjamin.tissoires, linux-input

Hi Mika!
Glad to see you here!
1st - have finished yesterday protorype of polling mode kernel space
driver - it works - all parameters i2c-bus, i2c addr, registers, gpios
just setuped manually! not sure that gpio pin I guessed (393 - this
one is really used on my Chuwi Vi8 Z3735 with Silead 1680 TS, but we
are discovering Chuwi Vi10 Z3736 with Chipone icn8528 TS) with
enumerating all untill screen is blank off/on has influence to
anything.

Regarding i2c-hid - it even does not load i2c-hid module! moreover
loading it = nothing changes!
Also it will be cool if you in this case explain or reference what is
the difference in code between using i2c-hid and ordinary ACPI i2c TS.
below is skeleton for ACPI i2c TS driver, that did not provide nothing
(irq, i2c addr, gpios)!

regarding ACPI and IRQ: The story is the same as it was for Teclast -
there is nothing automatically detected via i2c, I have described it
here with providing ACPI skeleton:
https://www.spinics.net/lists/linux-i2c/msg23467.html

Some summary extractions:

========================================================
According kernel Documentation I have created such skeleton:


#define DEVICE_NAME  "testme"

static const struct acpi_device_id icn_ts_acpi_match[] = {
    { "CHPN0001", 0 },
    { "PNP05C0", 0 },
    { },
};
MODULE_DEVICE_TABLE(acpi, icn_ts_acpi_match);


static int ts_probe(struct i2c_client *client, const struct i2c_device_id *id){
    printk("Hello from %s",__func__);

    printk(&client->dev, "%s: got a device named %s at address 0x%x,
IRQ %d, flags 0x%x\n", __func__, client->name, client->addr,
client->irq, client->flags);

return 0;
}

static struct i2c_driver icn_ts_driver = {
    .probe = ts_probe,
    .remove = ts_remove,
    .id_table = ts_i2c_id,
    .driver = {
        .name = DEVICE_NAME,
        .owner = THIS_MODULE,
        .acpi_match_table = ACPI_PTR(icn_ts_acpi_match),

    },
};

static const struct i2c_device_id ts_i2c_id[] = {
    { DEVICE_NAME, 0 },
    { }
};
MODULE_DEVICE_TABLE(i2c, gsl_ts_i2c_id);


module_i2c_driver(icn_ts_driver);

===============================================


As result - nothing until I create i2c device with the name testme. I
am using user space way from kernel doc: echo testme 0x30 >
/sys/bus/i2c/devices/i2c-3/new_device.

ONLY AFTER this (Creating i2c device) I receive output from .probe function.
And as result I do NOT receive NOTHING ACPI related because i2c device
was created manually and all information is taken from my manual
created dev (bus address and bus number), no irq - nothing while DSDT
HAS THIS INFO!




Exploring sysfs shows:

ls -l /sys/bus/acpi/devices/CHPN0001:00
lrwxrwxrwx 1 root root 0 Mar 15 22:08
/sys/bus/acpi/devices/CHPN0001:00 ->
../../../devices/LNXSYSTM:00/LNXSYBUS:00/80860F41:03/CHPN0001:00
root@archiso ~ # cat /sys/bus/acpi/devices/CHPN0001:00/status
0

status is 0 - what does this mean? It is detected via ACPI but not present?
What does "LNXSYBUS:00/80860F41:03"  means?  Does it mean i2c-3, 0x41
?  80860F41:03 == ?

also inside its subfolders I do not see nothing useful:

cat /sys/bus/acpi/devices/CHPN0001:00/adr
0x00000000
root@archiso ~ # cat /sys/bus/acpi/devices/CHPN0001:00/hid
CHPN0001
root@archiso ~ # cat /sys/bus/acpi/devices/CHPN0001:00/modalias
acpi:CHPN0001:PNP0C50:
root@archiso ~ # cat /sys/bus/acpi/devices/CHPN0001:00/path
\_SB_.I2C4.TCS5
root@archiso ~ # cat /sys/bus/acpi/devices/CHPN0001:00/uevent
MODALIAS=acpi:CHPN0001:PNP0C50:
root@archiso ~ # cat /sys/bus/acpi/devices/CHPN0001:00/power/runtime_usage
0
root@archiso ~ # cat /sys/bus/acpi/devices/CHPN0001:00/power/control
auto
root@archiso ~ # cat /sys/bus/acpi/devices/CHPN0001:00/power/runtime_enabled
disabled

So the question is the same - how to obtain via acpi in mentioned
above code i2cbus, bus addr and irq for this touch?

Thanks in advance,
Kind regards,
                        Serge Kolotylo.

On Tue, Mar 29, 2016 at 9:52 AM, Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:
> 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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How to setup Touchscreen IRQ mode?
       [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
  0 siblings, 2 replies; 10+ messages in thread
From: sergk sergk2mail @ 2016-03-30  0:03 UTC (permalink / raw)
  To: Mika Westerberg, linux-input, benjamin.tissoires, Gregor Riepl

Hi Mika,
 full acpidump of the machine is located here
https://gitlab.com/SergK/icn8528/blob/master/DSDT/dsdt.dsl

>From Android:
"What does 'ls -l /sys/bus/i2c/devices' show under android?"
1) sysi2cdev  /sys/bus/i2c/devices
https://gitlab.com/SergK/icn8528/blob/master/Androiddata/sysi2cdev

2) sysbusacpidev - /sys/bus/acpi/devices
https://gitlab.com/SergK/icn8528/blob/master/Androiddata/sysbusacpidev

there is no nothing with CHPN0001 as it is under vanilla linux 4.2.2

3) Dmesg  https://gitlab.com/SergK/icn8528/blob/master/Androiddata/andrdmesg
please note - there is also in it focal_tech mention - it strange but
the guys from Chuwi declared every possible variant in sysfs and  only
that is present in tablet revision (my is rev11 with chipone
icn8528.h) is initialized through corresponding linux module.

<6> : input: chipone-ts as /devices/virtual/input/input3
>> cat /devices/virtual/input/input3/modalias gives
>>
>> input:b000v0000p0000e0000-e0,1,3,k8B,9E,D9,ra2F,30,32,35,36,39,m1sfw
>> - I guess the key is m1sfw which means loaded firmware.

4) /proc/bus/input/devices
https://gitlab.com/SergK/icn8528/blob/master/Androiddata/procbusinputdevices

Kind regards,
                      Serge Kolotylo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How to setup Touchscreen IRQ mode?
  2016-03-30  0:03               ` sergk sergk2mail
@ 2016-03-30  0:09                 ` sergk sergk2mail
  2016-03-30  9:41                 ` Mika Westerberg
  1 sibling, 0 replies; 10+ messages in thread
From: sergk sergk2mail @ 2016-03-30  0:09 UTC (permalink / raw)
  To: Mika Westerberg, linux-input, benjamin.tissoires, Gregor Riepl

Sorry forgotten to add: Windows driver for TS reports that ACPI CHPN0001 device!
I have both Win 8 and Androis on my Chuwi Vi10 with this icn8528 TS.
Regards,
                   Serge.

On Wed, Mar 30, 2016 at 12:03 AM, sergk sergk2mail
<sergk.admin@gmail.com> wrote:
> Hi Mika,
>  full acpidump of the machine is located here
> https://gitlab.com/SergK/icn8528/blob/master/DSDT/dsdt.dsl
>
> From Android:
> "What does 'ls -l /sys/bus/i2c/devices' show under android?"
> 1) sysi2cdev  /sys/bus/i2c/devices
> https://gitlab.com/SergK/icn8528/blob/master/Androiddata/sysi2cdev
>
> 2) sysbusacpidev - /sys/bus/acpi/devices
> https://gitlab.com/SergK/icn8528/blob/master/Androiddata/sysbusacpidev
>
> there is no nothing with CHPN0001 as it is under vanilla linux 4.2.2
>
> 3) Dmesg  https://gitlab.com/SergK/icn8528/blob/master/Androiddata/andrdmesg
> please note - there is also in it focal_tech mention - it strange but
> the guys from Chuwi declared every possible variant in sysfs and  only
> that is present in tablet revision (my is rev11 with chipone
> icn8528.h) is initialized through corresponding linux module.
>
> <6> : input: chipone-ts as /devices/virtual/input/input3
>>> cat /devices/virtual/input/input3/modalias gives
>>>
>>> input:b000v0000p0000e0000-e0,1,3,k8B,9E,D9,ra2F,30,32,35,36,39,m1sfw
>>> - I guess the key is m1sfw which means loaded firmware.
>
> 4) /proc/bus/input/devices
> https://gitlab.com/SergK/icn8528/blob/master/Androiddata/procbusinputdevices
>
> Kind regards,
>                       Serge Kolotylo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How to setup Touchscreen IRQ mode?
  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
  1 sibling, 1 reply; 10+ messages in thread
From: Mika Westerberg @ 2016-03-30  9:41 UTC (permalink / raw)
  To: sergk sergk2mail; +Cc: linux-input, benjamin.tissoires, Gregor Riepl

On Wed, Mar 30, 2016 at 12:03:13AM +0000, sergk sergk2mail wrote:
> Hi Mika,
>  full acpidump of the machine is located here
> https://gitlab.com/SergK/icn8528/blob/master/DSDT/dsdt.dsl

OK, so there is only one touchscreen device and it has _STA method
looking like this:

	Method (_STA, 0, NotSerialized)  // _STA: Status
	{
		If ((OSSL & 0x80))
		{
			Return (Zero)
		}	

My guess is that that OSSL variable tells if the machine is in Android
or Windows mode or something like that. In your case it returns zero
here.

> >From Android:
> "What does 'ls -l /sys/bus/i2c/devices' show under android?"
> 1) sysi2cdev  /sys/bus/i2c/devices
> https://gitlab.com/SergK/icn8528/blob/master/Androiddata/sysi2cdev

And this explains why Android works. It initializes the I2C devices
directly from a board file.

So what you are doing probably works but instead of hardcoding in the
driver you can fill i2c_board_info from "platform specific" files like
for example here:

	arch/x86/platform/intel-mid/device_libs/platform_mpu3050.c

Translating the _CRS from ACPI TCS5 device it might look like:

	static const struct i2c_hid_platform_data pdata = {
		.hid_descriptor_address = 3, // from _DSM
	};

	static const struct i2c_board_info my_board_info[] = {
		{
			I2C_BOARD_INFO("hid", 0x30"),
			.irq = 0x44,
			.platform_data = &pdata,
		},
	};

	static int __init my_init(void)
	{
		i2c_register_board_info(3, my_board_info, ARRAY_SIZE(my_board_info));
	} 
	arch_initcall(my_init);

This should create new i2c device for i2c-hid.c.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How to setup Touchscreen IRQ mode?
  2016-03-30  9:41                 ` Mika Westerberg
@ 2016-03-30 10:28                   ` sergk sergk2mail
  2016-03-30 11:03                     ` Mika Westerberg
  0 siblings, 1 reply; 10+ messages in thread
From: sergk sergk2mail @ 2016-03-30 10:28 UTC (permalink / raw)
  To: Mika Westerberg; +Cc: linux-input, benjamin.tissoires, Gregor Riepl

Hi Mika,

"This should create new i2c device for i2c-hid.c."
Ok - provided code registered platform device, looks like hid device
and what will be next then? where and how will be setuped irq mode for
touchscreen? the problem was from the begining - I could not setup irq
for this touch due absence of gpio or the way of puting it into irq
mode.

Kind regards,
                     Serge Kolotylo.


On Wed, Mar 30, 2016 at 9:41 AM, Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:
> On Wed, Mar 30, 2016 at 12:03:13AM +0000, sergk sergk2mail wrote:
>> Hi Mika,
>>  full acpidump of the machine is located here
>> https://gitlab.com/SergK/icn8528/blob/master/DSDT/dsdt.dsl
>
> OK, so there is only one touchscreen device and it has _STA method
> looking like this:
>
>         Method (_STA, 0, NotSerialized)  // _STA: Status
>         {
>                 If ((OSSL & 0x80))
>                 {
>                         Return (Zero)
>                 }
>
> My guess is that that OSSL variable tells if the machine is in Android
> or Windows mode or something like that. In your case it returns zero
> here.
>
>> >From Android:
>> "What does 'ls -l /sys/bus/i2c/devices' show under android?"
>> 1) sysi2cdev  /sys/bus/i2c/devices
>> https://gitlab.com/SergK/icn8528/blob/master/Androiddata/sysi2cdev
>
> And this explains why Android works. It initializes the I2C devices
> directly from a board file.
>
> So what you are doing probably works but instead of hardcoding in the
> driver you can fill i2c_board_info from "platform specific" files like
> for example here:
>
>         arch/x86/platform/intel-mid/device_libs/platform_mpu3050.c
>
> Translating the _CRS from ACPI TCS5 device it might look like:
>
>         static const struct i2c_hid_platform_data pdata = {
>                 .hid_descriptor_address = 3, // from _DSM
>         };
>
>         static const struct i2c_board_info my_board_info[] = {
>                 {
>                         I2C_BOARD_INFO("hid", 0x30"),
>                         .irq = 0x44,
>                         .platform_data = &pdata,
>                 },
>         };
>
>         static int __init my_init(void)
>         {
>                 i2c_register_board_info(3, my_board_info, ARRAY_SIZE(my_board_info));
>         }
>         arch_initcall(my_init);
>
> This should create new i2c device for i2c-hid.c.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: How to setup Touchscreen IRQ mode?
  2016-03-30 10:28                   ` sergk sergk2mail
@ 2016-03-30 11:03                     ` Mika Westerberg
  0 siblings, 0 replies; 10+ messages in thread
From: Mika Westerberg @ 2016-03-30 11:03 UTC (permalink / raw)
  To: sergk sergk2mail; +Cc: linux-input, benjamin.tissoires, Gregor Riepl

On Wed, Mar 30, 2016 at 10:28:14AM +0000, sergk sergk2mail wrote:
> "This should create new i2c device for i2c-hid.c."
> Ok - provided code registered platform device, looks like hid device
> and what will be next then? where and how will be setuped irq mode for
> touchscreen? the problem was from the begining - I could not setup irq
> for this touch due absence of gpio or the way of puting it into irq
> mode.

It will create an I2C device for you with the ->irq assigned so
i2c-hid.c should be happy. At least worth a try.

It may be that the interrupt number needs to be passed through
acpi_register_gsi() if it does not work.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-03-30 11:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.