linux icon indicating copy to clipboard operation
linux copied to clipboard

tenderloin touchscreen: nearly there, but not yet working

Open Tofee opened this issue 3 months ago • 5 comments

Hi !

I picking up the work where it was left off by you, Mark and Ben. I've put it together in https://github.com/Tofee/shr-linux/commits/tenderloin/6.10/mainline-squashed/ .

So far I've got graphics working (still a lot of artefacts), and now I'm trying to get the touchscreen working. The goal would be to try and send it upstream. As you maybe already know, on the touchpad the touchscreen (on 3.4 kernel) is handled in the following way:

  • a I2C to UART bridge at board level, on gsbi 10
  • a basic driver, named cy8ctma395, which basically just forwards calls from userland
  • a userland utility, ts_srv, opens the uart device node and does the heavy lifting

There are a first snippet you put in place:

&gsbi10_i2c {
	status = "okay";
	clock-frequency = <100000>;
	pinctrl-names = "default";
	pinctrl-0 = <&gsbi10_i2c_pins>;
	touch@67 {
		compatible = "";
		reg = <0x67>;
		interrupts-extended = <&tlmm 123 IRQ_TYPE_LEVEL_LOW>; /* 3G: 45 */
		reset-gpios = <&tlmm 70 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&touch_pins>;
	};
};

I suppose your approach here was to try to handle the touchscreen directly via i2c, maybe with a generic driver? I couldn't make it work that way, so I tried to mimic how it was done on downstream kernel.

I diverged quite a bit from there, because now I ported cy8ctma395 from downstream kernel to a 6.10 kernel, and I'm trying to get the I2C-to-UART bridge working. On downstream kernel, HP used a "hsuart" driver, which isn't there in mainline. So I'm trying to simply use the one from msm, i.e. qcom,msm-uartdm. I also use the following dts for gsbi10:

  • at main level, https://github.com/Tofee/shr-linux/blob/0347801d9004da4119999294392f049f3463a4a4/arch/arm/boot/dts/qcom/qcom-apq8060-tenderloin.dts#L138-L171
  • modified a bit by: https://github.com/Tofee/shr-linux/blob/0347801d9004da4119999294392f049f3463a4a4/arch/arm/boot/dts/qcom/qcom-apq8060-tenderloin.dts#L1098-L1114

I get a /dev/ttyMSM1 node, so it's encouraging. However, it doesn't seem to be getting any data.

I'm wondering if associating the pins to the i2c gsbi node or to the serial gsbi node makes a difference ? I'm really not sure how msm-uartdm works and handles it... Maybe you have an idea how it's supposed to be organized?

I think it's nearly working, but I can't find the right way to put the final pieces :)

Tofee avatar Nov 03 '24 19:11 Tofee