Skip to contentSkip to conversation

Input: tsc2007 - Read "ti,poll-period" as u32

PATCH RESEND Applied Rob Herring (Arm) 2 participants 4 messages Aug 31 – Sep 14

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 Input: tsc2007 - Read "ti,poll-period" as u32

The "ti,poll-period" property is documented as a normal uint32 cell. The driver used a u64 helper, which makes the helper type disagree with the schema even though the stored value is still small.

Read "ti,poll-period" with the u32 helper matching the documented DT cell size.

Assisted-by Codex:gpt-5-5
---
 drivers/input/touchscreen/tsc2007_core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/input/touchscreen/tsc2007_core.c +2 -3
index e4d7da0f4434..e2f49b37e18c 100644
@@ -221,7 +221,6 @@ static int tsc2007_get_pendown_state_gpio(struct device *dev)
 static int tsc2007_probe_properties(struct device *dev, struct tsc2007 *ts)
 {
 	u32 val32;
-	u64 val64;
 
 	if (!device_property_read_u32(dev, "ti,max-rt", &val32))
 		ts->max_rt = val32;
@@ -237,8 +236,8 @@ static int tsc2007_probe_properties(struct device *dev, struct tsc2007 *ts)
 	if (!device_property_read_u32(dev, "ti,fuzzz", &val32))
 		ts->fuzzz = val32;
 
-	if (!device_property_read_u64(dev, "ti,poll-period", &val64))
-		ts->poll_period = msecs_to_jiffies(val64);
+	if (!device_property_read_u32(dev, "ti,poll-period", &val32))
+		ts->poll_period = msecs_to_jiffies(val32);
 	else
 		ts->poll_period = msecs_to_jiffies(1);
 
Signature · 1 line
2.53.0
maintainer
#1 lore raw

Hi Rob,

Quoted 26 lines · Rob Herring (Arm)

The "ti,poll-period" property is documented as a normal uint32 cell. The driver used a u64 helper, which makes the helper type disagree with the schema even though the stored value is still small.

Read "ti,poll-period" with the u32 helper matching the documented DT cell size.

Assisted-by Codex:gpt-5-5
---
 drivers/input/touchscreen/tsc2007_core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/input/touchscreen/tsc2007_core.c +0 -1
index e4d7da0f4434..e2f49b37e18c 100644
@@ -221,7 +221,6 @@ static int tsc2007_get_pendown_state_gpio(struct device *dev)
 static int tsc2007_probe_properties(struct device *dev, struct tsc2007 *ts)
 {
 	u32 val32;
-	u64 val64;
 
 	if (!device_property_read_u32(dev, "ti,max-rt", &val32))
 		ts->max_rt = val32;

drivers/input/touchscreen/tsc2007_core.c static int tsc2007_probe_properties(struct device *dev, struct tsc2007 *ts) · line 239

Quoted 6 lines
drivers/input/touchscreen/tsc2007_core.c +1 -2
@@ -237,8 +236,8 @@ static int tsc2007_probe_properties(struct device *dev, struct tsc2007 *ts)
 	if (!device_property_read_u32(dev, "ti,fuzzz", &val32))
 		ts->fuzzz = val32;
 
-	if (!device_property_read_u64(dev, "ti,poll-period", &val64))
-		ts->poll_period = msecs_to_jiffies(val64);
+	if (!device_property_read_u32(dev, "ti,poll-period", &val32))

Do we need to handle -EOVERFLOW and keep compatibility with device trees that used /64/ to match driver implementation? Or we expect that there were/are none?

Thanks.

Signature · 1 line
Dmitry
#2 lore raw
Quoted 32 lines · Dmitry Torokhov

Hi Rob,

Quoted 29 lines · Rob Herring (Arm)

The "ti,poll-period" property is documented as a normal uint32 cell. The driver used a u64 helper, which makes the helper type disagree with the schema even though the stored value is still small.

Read "ti,poll-period" with the u32 helper matching the documented DT cell size.

Assisted-by Codex:gpt-5-5
---
 drivers/input/touchscreen/tsc2007_core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/input/touchscreen/tsc2007_core.c +0 -1
index e4d7da0f4434..e2f49b37e18c 100644
@@ -221,7 +221,6 @@ static int tsc2007_get_pendown_state_gpio(struct device *dev)
 static int tsc2007_probe_properties(struct device *dev, struct tsc2007 *ts)
 {
 	u32 val32;
-	u64 val64;
 
 	if (!device_property_read_u32(dev, "ti,max-rt", &val32))
 		ts->max_rt = val32;
@@ -237,8 +236,8 @@ static int tsc2007_probe_properties(struct device *dev, struct tsc2007 *ts)
 	if (!device_property_read_u32(dev, "ti,fuzzz", &val32))
 		ts->fuzzz = val32;
 
Quoted 7 lines

drivers/input/touchscreen/tsc2007_core.c static int tsc2007_probe_properties(struct device *dev, struct tsc2007 *ts) · line 239

Quoted 3 lines
drivers/input/touchscreen/tsc2007_core.c +1 -2
-	if (!device_property_read_u64(dev, "ti,poll-period", &val64))
-		ts->poll_period = msecs_to_jiffies(val64);
+	if (!device_property_read_u32(dev, "ti,poll-period", &val32))

Do we need to handle -EOVERFLOW and keep compatibility with device trees that used /64/ to match driver implementation? Or we expect that there were/are none?

I suspect there aren't any users. Nothing upstream for sure and there never was. We could probably just delete the property.

Rob

maintainer Applied
#3 lore raw
Quoted 41 lines · Rob Herring
Quoted 32 lines · Dmitry Torokhov

Hi Rob,

Quoted 29 lines · Rob Herring (Arm)

The "ti,poll-period" property is documented as a normal uint32 cell. The driver used a u64 helper, which makes the helper type disagree with the schema even though the stored value is still small.

Read "ti,poll-period" with the u32 helper matching the documented DT cell size.

Assisted-by Codex:gpt-5-5
---
 drivers/input/touchscreen/tsc2007_core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/input/touchscreen/tsc2007_core.c +0 -1
index e4d7da0f4434..e2f49b37e18c 100644
@@ -221,7 +221,6 @@ static int tsc2007_get_pendown_state_gpio(struct device *dev)
 static int tsc2007_probe_properties(struct device *dev, struct tsc2007 *ts)
 {
 	u32 val32;
-	u64 val64;
 
 	if (!device_property_read_u32(dev, "ti,max-rt", &val32))
 		ts->max_rt = val32;
@@ -237,8 +236,8 @@ static int tsc2007_probe_properties(struct device *dev, struct tsc2007 *ts)
 	if (!device_property_read_u32(dev, "ti,fuzzz", &val32))
 		ts->fuzzz = val32;
 
Quoted 7 lines

drivers/input/touchscreen/tsc2007_core.c static int tsc2007_probe_properties(struct device *dev, struct tsc2007 *ts) · line 239

Quoted 3 lines
drivers/input/touchscreen/tsc2007_core.c +1 -2
-	if (!device_property_read_u64(dev, "ti,poll-period", &val64))
-		ts->poll_period = msecs_to_jiffies(val64);
+	if (!device_property_read_u32(dev, "ti,poll-period", &val32))

Do we need to handle -EOVERFLOW and keep compatibility with device trees that used /64/ to match driver implementation? Or we expect that there were/are none?

Quoted 2 lines

I suspect there aren't any users. Nothing upstream for sure and there never was. We could probably just delete the property.

Applied, thank you.

Signature · 1 line
Dmitry