From: Sascha Hauer <s.hauer@pengutronix.de>
To: Alexander Shiyan <eagle.alexander923@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/3] aiodev: rockchip_saradc: Add reset control support
Date: Tue, 21 Jan 2025 09:27:32 +0100 [thread overview]
Message-ID: <Z49adH9-d8oiHrRK@pengutronix.de> (raw)
In-Reply-To: <20250116170154.104253-1-eagle.alexander923@gmail.com>
Hi Alexander,
On Thu, Jan 16, 2025 at 08:01:52PM +0300, Alexander Shiyan wrote:
> This adds reset control support for the Rockchip ADC driver.
>
> Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
> ---
> drivers/aiodev/rockchip_saradc.c | 17 ++++++++++++++++-
> 1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/aiodev/rockchip_saradc.c b/drivers/aiodev/rockchip_saradc.c
> index 3c5c0e94da..b31804fc39 100644
> --- a/drivers/aiodev/rockchip_saradc.c
> +++ b/drivers/aiodev/rockchip_saradc.c
> @@ -8,8 +8,9 @@
>
> #include <common.h>
> #include <aiodev.h>
> -#include <linux/clk.h>
> #include <regulator.h>
> +#include <linux/clk.h>
> +#include <linux/reset.h>
>
> #define SARADC_DATA 0x00
>
> @@ -37,6 +38,7 @@ struct rockchip_saradc_data {
> struct clk *pclk;
> struct aiodevice aiodev;
> struct aiochannel *channels;
> + struct reset_control *reset;
> };
>
> static inline void rockchip_saradc_reg_wr(struct rockchip_saradc_data *data,
> @@ -51,6 +53,13 @@ static inline u32 rockchip_saradc_reg_rd(struct rockchip_saradc_data *data,
> return readl(data->base + reg);
> }
>
> +static void rockchip_saradc_reset_controller(struct reset_control *reset)
> +{
> + reset_control_assert(reset);
> + udelay(20);
> + reset_control_deassert(reset);
> +}
> +
> static int rockchip_saradc_read(struct aiochannel *chan, int *val)
> {
> struct rockchip_saradc_data *data;
> @@ -163,14 +172,20 @@ static int rockchip_saradc_probe(struct device *dev)
>
> rockchip_saradc_reg_wr(data, 0, SARADC_CTRL);
>
> + data->reset = reset_control_get(dev, "saradc-apb");
reset_control_get() might return an error pointer. You need to check
that before passing it to reset_control_assert().
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
prev parent reply other threads:[~2025-01-21 8:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-16 17:01 Alexander Shiyan
2025-01-16 17:01 ` [PATCH 2/3] aiodev: rockchip_saradc: Prepare driver to add support for other SARADC variants Alexander Shiyan
2025-01-16 17:01 ` [PATCH 3/3] aiodev: rockchip_saradc: Add support for RK3588 Alexander Shiyan
2025-01-21 8:27 ` Sascha Hauer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z49adH9-d8oiHrRK@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=eagle.alexander923@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox