Message ID | 20230516230051.14846-1-shreeya.patel@collabora.com |
---|---|
Headers | show |
Series | RK3588 ADC support | expand |
On 17/05/2023 01:00, Shreeya Patel wrote: > Add rockchip,rk3588-saradc compatible string. > > Signed-off-by: Shreeya Patel <shreeya.patel@collabora.com> > --- > Documentation/devicetree/bindings/iio/adc/rockchip-saradc.yaml | 1 + Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof
Il 17/05/23 01:00, Shreeya Patel ha scritto: > Use of_device_get_match_data() to simplify the code. > > Signed-off-by: Shreeya Patel <shreeya.patel@collabora.com> > --- > drivers/iio/adc/rockchip_saradc.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c > index 05b66eff9a44..05ea823a8f16 100644 > --- a/drivers/iio/adc/rockchip_saradc.c > +++ b/drivers/iio/adc/rockchip_saradc.c > @@ -408,10 +408,10 @@ static void rockchip_saradc_regulator_unreg_notifier(void *data) > > static int rockchip_saradc_probe(struct platform_device *pdev) > { > + const struct rockchip_saradc_data *match_data; s/match_data/data/g maybe? Regardless of that, Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> > struct rockchip_saradc *info = NULL; > struct device_node *np = pdev->dev.of_node; > struct iio_dev *indio_dev = NULL; > - const struct of_device_id *match; > int ret; > int irq; > > @@ -425,13 +425,13 @@ static int rockchip_saradc_probe(struct platform_device *pdev) > } > info = iio_priv(indio_dev); > > - match = of_match_device(rockchip_saradc_match, &pdev->dev); > - if (!match) { > + match_data = of_device_get_match_data(&pdev->dev); > + if (!match_data) { > dev_err(&pdev->dev, "failed to match device\n"); > return -ENODEV; > } > > - info->data = match->data; > + info->data = match_data; > > /* Sanity check for possible later IP variants with more channels */ > if (info->data->num_channels > SARADC_MAX_CHANNELS) {
On Wed, 17 May 2023 04:30:44 +0530 Shreeya Patel <shreeya.patel@collabora.com> wrote: > This patch series adds ADC support for RK3588 and updates > the DT bindings for the same. > > To test ADC support on Rock 5B board, a voltage divider circuit > was created using the gpio pin 22 ( SARADC_IN4 ) and few more > tests were ran for testing the buffer and trigger using the > iio_generic_buffer tool. > > Shreeya Patel (7): > iio: adc: rockchip_saradc: Add support for RK3588 > iio: adc: rockchip_saradc: Make use of devm_clk_get_enabled > iio: adc: rockchip_saradc: Use of_device_get_match_data > iio: adc: rockchip_saradc: Match alignment with open parenthesis > iio: adc: rockchip_saradc: Use dev_err_probe > arm64: dts: rockchip: Add DT node for ADC support in RK3588 > dt-bindings: iio: adc: Add rockchip,rk3588-saradc string > > .../bindings/iio/adc/rockchip-saradc.yaml | 1 + > arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 12 + > drivers/iio/adc/rockchip_saradc.c | 260 ++++++++++-------- > 3 files changed, 164 insertions(+), 109 deletions(-) > Patches I haven't commented on all look fine to me. Thanks, Jonathan