flto / linux

Other
17 stars 9 forks source link

tenderloin touchscreen: nearly there, but not yet working #7

Open Tofee opened 2 weeks ago

Tofee commented 2 weeks ago

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:

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:

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 :)

mboudr35 commented 2 weeks ago

Hey! Thanks for taking up the torch on this. Been a long while since I've done any digging on the touchpad. There was a point I was able to get the kernel bootlog to display on the framebuffer before it seemingly froze and bizarre artifacts started to render (vertical blue lines slowly faded in), was never able to get past that. Even reading from the UART console didn't show any obvious warnings. What kind of artifacts are you running in to now? My memory is a bit hazy having been a few years I've done anything on this, but I'd be happy to help in any way I can

mboudr35 commented 2 weeks ago

This is the .config I used: https://gist.github.com/mboudr35/dc973ade2746b5589ab19869d2b31ca8

There is some UART stuff in there. Don't recall if that was all I needed to get output

Tofee commented 2 weeks ago

Hi @mboudr35 ! Well the artefacts are mostly about colors being incorrect, and (I think) half flushed frames. Also I'm not using IOMMU, and maybe the driver would work a bit better with that in place... My defconfig is currently the following: https://gist.github.com/Tofee/ce88561b35de8f3d869440d284fcdda2 It should be pretty similar to yours.

Tofee commented 2 weeks ago

I wonder, do any of you guys have some documentation about the topaz board ? I've got schematics, but it's a bit rough... More specifically I couldn't find anything on the touchscreen device, so I'm not sure if the generic cypress i2c driver could possibly work for our device. I've tried it, but it fails sending any command through i2c.

mboudr35 commented 2 weeks ago

Unfortunately I was never able to procure anything more detailed in the way of documentation