[PATCH v5 4/6] reset: imx8mp-audiomix: Extend the driver usage

Philipp Zabel p.zabel at pengutronix.de
Fri Nov 14 08:02:11 PST 2025


On Fr, 2025-11-14 at 05:37 -0800, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea at nxp.com>
> 
> Switch to per-device reset map to allow reusing the driver for other NXP
> block control IPs.
> 
> Reviewed-by: Daniel Baluta <daniel.baluta at nxp.com>
> Reviewed-by: Frank Li <Frank.Li at nxp.com>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea at nxp.com>
> ---
>  drivers/reset/reset-imx8mp-audiomix.c | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/reset/reset-imx8mp-audiomix.c b/drivers/reset/reset-imx8mp-audiomix.c
> index 35df9bd5f71a..d3396f37d1ff 100644
> --- a/drivers/reset/reset-imx8mp-audiomix.c
> +++ b/drivers/reset/reset-imx8mp-audiomix.c
> @@ -24,7 +24,12 @@ struct imx8mp_reset_map {
>  	bool active_low;
>  };
>  
> -static const struct imx8mp_reset_map reset_map[] = {
> +struct imx8mp_reset_info {
> +	const struct imx8mp_reset_map *map;
> +	int num_lines;
> +};
> +
> +static const struct imx8mp_reset_map imx8mp_reset_map[] = {
>  	[IMX8MP_AUDIOMIX_EARC_RESET] = {
>  		.offset	= IMX8MP_AUDIOMIX_EARC_RESET_OFFSET,
>  		.bit = 0,
> @@ -42,9 +47,15 @@ static const struct imx8mp_reset_map reset_map[] = {
>  	},
>  };
>  
> +static const struct imx8mp_reset_info imx8mp_reset_info = {
> +	.map = imx8mp_reset_map,
> +	.num_lines = ARRAY_SIZE(imx8mp_reset_map),
> +};
> +
>  struct imx8mp_audiomix_reset {
>  	struct reset_controller_dev rcdev;
>  	struct regmap *regmap;
> +	const struct imx8mp_reset_info *rinfo;

Since only rinfo->map is used in imx8mp_audiomix_update(), you could
directly store a

	const struct imx8mp_reset_map *map;


regards
Philipp



More information about the linux-arm-kernel mailing list