From: Yegor Yefremov <redacted>
This is an attempt to revive DT support for TI tps6507x that was started
in 2013 [1], [2].
Current changes:
- remove tsc node
- add /bits/ 16 to for 16-bit values
- rework bindings description, i.e. all properties are optional
Histor of original changes:
Changes since V3:
- Rebased on top of Dmitry's changes
- Removed error handling for optional DT properties
Changes since V2:
- Updated tps6507x documentation.
- Removed unnecessary code.
Changes since V1:
- Updated tps6507x documentation.
- Updated commit message.
- return proper error value in absence platform and DT data
for touchscreen.
[1] https://www.spinics.net/lists/devicetree/msg09388.html
[2] https://patchwork.kernel.org/patch/2324441/
Yegor Yefremov (3):
tps6507x-ts: update to devm_* API
tps6507x-ts: add DT support
tps6507x-ts: add DT bindings description
Documentation/devicetree/bindings/mfd/tps6507x.txt | 30 +++++++-
drivers/input/touchscreen/tps6507x-ts.c | 79 ++++++++++++----------
2 files changed, 73 insertions(+), 36 deletions(-)
--
2.1.4
From: Yegor Yefremov <redacted>
Update the code to use devm_* API so that driver
core will manage resources.
Signed-off-by: Yegor Yefremov <redacted>
---
drivers/input/touchscreen/tps6507x-ts.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
@@ -1,4 +1,8 @@-TPS6507x Power Management Integrated Circuit+TPS6507x Multifunctional Device.++Features provided by TPS6507x:+ 1. Power Management Integrated Circuit.+ 2. Touch-Screen. Required properties: - compatible: "ti,tps6507x"
@@ -30,6 +34,23 @@ Regulator Optional properties: 1: If defdcdc pin of DCDC2/DCDC3 is driven HIGH. If this property is not defined, it defaults to 0 (not enabled).+Touchscreen Optional properties:+- ti,poll-period: Time at which touch input is getting sampled in ms.+ Default value: 30 ms.+- ti,min-pressure: Minimum pressure value to trigger touch.+ Default value: 0x30.+ This property has to be a '/bits/ 16' value++Entries below describe the input_id structure [1] for the touch device:+- ti,vendor: Touchscreen vendor id.+ This property has to be a '/bits/ 16' value+- ti,product: Touchscreen product id.+ This property has to be a '/bits/ 16' value+- ti,version: Touchscreen version id.+ This property has to be a '/bits/ 16' value++[1] include/uapi/linux/input.h+ Example: pmu: tps6507x@48 {
Anything but u32 is better avoided in DT as it requires special
annotation which is easily forgotten.
I also would prefer if we switched to generic device properties and
retired the static init data.
I've looked at other touchscreen drivers and this structure seems to
be filled mostly for the RS232 connected drivers. So I'd suggest just
to leave vendor, product and version at 0 and not provide these values
via DT. At least tslib and hence Qt is working without these values
set.
@Kevin: so far the only user of this touch driver is da850-evm board.
Can we drop the values for the id structure? Btw. what else is needed
to remove arch/arm/mach-davinci/board-da850-evm.c completely?
Yegor
quoted
+ }
+}
+
static int tps6507x_ts_probe(struct platform_device *pdev)
{
struct tps6507x_dev *tps6507x_dev = dev_get_drvdata(pdev->dev.parent);
- const struct tps6507x_board *tps_board;
- const struct touchscreen_init_data *init_data;
struct tps6507x_ts *tsc;
struct input_polled_dev *poll_dev;
struct input_dev *input_dev;
int error;
- /*
- * tps_board points to pmic related constants
- * coming from the board-evm file.
- */
- tps_board = dev_get_platdata(tps6507x_dev->dev);
- if (!tps_board) {
- dev_err(tps6507x_dev->dev,
- "Could not find tps6507x platform data\n");
- return -ENODEV;
- }
-
- /*
- * init_data points to array of regulator_init structures
- * coming from the board-evm file.
- */
- init_data = tps_board->tps6507x_ts_init_data;
-
tsc = devm_kzalloc(&pdev->dev, sizeof(struct tps6507x_ts), GFP_KERNEL);
if (!tsc) {
dev_err(tps6507x_dev->dev, "failed to allocate driver data\n");
On Tue, Feb 28, 2017 at 7:57 PM, Dmitry Torokhov
[off-list ref] wrote:
On Fri, Feb 24, 2017 at 04:42:24PM +0100, yegorslists@googlemail.com wrote:
quoted
From: Yegor Yefremov <redacted>
Update the code to use devm_* API so that driver
core will manage resources.
Signed-off-by: Yegor Yefremov <redacted>
---
drivers/input/touchscreen/tps6507x-ts.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
On Fri, Feb 24, 2017 at 04:42:24PM +0100, yegorslists@googlemail.com wrote:
quoted hunk
From: Yegor Yefremov <redacted>
Update the code to use devm_* API so that driver
core will manage resources.
Signed-off-by: Yegor Yefremov <redacted>
---
drivers/input/touchscreen/tps6507x-ts.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
@@ -1,4 +1,8 @@-TPS6507x Power Management Integrated Circuit+TPS6507x Multifunctional Device.++Features provided by TPS6507x:+ 1. Power Management Integrated Circuit.+ 2. Touch-Screen. Required properties: - compatible: "ti,tps6507x"
@@ -30,6 +34,23 @@ Regulator Optional properties: 1: If defdcdc pin of DCDC2/DCDC3 is driven HIGH. If this property is not defined, it defaults to 0 (not enabled).+Touchscreen Optional properties:+- ti,poll-period: Time at which touch input is getting sampled in ms.+ Default value: 30 ms.+- ti,min-pressure: Minimum pressure value to trigger touch.+ Default value: 0x30.+ This property has to be a '/bits/ 16' value++Entries below describe the input_id structure [1] for the touch device:+- ti,vendor: Touchscreen vendor id.+ This property has to be a '/bits/ 16' value+- ti,product: Touchscreen product id.+ This property has to be a '/bits/ 16' value+- ti,version: Touchscreen version id.+ This property has to be a '/bits/ 16' value++[1] include/uapi/linux/input.h+
I think this should live in the touchscreen binding doc.