Re: [PATCH v10 02/11] reset: Add Realtek basic reset support

Philipp Zabel <[email protected]>
Newsgroups org.kernel.vger.linux-clk,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Mo, 2026-07-13 at 23:56 +0800, Yu-Chun Lin wrote:
> From: Cheng-Yu Lee <[email protected]>
> 
> Define the reset operations backed by a regmap-based register interface

Correct. Maybe mention the optional write-enable bit or stat that this
is for Realtek SoC reset controllers, but that's it.

> and prepare the reset controller to be registered through the reset
> framework.

This part is deprecated.

> Since the reset controllers on Realtek SoCs often share the same register
> space with the clock controllers, this common framework is designed to
> extract the regmap and device tree node from the parent device
> (e.g., an auxiliary device parent).

And this as well, it can just be removed.

> 
> Signed-off-by: Cheng-Yu Lee <[email protected]>
> Co-developed-by: Yu-Chun Lin <[email protected]>
> Signed-off-by: Yu-Chun Lin <[email protected]>
> ---
> Changes in v10:
> - Export 'rtk_reset_ops' directly instead of using a wrapper function,
> allowing callers to assign regmap, ops, dev, and of_node individually.
> - Replacing 'regmap_update_bits()' with 'regmap_set_bits()'.
> - Change variable types.
> ---
>  MAINTAINERS                              |  1 +
>  drivers/reset/Kconfig                    |  1 +
>  drivers/reset/Makefile                   |  1 +
>  drivers/reset/realtek/Kconfig            |  8 +++
>  drivers/reset/realtek/Makefile           |  2 +
>  drivers/reset/realtek/reset-rtk-common.c | 75 ++++++++++++++++++++++++
>  drivers/reset/realtek/reset-rtk-common.h | 28 +++++++++
>  7 files changed, 116 insertions(+)
>  create mode 100644 drivers/reset/realtek/Kconfig
>  create mode 100644 drivers/reset/realtek/Makefile
>  create mode 100644 drivers/reset/realtek/reset-rtk-common.c
>  create mode 100644 drivers/reset/realtek/reset-rtk-common.h
> 
[...]
> diff --git a/drivers/reset/realtek/reset-rtk-common.c b/drivers/reset/realtek/reset-rtk-common.c
> new file mode 100644
> index 000000000000..4d5ec2b0416d
> --- /dev/null
> +++ b/drivers/reset/realtek/reset-rtk-common.c
> @@ -0,0 +1,75 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (C) 2019-2026 Realtek Semiconductor Corporation
> + */
> +
> +#include <linux/device.h>
> +#include <linux/export.h>
> +#include <linux/module.h>
> +#include <linux/of.h>

Drop unused headers.

[...]

> diff --git a/drivers/reset/realtek/reset-rtk-common.h b/drivers/reset/realtek/reset-rtk-common.h
> new file mode 100644
> index 000000000000..dce6724dd50c
> --- /dev/null
> +++ b/drivers/reset/realtek/reset-rtk-common.h
> @@ -0,0 +1,28 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Copyright (C) 2026 Realtek Semiconductor Corporation
> + * Author: Yu-Chun Lin <[email protected]>
> + */
> +
> +#ifndef __RESET_REALTEK_COMMON_H
> +#define __RESET_REALTEK_COMMON_H
> +
> +#include <linux/reset-controller.h>

#include <linux/types.h>

for bool and u32.
It's included indirectly via reset-controller.h, but IWYU.

> +
> +struct regmap;
> +
> +struct rtk_reset_desc {
> +	u32 ofs;
> +	u32 bit;
> +	bool write_en;
> +};
> +
> +struct rtk_reset_data {
> +	struct reset_controller_dev rcdev;
> +	const struct rtk_reset_desc *descs;
> +	struct regmap *regmap;
> +};
> +
> +extern const struct reset_control_ops rtk_reset_ops;
> +
> +#endif /* __RESET_REALTEK_COMMON_H */

With these issues addressed,

Reviewed-by: Philipp Zabel <[email protected]>

regards
Philipp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.