Thread (32 messages) 32 messages, 4 authors, 2020-03-23

Re: [PATCH v2 05/10] media: adv748x: add support for HDMI audio

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2020-03-20 11:05:34
Also in: linux-clk, linux-media, linux-renesas-soc, lkml

Hi Alex,

On Fri, Mar 20, 2020 at 11:58 AM Alex Riesen
[off-list ref] wrote:
Geert Uytterhoeven, Fri, Mar 20, 2020 09:43:29 +0100:
quoted
On Thu, Mar 19, 2020 at 6:42 PM Alex Riesen [off-list ref] wrote:
quoted
This adds an implemention of SoC DAI driver which provides access to the
I2S port of the device.
I just noticed I don't do clk_prepare_enable anywhere.
Shouldn't the clock master enable its clocks somewhere?
Usually the consumer is responsible for doing that.
Does the rcar-sound driver do that?

But in this case, perhaps the clock should be enabled implicitly in response
to a request from the audio subsystem, like you do below.

Note that you register a fixed-rate clock, which is assumed to be always
enabled. Perhaps a gateable clock type is more appropriate?
quoted
quoted
diff --git a/drivers/media/i2c/adv748x/adv748x-dai.c b/drivers/media/i2c/adv748x/adv748x-dai.c
new file mode 100644
index 000000000000..4775a0c7ed7f
--- /dev/null
+++ b/drivers/media/i2c/adv748x/adv748x-dai.c
...
quoted
quoted
+static int adv748x_dai_startup(struct snd_pcm_substream *sub, struct snd_soc_dai *dai)
+{
+       struct adv748x_state *state = state_of(dai);
+
+       if (sub->stream != SNDRV_PCM_STREAM_CAPTURE)
+               return -EINVAL;
+       return set_audio_pads_state(state, 1);
+}
For example, here, after activation of the lines succeeded?
quoted
quoted
+static void adv748x_dai_shutdown(struct snd_pcm_substream *sub, struct snd_soc_dai *dai)
+{
+       struct adv748x_state *state = state_of(dai);
+
+       set_audio_pads_state(state, 0);
+}
And clk_disable_unprepare here, before shutting down the pads?
Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help