Skip to contentSkip to conversation

counter/ti-eqep: Fix regmap max_register

PATCH Applied David Lechner 2 participants 2 messages Oct 25, 2020 – Nov 1, 2020

Subsystems (3)
lore
Share & tools
lore

David Lechner

author reviewer
#0 lore raw

PATCH v2 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.

Fixes f213729f6796 ("counter: new TI eQEP driver")

---

v2 changes:
* add Fixes: tag
* picked up Acked-by:

 drivers/counter/ti-eqep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/counter/ti-eqep.c +2 -2
index 1ff07faef27f..5d6470968d2c 100644
@@ -368,7 +368,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 = {
@@ -376,7 +376,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 Applied
#1 lore raw
Quoted 7 lines · On Sun, 25 Oct 2020 11:51:22 -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 f213729f6796 ("counter: new TI eQEP driver")

Applied to the fixes-togreg branch of iio.git and marked for stable.

Thanks,

Jonathan

Quoted 31 lines

---

v2 changes:
* add Fixes: tag
* picked up Acked-by:

 drivers/counter/ti-eqep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/counter/ti-eqep.c +2 -2
index 1ff07faef27f..5d6470968d2c 100644
@@ -368,7 +368,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 = {
@@ -376,7 +376,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)