That's probably correct, depending on your exact understanding of what gpiod_get() does (which is to glue "-gpios" and "-gpio" onto the name you supply and look for a property of that name in your DT node, then parse the DT gpio description to end up with a descriptor).So if I create my own device driver, I am at liberty to specify my own configuration nodes, read the appropriate values from them, and then allocate and configure any GPIO pins as I require using appropriate api calls such as gpiod_get(). Is that a correct view?
That's largely correct, but a) be careful with your use of "gpio" - at this level, GPIO is just two (in and out) of the possible pin functions that can be selected - and b) it isn't the "victim" device driver that ends up doing the work, as you'll see in a moment.So am I right in thinking that it is using the overlay technique to insert its configuration nodes into the nodes of existing device drivers and using those to configure the gpio pins for it instead?
It's more accurate to say that the overlay gets the DT framework to request those pins from the pinctrl driver, on behalf of the leds driver (which doesn't know it is asking for them).In this case, it defines a vga666_pins nodes that contains the configuration of the GPIOs it requires, and inserts it into the nodes of the gpio driver for it to allocate them?
Essentially, yes. pinctrl states are mutually exclusive (and all the devices I've come across only use one state - "default"), and an overlay completely overwrites a property - it can't append to it (except for the magic "bootargs" string handling in the firmware). You could create an overlay that effectively appends its own pinctrl node to another devices by incorporating the original into its own, but it would have to assume what the other device had set it to, and it would break if the overlays were applied in the reverse order.But why must the "borrowed" led driver not already have a pinctrl in it - can there only be 1 pinctrl per device node?
The problem only arises if the overlay isn't creating a device node of its own, which is rare. There is almost certainly a driver which can be instantiated multiple times that claims no resources of its own - perhaps another instance of the gpio-leds driver but with no LEDs configured? No - that would return -ENODEV, but you get the idea.If there are 2 overlays that want to configure pinctrl, how can a clash or overuse of the LED driver node pinctrl be avoided?
As I think you've probably worked out by now, there is option 3 - get the standard pinctrl driver to request the pin functions you need on your behalf, without writing any code, just leaving any GPIO requesting and usage for your driver to do.So I assume a device driver writer has 2 choices when creating the dts-overlay file:
1. Overlay other platfrom device nodes with the required GPIO and pinctrl configurations and let them configure the GPIO pins on my behalf, or
2. Keep the configuration of such GPIOs in my own device node, but I must read and apply all the configuration of those GPIO pins within the driver's probe function.
At least you've confirmed my basic understanding is nearly there. Of course I can just copy/paste/adapt some other overlay, but I'm trying to understand what I'm doing so I do it right and some of it is still gobbledygook to me, but the fog is slowly lifting.
That's a better description than I've read previously! But yes, and then I have to configure the use of that gpio according to the properties that were supplied.PhilE wrote: ↑Thu Jan 31, 2019 2:15 pmThat's probably correct, depending on your exact understanding of what gpiod_get() does (which is to glue "-gpios" and "-gpio" onto the name you supply and look for a property of that name in your DT node, then parse the DT gpio description to end up with a descriptor).So if I create my own device driver, I am at liberty to specify my own configuration nodes, read the appropriate values from them, and then allocate and configure any GPIO pins as I require using appropriate api calls such as gpiod_get(). Is that a correct view?
Oh, ok.PhilE wrote: ↑Thu Jan 31, 2019 2:15 pmIt's more accurate to say that the overlay gets the DT framework to request those pins from the pinctrl driver, on behalf of the leds driver (which doesn't know it is asking for them).In this case, it defines a vga666_pins nodes that contains the configuration of the GPIOs it requires, and inserts it into the nodes of the gpio driver for it to allocate them?
So in the case where I am creating my own driver, I have my own device node in which I can put all the pinctrl stuff without having to hijack another device such as the LED driver.PhilE wrote: ↑Thu Jan 31, 2019 2:15 pmThe problem only arises if the overlay isn't creating a device node of its own, which is rare. There is almost certainly a driver which can be instantiated multiple times that claims no resources of its own - perhaps another instance of the gpio-leds driver but with no LEDs configured? No - that would return -ENODEV, but you get the idea.If there are 2 overlays that want to configure pinctrl, how can a clash or overuse of the LED driver node pinctrl be avoided?
So I still have to use API functions in my driver to request and configure my own GPIOs? I thought targetting the <gpios> with an overlay of "mydevice-pins" with their configuration would get the gpio driver to do this for me?PhilE wrote: ↑Thu Jan 31, 2019 2:15 pmAs I think you've probably worked out by now, there is option 3 - get the standard pinctrl driver to request the pin functions you need on your behalf, without writing any code, just leaving any GPIO requesting and usage for your driver to do.So I assume a device driver writer has 2 choices when creating the dts-overlay file:
1. Overlay other platfrom device nodes with the required GPIO and pinctrl configurations and let them configure the GPIO pins on my behalf, or
2. Keep the configuration of such GPIOs in my own device node, but I must read and apply all the configuration of those GPIO pins within the driver's probe function.
Exactly.So in the case where I am creating my own driver, I have my own device node in which I can put all the pinctrl stuff without having to hijack another device such as the LED driver.
You make it sound like it's a lot work. At one end, the pinctrl node will have configured those pins to be GPIOs, and at the other end your application needs a way of referring to and distinguishing the GPIOs which have been assigned to it in order to set their states (unless your GPIO usage is strictly static, start-of-day initialisation, but that has to be a relatively rare use case). By my reckoning you would need at least one API call to say "give me a handle to a GPIO with the specified role/index", which is exactly what devm_gpiod_get() does. By supplying the appropriate flags it will be configured as an input or output (driving high or low).So I still have to use API functions in my driver to request and configure my own GPIOs?
No, it's not, but I don't want to duplicate stuff I don't need to.
Code: Select all
/*
* Device tree overlay for Cypress Cy8c20466 Touchscreen
*
* Compile:
* dtc [email protected] -I dts -O dtb -o cypress.dtbo cypress.dts
*/
/dts-v1/;
/plugin/;
/{
/* Identify the RPi models this is compatible with (is this sufficient?) */
compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709";
/* Disable SPI - because DPI uses it? */
[email protected] {
target = <&spi0>;
__overlay__ {
status = "disabled";
};
};
/* There is no DPI driver module, but we need a platform device */
/* node (that doesn't already use pinctrl) to hang the pinctrl */
/* reference on - leds will do */
/* (Can I add these to my own pictrl for Cy8c20466 or cypress_pins?) */
[email protected] {
target = <&leds>;
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&dpi18_pins>;
};
};
/* Define a group of pins to be configured by the GPIO driver as function 6 = ALT2 = DPI mode */
[email protected] {
target = <&gpio>;
__overlay__ {
dpi18_pins: dpi18_pins {
brcm,pins = <0 1 2 3 4 5 6 7 8 9 12 13 14 15 16 17 20 21 22 23 24 25>;
brcm,function = <6>;
brcm,pull = <0>;
};
};
};
/* Create i2c-gpio driver instance for software i2c on gpio 10 & 11 as i2c-3. 4us delay for 100kHz */
/* Why is the node called [email protected] not [email protected]? */
[email protected] {
target-path = "/";
__overlay__ {
i2c_gpio: [email protected] {
compatible = "i2c-gpio";
gpios = <&gpio 10 0 /* sda */
&gpio 11 0 /* scl */
>;
i2c-gpio,delay-us = <4>;
#address-cells = <1>;
#size-cells = <0>;
};
};
};
/* Add the touchscreen controller as a device under i2c_gpio */
[email protected] {
target = <&i2c_gpio>;
__overlay__ {
/* needed to avoid dtc warning */
#address-cells = <1>;
#size-cells = <0>;
Cy8c20466: [email protected] {
compatible = "cypress,Cy8c20466";
reg = <0x5c>;
pinctrl-names = "default";
pinctrl-0 = <&cypress_pins>;
interrupt-parent = <&gpio>;
interrupts = <27 2>;
irq-gpios = <&gpio 27 0>; // specify GPIO27 as the irq line from the TS controller
touchscreen-size-x = <800>;
touchscreen-size-y = <480>;
touchscreen-x-mm = <68>;
touchscreen-y-mm = <46>;
};
};
};
/* Disable i2c_arm - because it is used by dpi? */
[email protected] {
target = <&i2c_arm>;
__overlay__ {
status = "disabled";
};
};
/* Why? */
[email protected] {
target-path = "/aliases";
__overlay__ {
i2c_gpio = "/[email protected]";
};
};
/* Same as @6 - why? */
[email protected] {
target-path = "/__symbols__";
__overlay__ {
i2c_gpio = "/[email protected]";
};
};
/* Define cypress_pins as child of gpio group */
/* referenced by pinctrl to set up gpio 27 as input with pull-down */
[email protected] {
target = <&gpio>;
__overlay__ {
cypress_pins: cypress_pins {
brcm,pins = <27>; // interrupt
brcm,function = <0>; // in
brcm,pull = <2>; // pull-down?
};
};
};
};
Code: Select all
/* Disable SPI - because DPI uses it? */
Code: Select all
/* There is no DPI driver module, but we need a platform device */
/* node (that doesn't already use pinctrl) to hang the pinctrl */
/* reference on - leds will do */
/* (Can I add these to my own pictrl for Cy8c20466 or cypress_pins?) */
Code: Select all
pinctrl-0 = <&cypress_pins &dpi18_pins> ;
Code: Select all
/* Why is the node called [email protected] not [email protected]? */
Code: Select all
Cy8c20466: [email protected] {
compatible = "cypress,Cy8c20466";
Code: Select all
/* Disable i2c_arm - because it is used by dpi? */
Code: Select all
/* Same as @6 - why? */
Code: Select all
/*
* Device tree overlay for Cypress Cy8c20466 Touchscreen
* V2
*
* Compile:
* dtc [email protected] -I dts -O dtb -o cypress.dtbo cypress.dts
*/
/dts-v1/;
/plugin/;
/{
/* Identify the RPi models this is compatible with (is this sufficient?) */
compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709";
/* Define a group of pins to be configured by the GPIO driver as function 6 = ALT2 = DPI mode */
[email protected] {
target = <&gpio>;
__overlay__ {
dpi18_pins: dpi18_pins {
brcm,pins = <0 1 2 3 4 5 6 7 8 9 12 13 14 15 16 17 20 21 22 23 24 25>;
brcm,function = <6>;
brcm,pull = <0>;
};
};
};
/* Define cypress_pins as child of gpio group */
/* referenced by pinctrl to set up gpio 27 as input with pull-down */
[email protected] {
target = <&gpio>;
__overlay__ {
cypress_pins: cypress_pins {
brcm,pins = <27>; // interrupt
brcm,function = <0>; // in
brcm,pull = <2>; // pull-down?
};
};
};
/* Create i2c-gpio driver instance for software i2c on gpio 10 & 11 as i2c-3. 4us delay for 100kHz */
[email protected] {
target-path = "/";
__overlay__ {
i2c_gpio: [email protected] {
compatible = "i2c-gpio";
gpios = <&gpio 10 0 /* sda */
&gpio 11 0 /* scl */
>;
i2c-gpio,delay-us = <4>;
#address-cells = <1>;
#size-cells = <0>;
};
};
};
/* Add the touchscreen controller as a device under i2c_gpio */
[email protected] {
target = <&i2c_gpio>;
__overlay__ {
/* needed to avoid dtc warning */
#address-cells = <1>;
#size-cells = <0>;
cy8c20466: [email protected] {
compatible = "cypress,cy8c20466";
reg = <0x5c>;
pinctrl-names = "default";
pinctrl-0 = <&cypress_pins &dpi18_pins>;
interrupt-parent = <&gpio>;
interrupts = <27 2>;
irq-gpios = <&gpio 27 0>; // specify GPIO27 as the irq line from the TS controller
touchscreen-size-x = <800>;
touchscreen-size-y = <480>;
touchscreen-x-mm = <68>;
touchscreen-y-mm = <46>;
};
};
};
[email protected] {
target-path = "/aliases";
__overlay__ {
i2c_gpio = "/[email protected]";
};
};
[email protected] {
target-path = "/__symbols__";
__overlay__ {
i2c_gpio = "/[email protected]";
};
};
/* Disable SPI - because DPI uses it. Not necessary, just in case */
[email protected] {
target = <&spi0>;
__overlay__ {
status = "disabled";
};
};
/* Disable i2c_arm - because DPI uses it. Not necessary, just in case */
[email protected] {
target = <&i2c_arm>;
__overlay__ {
status = "disabled";
};
};
};
Code: Select all
[email protected] {
target = <&gpio>;
__overlay__ {
dpi18_pins: dpi18_pins {
brcm,pins = <0 1 2 3 4 5 6 7 8 9 12 13 14 15 16 17 20 21 22 23 24 25>;
brcm,function = <6>;
brcm,pull = <0>;
};
/* Define cypress_pins as child of gpio group */
cypress_pins: cypress_pins {
brcm,pins = <27>; // interrupt
brcm,function = <0>; // in
brcm,pull = <2>; // pull-down?
};
};
};
/* Create i2c-gpio driver instance for software i2c on gpio 10 & 11 as i2c-3. 4us delay for 100kHz */
[email protected] {
target-path = "/";
__overlay__ {
i2c_gpio: [email protected] {
compatible = "i2c-gpio";
reg = <0>;
gpios = <&gpio 10 0 /* sda */
&gpio 11 0 /* scl */
>;
i2c-gpio,delay-us = <4>;
#address-cells = <1>;
#size-cells = <0>;
cy8c20466: [email protected] {
compatible = "cypress,cy8c20466";
reg = <0x5c>;
pinctrl-names = "default";
pinctrl-0 = <&cypress_pins &dpi18_pins>;
interrupt-parent = <&gpio>;
interrupts = <27 2>;
irq-gpios = <&gpio 27 0>; // specify GPIO27 as the irq line from the TS controller
touchscreen-size-x = <800>;
touchscreen-size-y = <480>;
touchscreen-x-mm = <68>;
touchscreen-y-mm = <46>;
};
};
};
};
Code: Select all
Feb 2 23:29:57 recovery kern.debug kernel: [ 696.603412] Cypress-TS 0-005c: process_events 27: 1
Feb 2 23:29:57 recovery kern.debug kernel: [ 696.604496] Cypress-TS 0-005c: .
Feb 2 23:29:57 recovery kern.debug kernel: [ 696.723412] Cypress-TS 0-005c: process_events 27: 1
Feb 2 23:29:57 recovery kern.debug kernel: [ 696.724496] Cypress-TS 0-005c: .
Feb 2 23:29:57 recovery kern.debug kernel: [ 696.843412] Cypress-TS 0-005c: process_events 27: 1
Feb 2 23:29:57 recovery kern.debug kernel: [ 696.846030] Cypress-TS 0-005c: .
Feb 2 23:29:57 recovery kern.debug kernel: [ 696.963412] Cypress-TS 0-005c: process_events 27: 1
Feb 2 23:29:57 recovery kern.debug kernel: [ 696.965382] Cypress-TS 0-005c: .
Feb 2 23:29:57 recovery kern.debug kernel: [ 696.965386] Cypress-TS 0-005c: x1,y1= 216, 332
Feb 2 23:29:57 recovery kern.debug kernel: [ 697.083412] Cypress-TS 0-005c: process_events 27: 1
Feb 2 23:29:57 recovery kern.debug kernel: [ 697.087684] Cypress-TS 0-005c: .
Feb 2 23:29:57 recovery kern.debug kernel: [ 697.087688] Cypress-TS 0-005c: x1,y1= 223, 337
Feb 2 23:29:57 recovery kern.debug kernel: [ 697.203412] Cypress-TS 0-005c: process_events 27: 1
Feb 2 23:29:57 recovery kern.debug kernel: [ 697.204536] Cypress-TS 0-005c: .
Feb 2 23:29:57 recovery kern.debug kernel: [ 697.204540] Cypress-TS 0-005c: x1,y1= 223, 337
Feb 2 23:29:57 recovery kern.debug kernel: [ 697.323418] Cypress-TS 0-005c: process_events 27: 1
Feb 2 23:29:57 recovery kern.debug kernel: [ 697.329598] Cypress-TS 0-005c: .
Feb 2 23:29:57 recovery kern.debug kernel: [ 697.329602] Cypress-TS 0-005c: x1,y1= 229, 206
Feb 2 23:29:57 recovery kern.debug kernel: [ 697.329606] Cypress-TS 0-005c: x2,y2= 468, 338
Feb 2 23:29:58 recovery kern.debug kernel: [ 697.443417] Cypress-TS 0-005c: process_events 27: 1
Feb 2 23:29:58 recovery kern.debug kernel: [ 697.444474] Cypress-TS 0-005c: .
Feb 2 23:29:58 recovery kern.debug kernel: [ 697.444478] Cypress-TS 0-005c: x1,y1= 229, 206
Feb 2 23:29:58 recovery kern.debug kernel: [ 697.444482] Cypress-TS 0-005c: x2,y2= 466, 337
Feb 2 23:29:58 recovery kern.debug kernel: [ 697.563413] Cypress-TS 0-005c: process_events 27: 1
Feb 2 23:29:58 recovery kern.debug kernel: [ 697.564506] Cypress-TS 0-005c: .
Feb 2 23:29:58 recovery kern.debug kernel: [ 697.564509] Cypress-TS 0-005c: x1,y1= 228, 206
Feb 2 23:29:58 recovery kern.debug kernel: [ 697.564513] Cypress-TS 0-005c: x2,y2= 466, 337
Feb 2 23:29:58 recovery kern.debug kernel: [ 697.683412] Cypress-TS 0-005c: process_events 27: 1
Feb 2 23:29:58 recovery kern.debug kernel: [ 697.684840] Cypress-TS 0-005c: .
Feb 2 23:29:58 recovery kern.debug kernel: [ 697.684844] Cypress-TS 0-005c: x1,y1= 229, 207
Feb 2 23:29:58 recovery kern.debug kernel: [ 697.684848] Cypress-TS 0-005c: x2,y2= 468, 339
Feb 2 23:29:58 recovery kern.debug kernel: [ 697.803412] Cypress-TS 0-005c: process_events 27: 1
Feb 2 23:29:58 recovery kern.debug kernel: [ 697.804449] Cypress-TS 0-005c: .
Feb 2 23:29:58 recovery kern.debug kernel: [ 697.923412] Cypress-TS 0-005c: process_events 27: 1
Feb 2 23:29:58 recovery kern.debug kernel: [ 697.924472] Cypress-TS 0-005c: .
Feb 2 23:29:58 recovery kern.debug kernel: [ 698.043412] Cypress-TS 0-005c: process_events 27: 1
Feb 2 23:29:58 recovery kern.debug kernel: [ 698.044571] Cypress-TS 0-005c: .
Feb 2 23:29:58 recovery kern.debug kernel: [ 698.163412] Cypress-TS 0-005c: process_events 27: 1
Code: Select all
$ sudo sh -c "echo 1 > /sys/kernel/debug/trace/events/i2c/enable"
# [ run python test ]
$ sudo cat /sys/kernel/debug/trace/trace > python_trace.txt
$ sudo sh -c "echo > /sys/kernel/debug/trace/trace"
# [ run C test ]
$ sudo cat /sys/kernel/debug/trace/trace > c_trace.txt
$ sudo sh -c "echo > /sys/kernel/debug/trace/trace"
$ sudo sh -c "echo 0 > /sys/kernel/debug/trace/events/i2c/enable"
Code: Select all
/dts-v1/;
/plugin/;
/{
compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709", "brcm,bcm2710", "brcm,bcm2837";
[email protected] {
target = <&gpio>;
__overlay__ {
cypress_pins: cypress_pins {
brcm,pins = <27>; // interrupt
brcm,function = <0>; // in
brcm,pull = <1>; // pull-down?
};
};
};
[email protected] {
target = <&leds>;
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&cypress_pins>;
};
};
};
Code: Select all
002252.264: dtdebug: Opened overlay file 'overlays/touch.dtbo'
002252.796: brfs: File read: /mfs/sd/overlays/touch.dtbo
002267.234: Loaded overlay 'touch'
002267.537: dtdebug: Found fragment 0 (offset 100)
002270.575: dtdebug: merge_fragment(/soc/[email protected],/[email protected]/__overlay__)
002278.205: dtdebug: merge_fragment(/soc/[email protected]/cypress_pins,/[email protected]/__overlay__/cypress_pins)
002278.233: dtdebug: +prop(brcm,pins)
002281.068: dtdebug: +prop(brcm,function)
002283.931: dtdebug: +prop(brcm,pull)
002286.811: dtdebug: +prop(linux,phandle)
002290.225: dtdebug: +prop(phandle)
002293.073: dtdebug: merge_fragment() end
002293.106: dtdebug: merge_fragment() end
002293.188: dtdebug: Found fragment 1 (offset 260)
002315.790: dtdebug: merge_fragment(/leds,/[email protected]/__overlay__)
002315.817: dtdebug: +prop(pinctrl-names)
002316.908: dtdebug: +prop(pinctrl-0)
002318.021: dtdebug: merge_fragment() end
002318.191: brfs: File read: 777 bytes
002329.219: dtdebug: Opened overlay file 'overlays/hyperpixel-gpio-backlight.dtbo'
Code: Select all
+-----+-----+---------+------+---+---Pi 3+--+---+------+---------+-----+-----+
| BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| | | 3.3v | | | 1 || 2 | | | 5v | | |
| 2 | 8 | SDA.1 | IN | 1 | 3 || 4 | | | 5v | | |
| 3 | 9 | SCL.1 | IN | 1 | 5 || 6 | | | 0v | | |
| 4 | 7 | GPIO. 7 | IN | 0 | 7 || 8 | 0 | IN | TxD | 15 | 14 |
| | | 0v | | | 9 || 10 | 1 | IN | RxD | 16 | 15 |
| 17 | 0 | GPIO. 0 | IN | 0 | 11 || 12 | 1 | OUT | GPIO. 1 | 1 | 18 |
| 27 | 2 | GPIO. 2 | OUT | 1 | 13 || 14 | | | 0v | | | <------------ BCM 27 = OUT, value 1
| 22 | 3 | GPIO. 3 | IN | 0 | 15 || 16 | 1 | IN | GPIO. 4 | 4 | 23 |
| | | 3.3v | | | 17 || 18 | 0 | IN | GPIO. 5 | 5 | 24 |
| 10 | 12 | MOSI | IN | 0 | 19 || 20 | | | 0v | | |
| 9 | 13 | MISO | IN | 0 | 21 || 22 | 0 | IN | GPIO. 6 | 6 | 25 |
| 11 | 14 | SCLK | IN | 0 | 23 || 24 | 0 | IN | CE0 | 10 | 8 |
| | | 0v | | | 25 || 26 | 0 | IN | CE1 | 11 | 7 |
| 0 | 30 | SDA.0 | IN | 1 | 27 || 28 | 1 | IN | SCL.0 | 31 | 1 |
| 5 | 21 | GPIO.21 | IN | 0 | 29 || 30 | | | 0v | | |
| 6 | 22 | GPIO.22 | IN | 0 | 31 || 32 | 0 | IN | GPIO.26 | 26 | 12 |
| 13 | 23 | GPIO.23 | IN | 0 | 33 || 34 | | | 0v | | |
| 19 | 24 | GPIO.24 | OUT | 0 | 35 || 36 | 0 | IN | GPIO.27 | 27 | 16 |
| 26 | 25 | GPIO.25 | OUT | 0 | 37 || 38 | 0 | IN | GPIO.28 | 28 | 20 |
| | | 0v | | | 39 || 40 | 0 | IN | GPIO.29 | 29 | 21 |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
+-----+-----+---------+------+---+---Pi 3+--+---+------+---------+-----+-----+
Code: Select all
# evtest event0
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x416 product 0x0 version 0x0
Input device name: "Cypress Capacitive TouchScreen"
Supported events:
Event type 0 (EV_SYN)
Event type 3 (EV_ABS)
Event code 53 (ABS_MT_POSITION_X)
Value 0
Min 0
Max 0
Event code 54 (ABS_MT_POSITION_Y)
Value 0
Min 0
Max 0
Properties:
Testing ... (interrupt to exit)
Event: time 847.601478, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 543
Event: time 847.601478, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 469
Event: time 847.601478, -------------- EV_SYN ------------
Code: Select all
[ 847.488248] Cypress-TS 0-005c: Press 1
[ 847.604846] Cypress-TS 0-005c: Move 1: (543,469)
[ 847.726344] Cypress-TS 0-005c: Release 1
Code: Select all
# evtest event0
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x416 product 0x38f version 0x1060
Input device name: "Goodix Capacitive TouchScreen"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 125 (KEY_LEFTMETA)
Event code 330 (BTN_TOUCH)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 0
Min 0
Max 800
Event code 1 (ABS_Y)
Value 0
Min 0
Max 480
Event code 47 (ABS_MT_SLOT)
Value 0
Min 0
Max 4
Event code 48 (ABS_MT_TOUCH_MAJOR)
Value 0
Min 0
Max 255
Event code 50 (ABS_MT_WIDTH_MAJOR)
Value 0
Min 0
Max 255
Event code 53 (ABS_MT_POSITION_X)
Value 0
Min 0
Max 800
Event code 54 (ABS_MT_POSITION_Y)
Value 0
Min 0
Max 480
Event code 57 (ABS_MT_TRACKING_ID)
Value 0
Min 0
Max 65535
Properties:
Property type 1 (INPUT_PROP_DIRECT)
Testing ... (interrupt to exit)
Event: time 70.931811, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 0
Event: time 70.931811, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 363
Event: time 70.931811, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 184
Event: time 70.931811, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 71
Event: time 70.931811, type 3 (EV_ABS), code 50 (ABS_MT_WIDTH_MAJOR), value 71
Event: time 70.931811, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 70.931811, type 3 (EV_ABS), code 0 (ABS_X), value 363
Event: time 70.931811, type 3 (EV_ABS), code 1 (ABS_Y), value 184
Event: time 70.931811, -------------- EV_SYN ------------
Event: time 71.103546, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1
Event: time 71.103546, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 71.103546, -------------- EV_SYN ------------
Event: time 83.168580, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1
Event: time 83.168580, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 317
Event: time 83.168580, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 173
Event: time 83.168580, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 79
Event: time 83.168580, type 3 (EV_ABS), code 50 (ABS_MT_WIDTH_MAJOR), value 79
Event: time 83.168580, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 83.168580, type 3 (EV_ABS), code 0 (ABS_X), value 317
Event: time 83.168580, type 3 (EV_ABS), code 1 (ABS_Y), value 173
Event: time 83.168580, -------------- EV_SYN ------------
Event: time 83.252907, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1
Event: time 83.252907, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 83.252907, -------------- EV_SYN ------------
Code: Select all
cypress_request_input_dev(ts);
cypress_get_gpio_config(ts);