arm: am335x: am335x evm sk: add touchscreen DT node
Subsystems (3)
cover arm: am335x: am335x evm sk: add touchscreen DT node
Hi,
the following patches fix a typo on TSC/ADC DT binding while maintaining backwards compatibility and add support for the touchscreen available on am335x-evm-sk.
Patches have been tested with am335x-evm-sk with a couple patches (already floating around the mailing lists) to get that board booting in mainline.
cheers
Felipe Balbi (2):
input: touchscreen: fix spelling mistake in TSC/ADC DT binding
arm: dts: am335x sk: add touchscreen support
.../devicetree/bindings/input/touchscreen/ti-tsc-adc.txt | 2 +- arch/arm/boot/dts/am335x-evm.dts | 2 +- arch/arm/boot/dts/am335x-evmsk.dts | 10 ++++++++++ drivers/input/touchscreen/ti_am335x_tsc.c | 9 ++++++++- 4 files changed, 20 insertions(+), 3 deletions(-)
Signature · 1 line
1.8.4.GIT
PATCH 1/2 input: touchscreen: fix spelling mistake in TSC/ADC DT binding
There was a spelling mistake on TSC/ADC binding where "coordinate" was spelled as "coordiante".
We can't simply fix the error due to DT being an ABI, the approach taken was to first use correct spelling and if that fails, fallback to miss-spelled version.
It's unfortunate that has creeped into the tree.
--- .../devicetree/bindings/input/touchscreen/ti-tsc-adc.txt | 2 +- arch/arm/boot/dts/am335x-evm.dts | 2 +- drivers/input/touchscreen/ti_am335x_tsc.c | 9 ++++++++- 3 files changed, 10 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt +1 -1
@@ -6,7 +6,7 @@ Required properties: ti,wires: Wires refer to application modes i.e. 4/5/8 wire touchscreen support on the platform. ti,x-plate-resistance: X plate resistance - ti,coordiante-readouts: The sequencer supports a total of 16 + ti,coordinate-readouts: The sequencer supports a total of 16 programmable steps each step is used to read a single coordinate. A single readout is enough but multiple reads can
arch/arm/boot/dts/am335x-evm.dts +1 -1
@@ -509,7 +509,7 @@ tsc { ti,wires = <4>; ti,x-plate-resistance = <200>; - ti,coordiante-readouts = <5>; + ti,coordinate-readouts = <5>; ti,wire-config = <0x00 0x11 0x22 0x33>; };
drivers/input/touchscreen/ti_am335x_tsc.c +8 -1
@@ -348,9 +348,16 @@ static int titsc_parse_dt(struct platform_device *pdev,if (err <0 )return err; - err =of_property_read_u32 (node,"ti,coordiante-readouts" , +/* +* try with new binding first. If it fails, still try with +* bogus, miss-spelled version. +*/ + err =of_property_read_u32 (node,"ti,coordinate-readouts" , &ts_dev->coordinate_readouts);if (err <0 ) + err =of_property_read_u32 (node,"ti,coordiante-readouts" , + &ts_dev->coordinate_readouts); +if (err <0 )return err; return of_property_read_u32_array(node, "ti,wire-config",
Signature · 1 line
1.8.4.GIT
Re: [PATCH 1/2] input: touchscreen: fix spelling mistake in TSC/ADC DT binding
Quoted 10 lines · Felipe Balbi
drivers/input/touchscreen/ti_am335x_tsc.c +1
-1@@ -348,9 +348,16 @@ static int titsc_parse_dt(struct platform_device *pdev,if (err <0 )return err; - err = of_property_read_u32(node, "ti,coordiante-readouts", +/*
drivers/input/touchscreen/ti_am335x_tsc.c static int titsc_parse_dt(struct platform_device *pdev, · line 361
Quoted 10 lines
drivers/input/touchscreen/ti_am335x_tsc.c +7
-0+* try with new binding first. If it fails, still try with +* bogus, miss-spelled version. +*/ + err =of_property_read_u32 (node,"ti,coordinate-readouts" , &ts_dev->coordinate_readouts);if (err <0 ) + err =of_property_read_u32 (node,"ti,coordiante-readouts" , + &ts_dev->coordinate_readouts); +if (err <0 )return err;
Thanks, very good. Do we keep this fallback for ever or just for a year or two?
drivers/input/touchscreen/ti_am335x_tsc.c static int titsc_parse_dt(struct platform_device *pdev, · line 363
Quoted 2 lines
drivers/input/touchscreen/ti_am335x_tsc.c +0
-0return of_property_read_u32_array(node, "ti,wire-config",
Sebastian
Re: [PATCH 1/2] input: touchscreen: fix spelling mistake in TSC/ADC DT binding
Hi,
Quoted 9 lines · Sebastian Andrzej Siewior
Quoted 8 lines · Felipe Balbi
drivers/input/touchscreen/ti_am335x_tsc.c +0
-0@@ -348,9 +348,16 @@ static int titsc_parse_dt(struct platform_device *pdev,if (err <0 )return err;
Quoted 15 lines
drivers/input/touchscreen/ti_am335x_tsc.c static int titsc_parse_dt(struct platform_device *pdev, · line 361
Quoted 12 lines
drivers/input/touchscreen/ti_am335x_tsc.c +8
-1- err =of_property_read_u32 (node,"ti,coordiante-readouts" , +/* +* try with new binding first. If it fails, still try with +* bogus, miss-spelled version. +*/ + err =of_property_read_u32 (node,"ti,coordinate-readouts" , &ts_dev->coordinate_readouts);if (err <0 ) + err =of_property_read_u32 (node,"ti,coordiante-readouts" , + &ts_dev->coordinate_readouts); +if (err <0 )return err;Thanks, very good. Do we keep this fallback for ever or just for a year or two?
That's for DT maintainers to decide but considering DT is an ABI, I guess we need to keep for 30 years or so :-p
Signature · 1 line
balbi
Re: [PATCH 1/2] input: touchscreen: fix spelling mistake in TSC/ADC DT binding
Quoted 28 lines · Felipe Balbi
Hi,
Quoted 9 lines · Sebastian Andrzej Siewior
Quoted 8 lines · Felipe Balbi
drivers/input/touchscreen/ti_am335x_tsc.c +0
-0@@ -348,9 +348,16 @@ static int titsc_parse_dt(struct platform_device *pdev,if (err <0 )return err;Quoted 15 lines
drivers/input/touchscreen/ti_am335x_tsc.c static int titsc_parse_dt(struct platform_device *pdev, · line 361
Quoted 12 lines
drivers/input/touchscreen/ti_am335x_tsc.c +8
-1- err =of_property_read_u32 (node,"ti,coordiante-readouts" , +/* +* try with new binding first. If it fails, still try with +* bogus, miss-spelled version. +*/ + err =of_property_read_u32 (node,"ti,coordinate-readouts" , &ts_dev->coordinate_readouts);if (err <0 ) + err =of_property_read_u32 (node,"ti,coordiante-readouts" , + &ts_dev->coordinate_readouts); +if (err <0 )return err;Thanks, very good. Do we keep this fallback for ever or just for a year or two?
Quoted 2 lines
That's for DT maintainers to decide but considering DT is an ABI, I guess we need to keep for 30 years or so :-p
We keep it as long as we have to. If no-one's relying on the typo by the next merge window, I see no reason we'd have to keep support for the typo beyond that. If someone's shipped a device with a dtb with the typo hard-coded into some ROM, that's another matter...
It might be worth printing a warning in the case of the typo'd version, suggesting correcting the DT. That will encourage anyone with a broken dt to get a fixed one.
Mark.
Re: [PATCH 1/2] input: touchscreen: fix spelling mistake in TSC/ADC DT binding
HI,
Quoted 26 lines · Mark Rutland
Quoted 26 lines · Sebastian Andrzej Siewior
Quoted 24 lines · Felipe Balbi
Quoted 10 lines
drivers/input/touchscreen/ti_am335x_tsc.c +1
-1@@ -348,9 +348,16 @@ static int titsc_parse_dt(struct platform_device *pdev,if (err <0 )return err; - err = of_property_read_u32(node, "ti,coordiante-readouts", +/* drivers/input/touchscreen/ti_am335x_tsc.c static int titsc_parse_dt(struct platform_device *pdev, · line 361
Quoted 10 lines
drivers/input/touchscreen/ti_am335x_tsc.c +7
-0+* try with new binding first. If it fails, still try with +* bogus, miss-spelled version. +*/ + err =of_property_read_u32 (node,"ti,coordinate-readouts" , &ts_dev->coordinate_readouts);if (err <0 ) + err =of_property_read_u32 (node,"ti,coordiante-readouts" , + &ts_dev->coordinate_readouts); +if (err <0 )return err;Thanks, very good. Do we keep this fallback for ever or just for a year or two?
Quoted 5 lines
Quoted 2 lines
That's for DT maintainers to decide but considering DT is an ABI, I guess we need to keep for 30 years or so :-p
We keep it as long as we have to. If no-one's relying on the typo by the next merge window, I see no reason we'd have to keep support for the
and how could you know that ? considering it's an ABI, how could you ever know that ?
Signature · 1 line
balbi
Re: [PATCH 1/2] input: touchscreen: fix spelling mistake in TSC/ADC DT binding
Quoted 29 lines · Felipe Balbi
HI,
Quoted 26 lines · Mark Rutland
Quoted 26 lines · Sebastian Andrzej Siewior
Quoted 24 lines · Felipe Balbi
Quoted 10 lines
drivers/input/touchscreen/ti_am335x_tsc.c +1
-1@@ -348,9 +348,16 @@ static int titsc_parse_dt(struct platform_device *pdev,if (err <0 )return err; - err = of_property_read_u32(node, "ti,coordiante-readouts", +/* drivers/input/touchscreen/ti_am335x_tsc.c static int titsc_parse_dt(struct platform_device *pdev, · line 361
Quoted 10 lines
drivers/input/touchscreen/ti_am335x_tsc.c +7
-0+* try with new binding first. If it fails, still try with +* bogus, miss-spelled version. +*/ + err =of_property_read_u32 (node,"ti,coordinate-readouts" , &ts_dev->coordinate_readouts);if (err <0 ) + err =of_property_read_u32 (node,"ti,coordiante-readouts" , + &ts_dev->coordinate_readouts); +if (err <0 )return err;Thanks, very good. Do we keep this fallback for ever or just for a year or two?
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
That's for DT maintainers to decide but considering DT is an ABI, I guess we need to keep for 30 years or so :-p
We keep it as long as we have to. If no-one's relying on the typo by the next merge window, I see no reason we'd have to keep support for the
and how could you know that ? considering it's an ABI, how could you ever know that ?
If you know that the only user of a binding is a dts for a particular product that you're in charge of, then you'd know the set of kernel + dtb combinations out there, and can judge.
If a bug is found in a driver such that it hasn't worked for a number of releases, and no-one's complained, the binding is clearly not in use and thus support for it can be removed.
If maintaining compatibility becomes too hard, and all users are happy to migrate to a newer dtb, then it's not necessary to maintain compatiblity for the old binding.
While we can't always remove existing bindings, there are cases where it's possible and appropriate. However, we should strive for compatibility for as long a term as possible.
Thanks,
Mark.
Re: [PATCH 1/2] input: touchscreen: fix spelling mistake in TSC/ADC DT binding
Hi,
Quoted 30 lines · Mark Rutland
Quoted 30 lines
Quoted 29 lines
Quoted 24 lines
Quoted 8 lines
Quoted 8 lines
drivers/input/touchscreen/ti_am335x_tsc.c +0
-0@@ -348,9 +348,16 @@ static int titsc_parse_dt(struct platform_device *pdev,if (err <0 )return err;Quoted 15 lines
drivers/input/touchscreen/ti_am335x_tsc.c static int titsc_parse_dt(struct platform_device *pdev, · line 361
Quoted 12 lines
drivers/input/touchscreen/ti_am335x_tsc.c +8
-1- err =of_property_read_u32 (node,"ti,coordiante-readouts" , +/* +* try with new binding first. If it fails, still try with +* bogus, miss-spelled version. +*/ + err =of_property_read_u32 (node,"ti,coordinate-readouts" , &ts_dev->coordinate_readouts);if (err <0 ) + err =of_property_read_u32 (node,"ti,coordiante-readouts" , + &ts_dev->coordinate_readouts); +if (err <0 )return err;Thanks, very good. Do we keep this fallback for ever or just for a year or two?
Quoted 2 lines
That's for DT maintainers to decide but considering DT is an ABI, I guess we need to keep for 30 years or so :-p
We keep it as long as we have to. If no-one's relying on the typo by the next merge window, I see no reason we'd have to keep support for the
Quoted 6 lines
Quoted 2 lines
and how could you know that ? considering it's an ABI, how could you ever know that ?
If you know that the only user of a binding is a dts for a particular product that you're in charge of, then you'd know the set of kernel + dtb combinations out there, and can judge.
once the binding has made into mainline, it's next to impossible to figure out who has downloaded a tarball containing that driver and made a product out of it.
Besides keeping that check in the driver won't hurt at all in the long run. I would give it at least until 4.0 before thinking about removing, and that might still not be enough time.
Signature · 1 line
balbi
Re: [PATCH 1/2] input: touchscreen: fix spelling mistake in TSC/ADC DT binding
Quoted 40 lines · Felipe Balbi
Hi,
Quoted 30 lines · Mark Rutland
Quoted 30 lines
Quoted 29 lines
Quoted 24 lines
Quoted 8 lines
Quoted 8 lines
drivers/input/touchscreen/ti_am335x_tsc.c +0
-0@@ -348,9 +348,16 @@ static int titsc_parse_dt(struct platform_device *pdev,if (err <0 )return err;Quoted 15 lines
drivers/input/touchscreen/ti_am335x_tsc.c static int titsc_parse_dt(struct platform_device *pdev, · line 361
Quoted 12 lines
drivers/input/touchscreen/ti_am335x_tsc.c +8
-1- err =of_property_read_u32 (node,"ti,coordiante-readouts" , +/* +* try with new binding first. If it fails, still try with +* bogus, miss-spelled version. +*/ + err =of_property_read_u32 (node,"ti,coordinate-readouts" , &ts_dev->coordinate_readouts);if (err <0 ) + err =of_property_read_u32 (node,"ti,coordiante-readouts" , + &ts_dev->coordinate_readouts); +if (err <0 )return err;Thanks, very good. Do we keep this fallback for ever or just for a year or two?
Quoted 2 lines
That's for DT maintainers to decide but considering DT is an ABI, I guess we need to keep for 30 years or so :-p
We keep it as long as we have to. If no-one's relying on the typo by the next merge window, I see no reason we'd have to keep support for the
Quoted 6 lines
Quoted 2 lines
and how could you know that ? considering it's an ABI, how could you ever know that ?
If you know that the only user of a binding is a dts for a particular product that you're in charge of, then you'd know the set of kernel + dtb combinations out there, and can judge.
Quoted 7 lines
once the binding has made into mainline, it's next to impossible to figure out who has downloaded a tarball containing that driver and made a product out of it.
Besides keeping that check in the driver won't hurt at all in the long run. I would give it at least until 4.0 before thinking about removing, and that might still not be enough time.
That sounds sensible to me. As mentioned before I'd recommend adding a warning for the typo now in the (possibly naïve) hope that it will encourage people to fix up their dts early.
Thanks,
Mark.
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/1 input: touchscreen: ti_am335x_tsc: warn about incorrect spelling
In the hopes that people run new kernels on their devices, let's add a warning message asking users to have their DTS file fixed.
The goal is that by Linux 4.0 we will be able to remove support for the bogus version of our touchscreen's DTS.
---
Here you go, I've added your Suggested-by Mark, if you wish I can remove or change to something else.
cheers
drivers/input/touchscreen/ti_am335x_tsc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/input/touchscreen/ti_am335x_tsc.c +4 -1
@@ -354,9 +354,12 @@ static int titsc_parse_dt(struct platform_device *pdev,*/ err =of_property_read_u32 (node,"ti,coordinate-readouts" , &ts_dev->coordinate_readouts); -if (err <0 ) +if (err <0 ) { +dev_warn (&pdev->dev,"please use 'ti,coordinate-readouts' instead\n" ); err =of_property_read_u32 (node,"ti,coordiante-readouts" , &ts_dev->coordinate_readouts); + } +if (err <0 )return err;
Signature · 1 line
1.8.4.GIT
Re: [PATCH] input: touchscreen: ti_am335x_tsc: warn about incorrect spelling
Quoted 10 lines · Felipe Balbi
In the hopes that people run new kernels on their devices, let's add a warning message asking users to have their DTS file fixed.
The goal is that by Linux 4.0 we will be able to remove support for the bogus version of our touchscreen's DTS.
Suggested-by Mark Rutland <[email protected]>Signed-off-by Felipe Balbi <[email protected]>
Quoted 7 lines
---
Here you go, I've added your Suggested-by Mark, if you wish I can remove or change to something else.
cheers
Looks fine to me, feel free to add my Ack.
Thanks,
Mark.
Quoted 26 lines
drivers/input/touchscreen/ti_am335x_tsc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/input/touchscreen/ti_am335x_tsc.c +4
-1@@ -354,9 +354,12 @@ static int titsc_parse_dt(struct platform_device *pdev,*/ err =of_property_read_u32 (node,"ti,coordinate-readouts" , &ts_dev->coordinate_readouts); -if (err <0 ) +if (err <0 ) { +dev_warn (&pdev->dev,"please use 'ti,coordinate-readouts' instead\n" ); err =of_property_read_u32 (node,"ti,coordiante-readouts" , &ts_dev->coordinate_readouts); + } +if (err <0 )return err;Signature · 1 line
1.8.4.GIT
Re: [PATCH] input: touchscreen: ti_am335x_tsc: warn about incorrect spelling
In reply to Felipe BalbiHi,
Here's another patch which has been pending for months.
Quoted 42 lines · Felipe Balbi
In the hopes that people run new kernels on their devices, let's add a warning message asking users to have their DTS file fixed.
The goal is that by Linux 4.0 we will be able to remove support for the bogus version of our touchscreen's DTS.
Suggested-by Mark Rutland <[email protected]>Signed-off-by Felipe Balbi <[email protected]>---
Here you go, I've added your Suggested-by Mark, if you wish I can remove or change to something else.
cheers
drivers/input/touchscreen/ti_am335x_tsc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/input/touchscreen/ti_am335x_tsc.c +4
-1@@ -354,9 +354,12 @@ static int titsc_parse_dt(struct platform_device *pdev,*/ err =of_property_read_u32 (node,"ti,coordinate-readouts" , &ts_dev->coordinate_readouts); -if (err <0 ) +if (err <0 ) { +dev_warn (&pdev->dev,"please use 'ti,coordinate-readouts' instead\n" ); err =of_property_read_u32 (node,"ti,coordiante-readouts" , &ts_dev->coordinate_readouts); + } +if (err <0 )return err;Signature · 1 line
1.8.4.GIT
Signature · 1 line
balbi
Dmitry Torokhov
maintainerRe: [PATCH] input: touchscreen: ti_am335x_tsc: warn about incorrect spelling
Quoted 3 lines · Felipe Balbi
Hi,
Here's another patch which has been pending for months.
Sorry, lost track of this one, applied.
Quoted 47 lines · Felipe Balbi
Quoted 42 lines
In the hopes that people run new kernels on their devices, let's add a warning message asking users to have their DTS file fixed.
The goal is that by Linux 4.0 we will be able to remove support for the bogus version of our touchscreen's DTS.
Suggested-by Mark Rutland <[email protected]>Signed-off-by Felipe Balbi <[email protected]>---
Here you go, I've added your Suggested-by Mark, if you wish I can remove or change to something else.
cheers
drivers/input/touchscreen/ti_am335x_tsc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/input/touchscreen/ti_am335x_tsc.c +4
-1@@ -354,9 +354,12 @@ static int titsc_parse_dt(struct platform_device *pdev,*/ err =of_property_read_u32 (node,"ti,coordinate-readouts" , &ts_dev->coordinate_readouts); -if (err <0 ) +if (err <0 ) { +dev_warn (&pdev->dev,"please use 'ti,coordinate-readouts' instead\n" ); err =of_property_read_u32 (node,"ti,coordiante-readouts" , &ts_dev->coordinate_readouts); + } +if (err <0 )return err;Signature · 1 line
1.8.4.GITSignature · 1 line
balbi
Signature · 1 line
Dmitry
Re: [PATCH] input: touchscreen: ti_am335x_tsc: warn about incorrect spelling
Quoted 6 lines · Dmitry Torokhov
Quoted 3 lines · Felipe Balbi
Hi,
Here's another patch which has been pending for months.
Sorry, lost track of this one, applied.
Thank you
Signature · 1 line
balbi
PATCH 2/2 arm: dts: am335x sk: add touchscreen support
In reply to Felipe BalbiAdd missing nodes for the touchscreen available
on AM335x EVM SK.
--- arch/arm/boot/dts/am335x-evmsk.dts | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/arm/boot/dts/am335x-evmsk.dts +10 -0
@@ -419,3 +419,13 @@ phy_id = <&davinci_mdio>, <1>; phy-mode = "rgmii-txid"; }; + +&tscadc { + status = "okay"; + tsc { + ti,wires = <4>; + ti,x-plate-resistance = <200>; + ti,coordinate-readouts = <5>; + ti,wire-config = <0x00 0x11 0x22 0x33>; + }; +};
Signature · 1 line
1.8.4.GIT
A message that is not in the archive (sent off-list or not yet received): 1382386404-6659-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org
Dmitry Torokhov
AppliedQuoted 11 lines · Felipe Balbi
Hi,
the following patches fix a typo on TSC/ADC DT binding while maintaining backwards compatibility and add support for the touchscreen available on am335x-evm-sk.
Patches have been tested with am335x-evm-sk with a couple patches (already floating around the mailing lists) to get that board booting in mainline.
cheers
Applied, thank you.
Quoted 14 lines
Felipe Balbi (2):
input: touchscreen: fix spelling mistake in TSC/ADC DT binding
arm: dts: am335x sk: add touchscreen support.../devicetree/bindings/input/touchscreen/ti-tsc-adc.txt | 2 +- arch/arm/boot/dts/am335x-evm.dts | 2 +- arch/arm/boot/dts/am335x-evmsk.dts | 10 ++++++++++ drivers/input/touchscreen/ti_am335x_tsc.c | 9 ++++++++- 4 files changed, 20 insertions(+), 3 deletions(-)Signature · 1 line
1.8.4.GIT
Signature · 5 lines
Dmitry -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html