Skip to content

Commit

Permalink
counter/ti-eqep: Fix regmap max_register
Browse files Browse the repository at this point in the history
[ Upstream commit 271b339 ]

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: f213729 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
dlech authored and gregkh committed Nov 24, 2020
1 parent d3d9a13 commit 4848d59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/counter/ti-eqep.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,15 +368,15 @@ 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 = {
.name = "16-bit",
.reg_bits = 16,
.val_bits = 16,
.reg_stride = 2,
.max_register = 0x1e,
.max_register = QCPRDLAT,
};

static int ti_eqep_probe(struct platform_device *pdev)
Expand Down

0 comments on commit 4848d59

Please sign in to comment.