diff mbox series

[RFC,v3,3/6] clk: meson: axg: introduce AUD_MUX_TABLE() helper macro

Message ID 20240419125812.983409-4-jan.dakinevich@salutedevices.com (mailing list archive)
State RFC, archived
Headers show
Series Add A1 Soc audio clock controller driver | expand

Commit Message

Jan Dakinevich April 19, 2024, 12:58 p.m. UTC
This macro takes into account ->table property of
'struct clk_regmap_mux_data'.

Signed-off-by: Jan Dakinevich <jan.dakinevich@salutedevices.com>
---
 drivers/clk/meson/meson-audio.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Jerome Brunet April 22, 2024, 8:09 a.m. UTC | #1
On Fri 19 Apr 2024 at 15:58, Jan Dakinevich <jan.dakinevich@salutedevices.com> wrote:

> This macro takes into account ->table property of
> 'struct clk_regmap_mux_data'.

Useless if the interface of controller is fixed.

>
> Signed-off-by: Jan Dakinevich <jan.dakinevich@salutedevices.com>
> ---
>  drivers/clk/meson/meson-audio.h | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/meson/meson-audio.h b/drivers/clk/meson/meson-audio.h
> index cbcdbd487d4a..1947c6cbf233 100644
> --- a/drivers/clk/meson/meson-audio.h
> +++ b/drivers/clk/meson/meson-audio.h
> @@ -17,9 +17,11 @@
>  	},								\
>  }
>  
> -#define AUD_MUX(_name, _reg, _mask, _shift, _dflags, _pdata, _iflags) {	\
> +#define AUD_MUX_TABLE(_name, _reg, _table, _mask, _shift, _dflags,	\
> +		      _pdata, _iflags) {				\
>  	.data = &(struct clk_regmap_mux_data){				\
>  		.offset = (_reg),					\
> +		.table = (_table),					\
>  		.mask = (_mask),					\
>  		.shift = (_shift),					\
>  		.flags = (_dflags),					\
> @@ -33,6 +35,10 @@
>  	},								\
>  }
>  
> +#define AUD_MUX(_name, _reg, _mask, _shift, _dflags, _pdata, _iflags)	\
> +	AUD_MUX_TABLE(_name, (_reg), NULL, (_mask), (_shift),		\
> +		      (_dflags), (_pdata), (_iflags))
> +
>  #define AUD_DIV(_name, _reg, _shift, _width, _dflags, _pname, _iflags) { \
>  	.data = &(struct clk_regmap_div_data){				\
>  		.offset = (_reg),					\
diff mbox series

Patch

diff --git a/drivers/clk/meson/meson-audio.h b/drivers/clk/meson/meson-audio.h
index cbcdbd487d4a..1947c6cbf233 100644
--- a/drivers/clk/meson/meson-audio.h
+++ b/drivers/clk/meson/meson-audio.h
@@ -17,9 +17,11 @@ 
 	},								\
 }
 
-#define AUD_MUX(_name, _reg, _mask, _shift, _dflags, _pdata, _iflags) {	\
+#define AUD_MUX_TABLE(_name, _reg, _table, _mask, _shift, _dflags,	\
+		      _pdata, _iflags) {				\
 	.data = &(struct clk_regmap_mux_data){				\
 		.offset = (_reg),					\
+		.table = (_table),					\
 		.mask = (_mask),					\
 		.shift = (_shift),					\
 		.flags = (_dflags),					\
@@ -33,6 +35,10 @@ 
 	},								\
 }
 
+#define AUD_MUX(_name, _reg, _mask, _shift, _dflags, _pdata, _iflags)	\
+	AUD_MUX_TABLE(_name, (_reg), NULL, (_mask), (_shift),		\
+		      (_dflags), (_pdata), (_iflags))
+
 #define AUD_DIV(_name, _reg, _shift, _width, _dflags, _pname, _iflags) { \
 	.data = &(struct clk_regmap_div_data){				\
 		.offset = (_reg),					\