Re: [PATCH v3 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation

Sebastian Reichel
2016-09-24T00:31:33Z

[-- Attachment #1: Type: text/plain, Size: 4296 bytes --]

On Fri, Sep 23, 2016 at 05:47:26PM -0500, Rob Herring wrote:
> On Fri, Sep 23, 2016 at 02:41:09PM +0200, H. Nikolaus Schaller wrote:
> > commit b98abe52fa8e ("Input: add common DT binding for touchscreens")
> > introduced common DT bindings for touchscreens [1] and a helper function to
> > parse the DT.
> >
> > commit ed7c9870c9bc ("Input: of_touchscreen - add support for inverted / swapped axes")
> > added another helper for parsing axis inversion and swapping
> > and applying them to x and y coordinates.
> >
> > Both helpers have been integrated to accommodate any orientation of the
> > touch panel in relation to the LCD.
> >
> > A new feature is to introduce scaling the min/max ADC values to the screen
> > size.
> >
> > This makes it possible to pre-calibrate the touch so that is (almost)
> > exactly matches the LCD pixel coordinates it is glued onto. This allows to
> > well enough operate the touch before a user space calibration step can
> > improve the precision.
> >
> > Finally, calculate_pressure has been renamed to calculate_resistance
> > because that is what it is doing.
>
> Seems like you are breaking compatibility with old DTs. I can't tell for
> sure though.
>
> >
> > [1]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
> >
> > Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> > ---
> > .../bindings/input/touchscreen/tsc2007.txt | 20 ++--
> > drivers/input/touchscreen/tsc2007.c | 126 +++++++++++++++++----
> > include/linux/i2c/tsc2007.h | 8 ++
> > 3 files changed, 123 insertions(+), 31 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt b/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
> > index ec365e1..6e9fd55 100644
> > --- a/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
> > +++ b/Documentation/devicetree/bindings/input/touchscreen/tsc2007.txt
> > @@ -6,6 +6,7 @@ Required properties:
> > - ti,x-plate-ohms: X-plate resistance in ohms.
> >
> > Optional properties:
> > +- generic touch screen properties: see touchscreen binding [2].
> > - gpios: the interrupt gpio the chip is connected to (trough the penirq pin).
> > The penirq pin goes to low when the panel is touched.
> > (see GPIO binding[1] for more details).
> > @@ -13,17 +14,20 @@ Optional properties:
> > (see interrupt binding[0]).
> > - interrupts: (gpio) interrupt to which the chip is connected
> > (see interrupt binding[0]).
> > -- ti,max-rt: maximum pressure.
> > -- ti,fuzzx: specifies the absolute input fuzz x value.
> > - If set, it will permit noise in the data up to +- the value given to the fuzz
> > - parameter, that is used to filter noise from the event stream.
> > -- ti,fuzzy: specifies the absolute input fuzz y value.
> > -- ti,fuzzz: specifies the absolute input fuzz z value.
> > +- ti,max-rt: maximum pressure resistance above which samples are ignored
> > + (default: 4095).
> > +- ti,report-resistance: report resistance (no pressure = max_rt) instead
> > + of pressure (no pressure = 0).
> > +- ti,min-x: minimum value reported by X axis ADC (default 0).
> > +- ti,max-x: maximum value reported by X axis ADC (default 4095).
> > +- ti,min-y: minimum value reported by Y axis ADC (default 0).
> > +- ti,max-y: maximum value reported by Y axis ADC (default 4095).
>
> Seems like these could be common too. They make more sense than giving x
> and y sizes in pixel units which really should come from the panel.

The generic touchscreen properties are described "(in pixels)" in
the DT, but they are used in the same way.

So ti,max-[xy] is basically the same as touchscreen-size-[xy],
except, that the generic bindings don't support min-[xy] != 0.

So maybe change the generic bindings like this:

touchscreen-min-x: minimum value reported by X axis ADC (default 0)
touchscreen-max-x: maximum value reported by Y axis ADC
touchscreen-min-y: minimum value reported by Y axis ADC (default 0)
touchscreen-max-y: maximum value reported by Y axis ADC
touchscreen-size-x: deprecated alias for touchscreen-max-x
touchscreen-size-y: deprecated alias for touchscreen-max-y

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]