[PATCH v5 2/6] reset: imx8mp-audiomix: Replace mask with bit index

Frank Li Frank.li at nxp.com
Fri Nov 21 07:38:52 PST 2025


On Fri, Nov 14, 2025 at 05:37:34AM -0800, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea at nxp.com>
>
> Replace the reset map mask with the bit index to make it clear that all
> reset lines are managed by exactly 1 bit.

I don't think there are benefit because I met some periphal need a magic
number to reset.

>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea at nxp.com>
> ---
>  drivers/reset/reset-imx8mp-audiomix.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/reset/reset-imx8mp-audiomix.c b/drivers/reset/reset-imx8mp-audiomix.c
> index acfa92b15329..d993c294c548 100644
> --- a/drivers/reset/reset-imx8mp-audiomix.c
> +++ b/drivers/reset/reset-imx8mp-audiomix.c
> @@ -19,24 +19,24 @@
>
>  struct imx8mp_reset_map {
>  	unsigned int offset;
> -	unsigned int mask;
> +	unsigned int bit;
>  	bool active_low;
>  };
>
>  static const struct imx8mp_reset_map reset_map[] = {
>  	[IMX8MP_AUDIOMIX_EARC_RESET] = {
>  		.offset	= IMX8MP_AUDIOMIX_EARC_RESET_OFFSET,
> -		.mask = BIT(0),
> +		.bit = 0,
>  		.active_low = true,
>  	},
>  	[IMX8MP_AUDIOMIX_EARC_PHY_RESET] = {
>  		.offset	= IMX8MP_AUDIOMIX_EARC_RESET_OFFSET,
> -		.mask = BIT(1),
> +		.bit = 1,
>  		.active_low = true,
>  	},
>  	[IMX8MP_AUDIOMIX_DSP_RUNSTALL] = {
>  		.offset	= IMX8MP_AUDIOMIX_DSP_RUNSTALL_OFFSET,
> -		.mask = BIT(5),
> +		.bit = 5,
>  		.active_low = false,
>  	},
>  };
> @@ -60,7 +60,7 @@ static int imx8mp_audiomix_update(struct reset_controller_dev *rcdev,
>  	unsigned int mask, offset, active_low;
>  	unsigned long reg, flags;
>
> -	mask = reset_map[id].mask;
> +	mask = BIT(reset_map[id].bit);
>  	offset = reset_map[id].offset;
>  	active_low = reset_map[id].active_low;
>
> --
> 2.43.0
>



More information about the linux-arm-kernel mailing list