Re: [PATCH 3/5] Input: zinitix - add support for modes 0 and 1
Dmitry Torokhov <[email protected]> Fri, 24 Jul 2026 12:25:45 -0700
| Newsgroups | org.kernel.vger.linux-samsung-soc,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-input,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
Hi Kaustabh, On Fri, Jul 24, 2026 at 12:54:05AM +0530, Kaustabh Chakraborty wrote: > Zinitix touchscreens have three modes, numbered 0 to 2. The driver > implements mode 2, and leaves out modes 0 and 1. The difference in the > touchscreen modes is the schema of the event data. > > Implement modes 0 and 1 in the driver, along with their event structs. > Maintain a common, canonical event struct which is to be the superset of > the mode-specific structs. With that, introduce functions to convert the > mode event info to the canonical format. > > Signed-off-by: Kaustabh Chakraborty <[email protected]> > --- ... > +static int zinitix_read_point_status(struct bt541_ts_data *bt541, > + struct touch_event *event) > +{ > + switch (bt541->zinitix_mode) { > + case 0: > + return zinitix_read_point_status_mode0(bt541, event); > + case 1: > + return zinitix_read_point_status_mode1(bt541, event); > + case 2: > + return zinitix_read_point_status_mode2(bt541, event); > + default: > + dev_err(&bt541->client->dev, "Mode %d is unsupported\n", > + bt541->zinitix_mode); > + return -EINVAL; Instead of a switch this can be a pointer to "read status" function. Thanks. -- Dmitry