[General Questions and Answers] Patrick_00:
Hello there!

I am struggling to get the Silead GSL5680 Touchscreen to work, the driver that android has for silead seems to not support the GSL5680. (https://github.com/hardkernel/linux/blob/odroidg12-4.9.y/drivers/input/touchscreen/silead.c#L543)

Specs:

-> Device: Odroid C4

-> OS: Android 9.0

-> Kernel Version: 4.9.113

The touchscreen is connected via I2C, I installed I2C-tools to check:

130|odroidc4:/ # i2cdetect -l
i2c-1 i2c Meson I2C adapter I2C adapter
i2c-0 i2c Meson I2C adapter I2C adapter

For i2c-0 I get:

odroidc4:/ # i2cdetect -y 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

(The touchscreen should always reply on 0x40 regarding to the datasheet, so it should be connected right)

odroidc4:/ # i2cget 0 0x40
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-0, chip address 0x40, current data
address, using read byte.
Continue? [Y/n] y
0xfa

I downloaded the full android source and tried to build the system with this driver I found online:

I had to edit gslx680_ds.c (using <linux/gpio.h> instead of <asm/gpio.h> and added <linux/module.h>) so it would compile successfully.

linux_kernel/include/linux/input/gslx680_ds.h at 9deb1afd3fd2328cb3f6b1ee99dc607aaa0dab3e · hansiglaser/linux_kernel

Kernel Linux Repository for UDOO. Contribute to hansiglaser/linux_kernel development by creating an account on GitHub.

github.com

linux_kernel/gslx680_ds.inc.c at 9deb1afd3fd2328cb3f6b1ee99dc607aaa0dab3e · hansiglaser/linux_kernel

Kernel Linux Repository for UDOO. Contribute to hansiglaser/linux_kernel development by creating an account on GitHub.

github.com

linux_kernel/drivers/input/touchscreen/gslx680_ds.c at 9deb1afd3fd2328cb3f6b1ee99dc607aaa0dab3e · hansiglaser/linux_kernel

Kernel Linux Repository for UDOO. Contribute to hansiglaser/linux_kernel development by creating an account on GitHub.

github.com

And put them in common/drivers/input/touchscreen/GSL5680

Also created a Makefile and Kconfig:

Makefile:

obj-$(CONFIG_TOUCHSCREEN_GSL5680) += gslx680_ds.o

Kconfig:

#
# Touchscreen driver configuration
#
config TOUCHSCREEN_GSL5680
tristate "gsl5680 touchscreen driver"
depends on INPUT && I2C
default m
help
gsl5680 touchscreen driver

I added obj-$(CONFIG_INPUT_TOUCHSCREEN) += gsl5680/ to the Makefile in common/drivers/touchscreen and the source in Kconfig in .../touchscreen

I added gslx680-i2c.dts in common/arch/arm64/boot/dts/amlogic/overlays/odroidc4/ (maybe that is wrong?):

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/meson-g12a-gpio.h>
#include <dt-bindings/gpio/gpio.h>

/ {
fragment@0 {
// i2c3 aliased with i2c1.
target = <&i2c3>;

__overlay__ {
status = "okay";

#address-cells = <1>;
#size-cells = <0>;

touchscreen: gslx680@40 {
compatible = "silead,gslx680";
reg = <0x40>;
interrupt-parent = <&gpio1>;
power-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
pinctrl-0 = <&pinctrl_gslx680>;
pinctrl-names = "default";
};
};
};
};

Then I added it in the Makefile.

Then I edited the odroidc4_android_defconfig with make menuconfig and enabled the GSL5680 driver with 'y'

After building the image and installing it on a sdcard, I booted the system, but could not see the driver with lsmod or dmesg.

When I then tried to manually add the gslx680_ds.ko with insmod gslx680_ds.ko, the response was that this module is already loaded.

I would be very thankful for any ideas and help!