diff mbox

[v2,6/8] drivers:input:ads7846(+tsc2046): recognise old binding for coordinate flipping

Message ID f036e0d2b019ae9463e108f48643c16a80936ddb.1447446957.git.hns@goldelico.com (mailing list archive)
State New, archived
Headers show

Commit Message

H. Nikolaus Schaller Nov. 13, 2015, 8:35 p.m. UTC
By this patch we still recognise the old binding ti,swap-xy in parallel to
the common binding touchscreen-swapped-x-y. This keeps compatibility
to older (out-of-tree) device tree binaries.

We do this in a separate patch so that it can be easily reverted in the
future to retire the old API. A notice is printed to remind developers
of using old API.

We also fix the bindings name for all in-tree device tree sources in
a separate patch.

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
 drivers/input/touchscreen/ads7846.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Rob Herring Nov. 15, 2015, 2:19 a.m. UTC | #1
On Fri, Nov 13, 2015 at 2:35 PM, H. Nikolaus Schaller <hns@goldelico.com> wrote:
> By this patch we still recognise the old binding ti,swap-xy in parallel to
> the common binding touchscreen-swapped-x-y. This keeps compatibility
> to older (out-of-tree) device tree binaries.
>
> We do this in a separate patch so that it can be easily reverted in the
> future to retire the old API. A notice is printed to remind developers
> of using old API.
>
> We also fix the bindings name for all in-tree device tree sources in
> a separate patch.

This one and patch 5 should be combined, so the series is bisectable.

Rob

>
> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> ---
>  drivers/input/touchscreen/ads7846.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
> index 4525f00..b9896fd 100644
> --- a/drivers/input/touchscreen/ads7846.c
> +++ b/drivers/input/touchscreen/ads7846.c
> @@ -1259,7 +1259,11 @@ static const struct ads7846_platform_data *ads7846_probe_dt(struct device *dev)
>         of_property_read_u16(node, "ti,vref-mv", &pdata->vref_mv);
>         pdata->keep_vref_on = of_property_read_bool(node, "ti,keep-vref-on");
>
> -       pdata->swap_xy = of_property_read_bool(node, "touchscreen-swapped-x-y");
> +       pdata->swap_xy = of_property_read_bool(node, "ti,swap-xy");
> +       if (pdata->swap_xy)
> +               dev_notice(dev, "please update device tree to use touchscreen-swapped-x-y");
> +       pdata->swap_xy |= of_property_read_bool(node,
> +                                               "touchscreen-swapped-x-y");
>
>         of_property_read_u16(node, "ti,settle-delay-usec",
>                              &pdata->settle_delay_usecs);
> --
> 2.5.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
H. Nikolaus Schaller Nov. 15, 2015, 10:54 a.m. UTC | #2
Am 15.11.2015 um 03:19 schrieb Rob Herring <robh+dt@kernel.org>:

> On Fri, Nov 13, 2015 at 2:35 PM, H. Nikolaus Schaller <hns@goldelico.com> wrote:
>> By this patch we still recognise the old binding ti,swap-xy in parallel to
>> the common binding touchscreen-swapped-x-y. This keeps compatibility
>> to older (out-of-tree) device tree binaries.
>> 
>> We do this in a separate patch so that it can be easily reverted in the
>> future to retire the old API. A notice is printed to remind developers
>> of using old API.
>> 
>> We also fix the bindings name for all in-tree device tree sources in
>> a separate patch.
> 
> This one and patch 5 should be combined, so the series is bisectable.

Ok. We will loose the easy "revert single patch" option, but you are right that it is simpler if combined.
I will add a comment to source code that ti,swap-xy is deprecated and should be removed in the future.

> 
> Rob
> 
>> 
>> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
>> ---
>> drivers/input/touchscreen/ads7846.c | 6 +++++-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
>> index 4525f00..b9896fd 100644
>> --- a/drivers/input/touchscreen/ads7846.c
>> +++ b/drivers/input/touchscreen/ads7846.c
>> @@ -1259,7 +1259,11 @@ static const struct ads7846_platform_data *ads7846_probe_dt(struct device *dev)
>>        of_property_read_u16(node, "ti,vref-mv", &pdata->vref_mv);
>>        pdata->keep_vref_on = of_property_read_bool(node, "ti,keep-vref-on");
>> 
>> -       pdata->swap_xy = of_property_read_bool(node, "touchscreen-swapped-x-y");
>> +       pdata->swap_xy = of_property_read_bool(node, "ti,swap-xy");
>> +       if (pdata->swap_xy)
>> +               dev_notice(dev, "please update device tree to use touchscreen-swapped-x-y");
>> +       pdata->swap_xy |= of_property_read_bool(node,
>> +                                               "touchscreen-swapped-x-y");
>> 
>>        of_property_read_u16(node, "ti,settle-delay-usec",
>>                             &pdata->settle_delay_usecs);
>> --
>> 2.5.1
>> 

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 4525f00..b9896fd 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -1259,7 +1259,11 @@  static const struct ads7846_platform_data *ads7846_probe_dt(struct device *dev)
 	of_property_read_u16(node, "ti,vref-mv", &pdata->vref_mv);
 	pdata->keep_vref_on = of_property_read_bool(node, "ti,keep-vref-on");
 
-	pdata->swap_xy = of_property_read_bool(node, "touchscreen-swapped-x-y");
+	pdata->swap_xy = of_property_read_bool(node, "ti,swap-xy");
+	if (pdata->swap_xy)
+		dev_notice(dev, "please update device tree to use touchscreen-swapped-x-y");
+	pdata->swap_xy |= of_property_read_bool(node,
+						"touchscreen-swapped-x-y");
 
 	of_property_read_u16(node, "ti,settle-delay-usec",
 			     &pdata->settle_delay_usecs);