Skip to contentSkip to conversation

counter/ti-eqep: Fix regmap max_register

PATCH Superseded David Lechner 3 participants 3 messages Oct 16, 2020 – Oct 18, 2020

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

David Lechner

author reviewer
#0 lore raw

PATCH 1/1 counter/ti-eqep: Fix regmap max_register

The values given were the offset of the register after the last register instead of the actual last register in each range. Fix by using the correct last register of each range.

---
 drivers/counter/ti-eqep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/counter/ti-eqep.c +2 -2
index fe2c6bb22133..e60aec225541 100644
@@ -798,7 +798,7 @@ static const struct regmap_config ti_eqep_regmap32_config = {
 	.reg_bits = 32,
 	.val_bits = 32,
 	.reg_stride = 4,
-	.max_register = 0x24,
+	.max_register = QUPRD,
 };
 
 static const struct regmap_config ti_eqep_regmap16_config = {
@@ -806,7 +806,7 @@ static const struct regmap_config ti_eqep_regmap16_config = {
 	.reg_bits = 16,
 	.val_bits = 16,
 	.reg_stride = 2,
-	.max_register = 0x1e,
+	.max_register = QCPRDLAT,
 };
 
 static int ti_eqep_probe(struct platform_device *pdev)
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · David Lechner

The values given were the offset of the register after the last register instead of the actual last register in each range. Fix by using the correct last register of each range.

Quoted 29 lines
---
 drivers/counter/ti-eqep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/counter/ti-eqep.c +2 -2
index fe2c6bb22133..e60aec225541 100644
@@ -798,7 +798,7 @@ static const struct regmap_config ti_eqep_regmap32_config = {
 	.reg_bits = 32,
 	.val_bits = 32,
 	.reg_stride = 4,
-	.max_register = 0x24,
+	.max_register = QUPRD,
 };
 
 static const struct regmap_config ti_eqep_regmap16_config = {
@@ -806,7 +806,7 @@ static const struct regmap_config ti_eqep_regmap16_config = {
 	.reg_bits = 16,
 	.val_bits = 16,
 	.reg_stride = 2,
-	.max_register = 0x1e,
+	.max_register = QCPRDLAT,
 };
 
 static int ti_eqep_probe(struct platform_device *pdev)
Signature · 1 line
2.25.1
maintainer
#2 lore raw
In reply to David Lechner
Quoted 5 lines · On Fri, 16 Oct 2020 14:58:37 -0500 David Lechner <[email protected]> wrote:

The values given were the offset of the register after the last register instead of the actual last register in each range. Fix by using the correct last register of each range.

Fixes tag please.

Thanks,

Jonathan

Quoted 26 lines
---
 drivers/counter/ti-eqep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/counter/ti-eqep.c +2 -2
index fe2c6bb22133..e60aec225541 100644
@@ -798,7 +798,7 @@ static const struct regmap_config ti_eqep_regmap32_config = {
 	.reg_bits = 32,
 	.val_bits = 32,
 	.reg_stride = 4,
-	.max_register = 0x24,
+	.max_register = QUPRD,
 };
 
 static const struct regmap_config ti_eqep_regmap16_config = {
@@ -806,7 +806,7 @@ static const struct regmap_config ti_eqep_regmap16_config = {
 	.reg_bits = 16,
 	.val_bits = 16,
 	.reg_stride = 2,
-	.max_register = 0x1e,
+	.max_register = QCPRDLAT,
 };
 
 static int ti_eqep_probe(struct platform_device *pdev)