All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Alex Riesen <alexander.riesen@cetitec.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Kieran Bingham <kieran.bingham@ideasonboard.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Driver Development <devel@driverdev.osuosl.org>,
	Linux Media <linux-media@vger.kernel.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Device Tree <devicetree@vger.kernel.org>,
	Renesas SoC <linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH 8/8] arm64: dts: renesas: salvator: add a connection from adv748x codec (HDMI input) to the R-Car SoC
Date: Fri, 6 Mar 2020 15:16:32 +0200	[thread overview]
Message-ID: <20200306131632.GA4878@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20200305143628.GB25741@pflmari>

Hi Alex,

On Thu, Mar 05, 2020 at 03:36:28PM +0100, Alex Riesen wrote:
> Geert Uytterhoeven, Mon, Mar 02, 2020 17:13:30 +0100:
> > On Mon, Mar 2, 2020 at 5:09 PM Alex Riesen <alexander.riesen@cetitec.com> wrote:
> > > Geert Uytterhoeven, Mon, Mar 02, 2020 16:32:32 +0100:
> > > >
> > > > The #clock-cells should be in the main video-receiver node.
> > > > Probably there is more than one clock output, so #clock-cells may be 1?
> > >
> > > AFAICS, the device can provide only this one clock line (audio master clock
> > > for I2S output)... I shall re-check, just in case.
> 
> And you're right, of course: the audio output formatting module of the ADV748x
> devices provides a set of clock lines related to the I2S pins: the already
> discussed master clock, left-right channel clock and the serial clock (bit
> clock?).

I don't think we need to model the last two clocks through CCF though,
they're part of the I2S protocol, not clock sources that need to be
explicitly controlled (or queried).

