2020-10-16 20:13:38

by David Lechner

[permalink] [raw]
Subject: [PATCH] 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.

Signed-off-by: David Lechner <[email protected]>
---
drivers/counter/ti-eqep.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/counter/ti-eqep.c b/drivers/counter/ti-eqep.c
index fe2c6bb22133..e60aec225541 100644
--- a/drivers/counter/ti-eqep.c
+++ b/drivers/counter/ti-eqep.c
@@ -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)
--
2.25.1


2020-10-16 22:39:00

by William Breathitt Gray

[permalink] [raw]
Subject: Re: [PATCH] counter/ti-eqep: Fix regmap max_register

On Fri, Oct 16, 2020 at 02:58:37PM -0500, David Lechner 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.
>
> Signed-off-by: David Lechner <[email protected]>

Acked-by: William Breathitt Gray <[email protected]>

> ---
> drivers/counter/ti-eqep.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/counter/ti-eqep.c b/drivers/counter/ti-eqep.c
> index fe2c6bb22133..e60aec225541 100644
> --- a/drivers/counter/ti-eqep.c
> +++ b/drivers/counter/ti-eqep.c
> @@ -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)
> --
> 2.25.1
>


Attachments:
(No filename) (1.21 kB)
signature.asc (849.00 B)
Download all attachments

2020-10-18 12:32:33

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH] counter/ti-eqep: Fix regmap max_register

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.
>
> Signed-off-by: David Lechner <[email protected]>

Fixes tag please.

Thanks,

Jonathan

> ---
> drivers/counter/ti-eqep.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/counter/ti-eqep.c b/drivers/counter/ti-eqep.c
> index fe2c6bb22133..e60aec225541 100644
> --- a/drivers/counter/ti-eqep.c
> +++ b/drivers/counter/ti-eqep.c
> @@ -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)