Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1490560
| Path | csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | "H. Nikolaus Schaller" <hns@goldelico.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v3 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation |
| Date | Sat, 24 Sep 2016 07:30:02 +0200 |
| Message-ID | <skNHc-5m9-29@gated-at.bofh.it> (permalink) |
| References | <sky5r-3Iu-7@gated-at.bofh.it> <sky5r-3Iu-15@gated-at.bofh.it> <skHs5-1kq-3@gated-at.bofh.it> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; t=1474694936; l=4714; s=domk; d=goldelico.com; h=To:References:Content-Transfer-Encoding:Cc:Date:In-Reply-To:From: Subject:Mime-Version:Content-Type; bh=dkcxKVyKCwfu3c1BgLX9DuJmoS/ny1vGp9M4zG2gB3c=; b=Aqp2cM8bPL/JmOIhZ2OgwCpl1wuL5qzibusl0aFAgtZ6xI+oU6jjAb2hP8stjBJeYbm SctRhwH/mqjnZV45u6n9KnjXeSafd6XXcbAScoH/DVjZj8/8y0Oc7VLASx+RzY7Oc7vqd jayhMNEZ+jSOPL71JmDjy4Qo5M5KflU0na4= |
| X-Rzg-Auth | :JGIXVUS7cutRB/49FwqZ7WcecEarQROEYabkiUo6mSAGQ+qKID8yPJCPgnE= |
| X-Rzg-Class-ID | mo00 |
| Content-Type | text/plain; charset=us-ascii |
| MIME-Version | 1.0 (Mac OS X Mail 9.3 \(3124\)) |
| Content-Transfer-Encoding | quoted-printable |
| X-Mailer | Apple Mail (2.3124) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 134 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Dmitry Torokhov <dmitry.torokhov@gmail.com>, Mark Rutland <mark.rutland@arm.com>, Benoît Cousson <bcousson@baylibre.com>, Tony Lindgren <tony@atomide.com>, Russell King <linux@armlinux.org.uk>, Arnd Bergmann <arnd@arndb.de>, Michael Welling <mwelling@ieee.org>, Mika Penttilä <mika.penttila@nextfour.com>, Javier Martinez Canillas <javier@osg.samsung.com>, Igor Grinberg <grinberg@compulab.co.il>, Sebastian Reichel <sre@kernel.org>, "Andrew F. Davis" <afd@ti.com>, linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, letux-kernel@openphoenux.org, linux-iio@vger.kernel.org |
| X-Original-Date | Sat, 24 Sep 2016 07:28:48 +0200 |
| X-Original-Message-ID | <118D373B-21B0-4246-A3C9-0E0373F66656@goldelico.com> |
| X-Original-References | <cover.1474634475.git.hns@goldelico.com> <1409ed9845f17445a8a67bd6fb16c902c3e4f69c.1474634475.git.hns@goldelico.com> <20160923224726.GA4639@rob-hp-laptop> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1490560 |
Show key headers only | View raw
Hi,
> Am 24.09.2016 um 00:47 schrieb Rob Herring <robh@kernel.org>:
>
> 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.
There is code to take missing values as 0 or maximum. So this will scale 1:1
and should not break old DTs.
>
>>
>> [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.
No. They have a different purpose!
You need to scale values like this:
ti,min-x -> 0
x -> some value between 0 and touchscreen-size-x
ti,max-x -> touchscreen-size-x
So the ti, values describe the ADC raw values while the common bindings
describe the size in input-event coordinates.
So we need both specified: raw values and pixel values.
>
>> - ti,poll-period: how much time to wait (in milliseconds) before reading again the
>> - values from the tsc2007.
>> + values from the tsc2007 (default 1).
>>
>> [0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
>> [1]: Documentation/devicetree/bindings/gpio/gpio.txt
>> +[2]: Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
>>
>> Example:
>> &i2c1 {
>> @@ -35,6 +39,8 @@ Example:
>> interrupts = <0x0 0x8>;
>> gpios = <&gpio4 0 0>;
>> ti,x-plate-ohms = <180>;
>> + touchscreen-size-x = <640>;
>> + touchscreen-size-y = <480>;
>> };
>>
>> /* ... */
BR,
Nikolaus
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v3 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation "H. Nikolaus Schaller" <hns@goldelico.com> - 2016-09-23 14:50 +0200
Re: [PATCH v3 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation Rob Herring <robh@kernel.org> - 2016-09-24 00:50 +0200
Re: [PATCH v3 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation Sebastian Reichel <sre@kernel.org> - 2016-09-24 02:40 +0200
Re: [PATCH v3 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation "H. Nikolaus Schaller" <hns@goldelico.com> - 2016-09-24 08:00 +0200
Re: [PATCH v3 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation Sebastian Reichel <sre@kernel.org> - 2016-09-30 16:20 +0200
Re: [PATCH v3 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation "H. Nikolaus Schaller" <hns@goldelico.com> - 2016-09-30 16:50 +0200
Re: [PATCH v3 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation "H. Nikolaus Schaller" <hns@goldelico.com> - 2016-09-24 07:30 +0200
Re: [Letux-kernel] [PATCH v3 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation Christ van Willegen <cvwillegen@gmail.com> - 2016-09-30 18:30 +0200
Re: [Letux-kernel] [PATCH v3 1/8] drivers:input:tsc2007: add new common binding names, pre-calibration, flipping and rotation "H. Nikolaus Schaller" <hns@goldelico.com> - 2016-09-30 18:40 +0200
csiph-web