counter/ti-eqep: Fix regmap max_register
authorDavid Lechner <david@lechnology.com>
Sun, 25 Oct 2020 16:51:22 +0000 (11:51 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 1 Nov 2020 17:17:31 +0000 (17:17 +0000)
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")
Signed-off-by: David Lechner <david@lechnology.com>
Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Link: https://lore.kernel.org/r/20201025165122.607866-1-david@lechnology.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/counter/ti-eqep.c

index e27771df8e2390c9cc1bc1113cffb2caf78d00f0..a60aee1a1a29150a94fd4a43d69f4154023baab4 100644 (file)
@@ -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)