Message ID | 874lvs4pd4.wl%kuninori.morimoto.gx@renesas.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Geert Uytterhoeven |
Headers | show |
On Wed, Jun 07, 2017 at 12:29:05AM +0000, Kuninori Morimoto wrote: > +#define asoc_simple_card_clk_enable(dai) clk_prepare_enable((dai)->clk) > +#define asoc_simple_card_clk_disable(dai) clk_disable_unprepare((dai)->clk) Could we make these static inline functions instead please? It shouldn't make any difference to the generated code but it's a bit more type safe.
Hi Mark > > +#define asoc_simple_card_clk_enable(dai) clk_prepare_enable((dai)->clk) > > +#define asoc_simple_card_clk_disable(dai) clk_disable_unprepare((dai)->clk) > > Could we make these static inline functions instead please? It > shouldn't make any difference to the generated code but it's a bit more > type safe. OK, will do in v2 Best regards --- Kuninori Morimoto
diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index 108cae4..9e8e829 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -45,6 +45,8 @@ int asoc_simple_card_parse_clk(struct device *dev, struct device_node *dai_of_node, struct asoc_simple_dai *simple_dai, const char *name); +#define asoc_simple_card_clk_enable(dai) clk_prepare_enable((dai)->clk) +#define asoc_simple_card_clk_disable(dai) clk_disable_unprepare((dai)->clk) #define asoc_simple_card_parse_cpu(node, dai_link, \ list_name, cells_name, is_single_link) \ diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index d9d8b8a..f7df08b 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -128,6 +128,12 @@ int asoc_simple_card_parse_clk(struct device *dev, clk = devm_get_clk_from_child(dev, node, NULL); if (!IS_ERR(clk)) { simple_dai->sysclk = clk_get_rate(clk); + + /* + * This enables + * asoc_simple_card_clk_enable() + * asoc_simple_card_clk_disable() + */ simple_dai->clk = clk; } else if (!of_property_read_u32(node, "system-clock-frequency", &val)) { simple_dai->sysclk = val;