Skip to content

Commit

Permalink
iio: adc: rockchip_saradc: fix bitmask for channels on SARADCv2
Browse files Browse the repository at this point in the history
[ Upstream commit b0a4546 ]

The SARADCv2 on RK3588 (the only SoC currently supported that has an
SARADCv2) selects the channel through the channel_sel bitfield which is
the 4 lowest bits, therefore the mask should be GENMASK(3, 0) and not
GENMASK(15, 0).

Fixes: 757953f ("iio: adc: rockchip_saradc: Add support for RK3588")
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240223-saradcv2-chan-mask-v1-1-84b06a0f623a@theobroma-systems.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
QSchulz authored and gregkh committed Apr 3, 2024
1 parent 83dcc4e commit 2349f90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/adc/rockchip_saradc.c
Expand Up @@ -52,7 +52,7 @@
#define SARADC2_START BIT(4)
#define SARADC2_SINGLE_MODE BIT(5)

#define SARADC2_CONV_CHANNELS GENMASK(15, 0)
#define SARADC2_CONV_CHANNELS GENMASK(3, 0)

struct rockchip_saradc;

Expand Down

0 comments on commit 2349f90

Please sign in to comment.