> > > > There is no need for a fixed-clock compatible, nor for clock-frequency
> > > > and clock-output-names.
> > > >
> > > > But most important: this should be documented in the adv748x DT bindings,
> > > > and implemented in the adv748x driver.
> > >
> > > So if the driver is to export that clock for the kernel (like in this case),
> > > it must implement its support?
> > 
> > Exactly.  Unless that pin is hardcoded to output a fixed clock, in which case
> > you can just override the existing audio_clk_c rate.
> 
> Just to try it out (I'll set #clock-cells to 1), I registered a fixed rate
> clock in the driver, added a clock provider:
> 
> adv748x_probe:
> 
>     clk = clk_register_fixed_rate(state->dev,
> 				  "clk-hdmi-i2s-mclk",
> 				  NULL     /* parent_name */,
> 				  0        /* flags */,
> 				  12288000 /* rate */);
>     of_clk_add_provider(state->dev->of_node, of_clk_src_simple_get, clk);
> 
> And removed the audio_clk_c frequency setting. I also replaced the audio_clk_c
> in the list of input clocks of the R-Car-side sound card with the phandle of
> the adv7482 main node:
> 
> salvator-common.dtsi:
> 
>     &i2c4 {
> 	status = "okay";
> 
> 	adv7482_hdmi_decoder: video-receiver@70 {
> 	    #clock-cells = <0>; // to be replaced with <1>
> 	};
>     };
> 
>     &rcar_sound {
> 	clocks = ..., <&adv7482_hdmi_decoder>, ...;
>     };
> 
> As everything continues to work as before, I assume that at least the clock
> dependencies were resolved.

This looks good to me.

> Is there a way to verify that the added input clock is actually used?
> IOW, if its frequency is actually has been programmed into the ssi4 (R-Car
> receiving hardware) registers, and not just a left-over from previuos attempts
> or plain default setting?
> 
> As the ADV748x devices seem to provide also the clocks for video outputs, will
> it make any sense to place the clock definition into the port node?
> Or should all provided clocks be indexed in the main device node?

Those clocks are part of the CSI-2 protocol and also don't need to be
explicitly controlled. As far as I can tell from a quick check of the
ADV7482 documentation, only the I2S MCLK is a general-purpose clock that
needs to be exposed.

-- 
Regards,

Laurent Pinchart

WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Alex Riesen <alexander.riesen@cetitec.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Driver Development <devel@driverdev.osuosl.org>,
	Device Tree <devicetree@vger.kernel.org>,
	Kieran Bingham <kieran.bingham@ideasonboard.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Renesas SoC <linux-renesas-soc@vger.kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Linux Media <linux-media@vger.kernel.org>
Subject: Re: [PATCH 8/8] arm64: dts: renesas: salvator: add a connection from adv748x codec (HDMI input) to the R-Car SoC
Date: Fri, 6 Mar 2020 15:16:32 +0200	[thread overview]
Message-ID: <20200306131632.GA4878@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20200305143628.GB25741@pflmari>

Hi Alex,

On Thu, Mar 05, 2020 at 03:36:28PM +0100, Alex Riesen wrote:
> Geert Uytterhoeven, Mon, Mar 02, 2020 17:13:30 +0100:
> > On Mon, Mar 2, 2020 at 5:09 PM Alex Riesen <alexander.riesen@cetitec.com> wrote:
> > > Geert Uytterhoeven, Mon, Mar 02, 2020 16:32:32 +0100:
> > > >
> > > > The #clock-cells should be in the main video-receiver node.
> > > > Probably there is more than one clock output, so #clock-cells may be 1?
> > >
> > > AFAICS, the device can provide only this one clock line (audio master clock
> > > for I2S output)... I shall re-check, just in case.
> 
> And you're right, of course: the audio output formatting module of the ADV748x
> devices provides a set of clock lines related to the I2S pins: the already
> discussed master clock, left-right channel clock and the serial clock (bit
> clock?).

I don't think we need to model the last two clocks through CCF though,
they're part of the I2S protocol, not clock sources that need to be
explicitly controlled (or queried).

> > > > There is no need for a fixed-clock compatible, nor for clock-frequency
> > > > and clock-output-names.
> > > >
> > > > But most important: this should be documented in the adv748x DT bindings,
> > > > and implemented in the adv748x driver.
> > >
> > > So if the driver is to export that clock for the kernel (like in this case),
> > > it must implement its support?
> > 
> > Exactly.  Unless that pin is hardcoded to output a fixed clock, in which case
> > you can just override the existing audio_clk_c rate.
> 
> Just to try it out (I'll set #clock-cells to 1), I registered a fixed rate
> clock in the driver, added a clock provider:
> 
> adv748x_probe:
> 
>     clk = clk_register_fixed_rate(state->dev,
> 				  "clk-hdmi-i2s-mclk",
> 				  NULL     /* parent_name */,
> 				  0        /* flags */,
> 				  12288000 /* rate */);
>     of_clk_add_provider(state->dev->of_node, of_clk_src_simple_get, clk);
> 
> And removed the audio_clk_c frequency setting. I also replaced the audio_clk_c
> in the list of input clocks of the R-Car-side sound card with the phandle of
> the adv7482 main node:
> 
> salvator-common.dtsi:
> 
>     &i2c4 {
> 	status = "okay";
> 
> 	adv7482_hdmi_decoder: video-receiver@70 {
> 	    #clock-cells = <0>; // to be replaced with <1>
> 	};
>     };
> 
>     &rcar_sound {
> 	clocks = ..., <&adv7482_hdmi_decoder>, ...;
>     };
> 
> As everything continues to work as before, I assume that at least the clock
> dependencies were resolved.

This looks good to me.

> Is there a way to verify that the added input clock is actually used?
> IOW, if its frequency is actually has been programmed into the ssi4 (R-Car
> receiving hardware) registers, and not just a left-over from previuos attempts
> or plain default setting?
> 
> As the ADV748x devices seem to provide also the clocks for video outputs, will
> it make any sense to place the clock definition into the port node?
> Or should all provided clocks be indexed in the main device node?

Those clocks are part of the CSI-2 protocol and also don't need to be
explicitly controlled. As far as I can tell from a quick check of the
ADV7482 documentation, only the I2S MCLK is a general-purpose clock that
needs to be exposed.

-- 
Regards,

Laurent Pinchart
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply	other threads:[~2020-03-06 13:16 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-13 14:19 [PATCH 0/8] media: i2c: adv748x: add support for HDMI audio Alex Riesen
2020-01-13 14:19 ` Alex Riesen
2020-01-13 14:15 ` [PATCH 1/8] media: adv748x: add a device-specific wrapper for register block read Alex Riesen
2020-01-13 14:15   ` Alex Riesen
2020-01-13 14:15 ` [PATCH 2/8] media: adv748x: add audio mute control and output selection ioctls Alex Riesen
2020-01-13 14:15   ` Alex Riesen
2020-03-13  8:16   ` Hans Verkuil
2020-03-13  8:16     ` Hans Verkuil
2020-03-13 10:26     ` Alex Riesen
2020-03-13 10:26       ` Alex Riesen
2020-03-13 10:52       ` Hans Verkuil
2020-03-13 10:52         ` Hans Verkuil
2020-03-13 11:00         ` Alex Riesen
2020-03-13 11:00           ` Alex Riesen
2020-01-13 14:15 ` [PATCH 3/8] media: adv748x: add log_status ioctl Alex Riesen
2020-01-13 14:15   ` Alex Riesen
2020-01-13 14:15 ` [PATCH 4/8] media: adv748x: reserve space for the audio (I2S) port in the driver structures Alex Riesen
2020-01-13 14:15   ` Alex Riesen
2020-01-13 14:15 ` [PATCH 5/8] media: adv748x: add an ASoC DAI definition to the driver Alex Riesen
2020-01-13 14:15   ` Alex Riesen
2020-01-13 14:15 ` [PATCH 6/8] media: adv748x: reduce amount of code for bitwise modification of device registers Alex Riesen
2020-01-13 14:15   ` Alex Riesen
2020-01-13 14:15 ` [PATCH 7/8] dt-bindings: adv748x: add information about serial audio interface (I2S/TDM) Alex Riesen
2020-01-13 14:15   ` Alex Riesen
2020-01-13 22:32   ` Rob Herring
2020-01-13 22:32     ` Rob Herring
2020-01-13 14:15 ` [PATCH 8/8] arm64: dts: renesas: salvator: add a connection from adv748x codec (HDMI input) to the R-Car SoC Alex Riesen
2020-01-13 14:15   ` Alex Riesen
2020-03-02 12:28   ` Geert Uytterhoeven
2020-03-02 12:28     ` Geert Uytterhoeven
2020-03-02 13:40     ` Alex Riesen
2020-03-02 13:40       ` Alex Riesen
2020-03-02 13:47       ` Geert Uytterhoeven
2020-03-02 13:47         ` Geert Uytterhoeven
2020-03-02 15:07         ` Alex Riesen
2020-03-02 15:07           ` Alex Riesen
2020-03-02 15:32           ` Geert Uytterhoeven
2020-03-02 15:32             ` Geert Uytterhoeven
2020-03-02 16:09             ` Alex Riesen
2020-03-02 16:09               ` Alex Riesen
2020-03-02 16:13               ` Geert Uytterhoeven
2020-03-02 16:13                 ` Geert Uytterhoeven
2020-03-05 14:36                 ` Alex Riesen
2020-03-05 14:36                   ` Alex Riesen
2020-03-06 12:21                   ` Geert Uytterhoeven
2020-03-06 12:21                     ` Geert Uytterhoeven
2020-03-06 13:16                   ` Laurent Pinchart [this message]
2020-03-06 13:16                     ` Laurent Pinchart
2020-03-06 13:41                     ` Alex Riesen
2020-03-06 13:41                       ` Alex Riesen
2020-03-06 13:45                       ` Laurent Pinchart
2020-03-06 13:45                         ` Laurent Pinchart
2020-03-09  1:31                         ` Kuninori Morimoto
2020-03-09  1:31                           ` Kuninori Morimoto
2020-03-09 11:09                           ` Alex Riesen
2020-03-09 11:09                             ` Alex Riesen
2020-03-10  1:07                             ` Kuninori Morimoto
2020-03-10  1:07                               ` Kuninori Morimoto
2020-03-10  8:17                               ` Alex Riesen
2020-03-10  8:17                                 ` Alex Riesen
2020-03-10 10:39                                 ` Laurent Pinchart
2020-03-10 10:39                                   ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200306131632.GA4878@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=alexander.riesen@cetitec.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mchehab@kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.