Index | Thread | Search

From:
Marcus Glocker <marcus@nazgul.ch>
Subject:
Re: Touchscreen support for the Samsung Galaxy Book4 Edge
To:
"Kirill A. Korinsky" <kirill@korins.ky>
Cc:
tech@openbsd.org
Date:
Fri, 22 May 2026 21:52:02 +0200

Download raw body.

Thread
On Fri, May 22, 2026 at 08:35:20PM +0200, Kirill A. Korinsky wrote:

> On Fri, 22 May 2026 19:52:48 +0200,
> Marcus Glocker <marcus@nazgul.ch> wrote:
> > 
> > On Fri, May 22, 2026 at 01:04:29PM +0200, Kirill A. Korinsky wrote:
> > 
> > > On Fri, 22 May 2026 05:52:43 +0200,
> > > Marcus Glocker <marcus@nazgul.ch> wrote:
> > > > 
> > > > On Fri, May 22, 2026 at 12:58:54AM +0200, Kirill A. Korinsky wrote:
> > > > 
> > > > > On Thu, 21 May 2026 22:01:07 +0200,
> > > > > Marcus Glocker <marcus@nazgul.ch> wrote:
> > > > > > 
> > > > > > This diff enables touchscreen support for the Samsung Galaxy Book4
> > > > > > Edge.  For now we need to stick with polling since we can't figure
> > > > > > out the GPIO pin for the touchscreen interrupts.
> > > > > > 
> > > > > > In a summary, those are the changes we had to do in the different
> > > > > > areas:
> > > > > > 
> > > > > > - DTS: Power up the device and declare it on the I2C bus; no interrupt
> > > > > >   line, so it runs in polling mode (we can't determine the IRQ pin).
> > > > > > 
> > > > > > - hidmt: Teach the shared multitouch layer to handle absolute
> > > > > >   touchscreens, not just touchpads.
> > > > > > 
> > > > > > - imt: Recognize and claim the panel as a touchscreen so it's driven by
> > > > > >   the multitouch layer instead of being mistaken for a plain mouse.
> > > > > > 
> > > > > > - ihidev: Synthesize the "finger lifted" event in polling mode, since
> > > > > >   the device signals release only by going silent.
> > > > > > 
> > > > > > If you have an i2c-Precision touchpad or an i2c-HID keyboard, please
> > > > > > test it still works.
> > > > > > 
> > > > > > Please note that the diff doesn't introduce multi-finger gestures,
> > > > > > just absolute pointer support (tap/drag).
> > > > > > 
> > > > > > Otherwise, feedback, OKs?
> > > > > >
> > > > > 
> > > > > It brokes touchscreen on my honor.
> > > > 
> > > > Could you send me a dmesg before and after the diff please?
> > > >  
> > > 
> > > Sure, two dmesg attached, also here a diff.
> > > 
> > > Keep in mind that multitouch works not each boot, and both boots was without
> > > multitouch, and symptop of that: ihidev2: failed fetching report
> > > 
> > > I had add some hacks which allows to have multitouch on touchpad, but it
> > > seems not enough.
> > > 
> > > Anyway, here a diff:
> > 
> > Thanks for the report.
> > 
> > It looks like your panel has a config report, while my hasn't, which
> > has caused trying to switch the input mode where it shouldn't.
> > 
> > Can you please try this updated diff?  Your touchscreen should still
> > attach to imt instead of ims, but hopefully works this time.
> > 
> >
> 
> Doesn't work and I haven't see changes in dmesg.

Pity.  Can you please apply this debug diff on top of the last diff,
and send me your dmesg?  It should print the HID report descriptor.
Maybe we can find out more based on that.


--- sys/dev/i2c/ihidev.c	2026-05-22 21:47:47.428363738 +0200
+++ sys/dev/i2c/ihidev.c	2026-05-22 21:47:47.429642355 +0200
@@ -154,6 +154,19 @@
 	if (sc->sc_nrepid < 0)
 		return;
 
+	/* XXX debug: dump the HID report descriptor */
+	{
+		int k;
+		printf("%s: report descriptor (%d bytes):",
+		    sc->sc_dev.dv_xname, sc->sc_reportlen);
+		for (k = 0; k < sc->sc_reportlen; k++) {
+			if ((k % 16) == 0)
+				printf("\n%s:", sc->sc_dev.dv_xname);
+			printf(" %02x", sc->sc_report[k]);
+		}
+		printf("\n");
+	}
+
 	sc->sc_nrepid++;
 	sc->sc_subdevs = mallocarray(sc->sc_nrepid, sizeof(struct ihidev *),
 	    M_DEVBUF, M_WAITOK | M_ZERO);