All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Padmanabhan Rajanbabu" <p.rajanbabu@samsung.com>
To: "'Mark Brown'" <broonie@kernel.org>
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
	linux-samsung-soc@vger.kernel.org,
	krzysztof.kozlowski+dt@linaro.org, rcsekar@samsung.com,
	aswani.reddy@samsung.com, pankaj.dubey@samsung.com,
	tiwai@suse.com, lgirdwood@gmail.com, robh+dt@kernel.org,
	alim.akhtar@samsung.com, linux-kernel@vger.kernel.org
Subject: RE: [PATCH 2/6] ASoC: samsung: i2s: configure PSR from sound card
Date: Tue, 3 Jan 2023 10:25:02 +0530	[thread overview]
Message-ID: <025401d91f2f$8bf78a00$a3e69e00$@samsung.com> (raw)
In-Reply-To: <Y2vlqatX7dfPJ3Zi@sirena.org.uk>



> -----Original Message-----
> From: Mark Brown [mailto:broonie@kernel.org]
> Sent: 09 November 2022 11:09 PM
> To: Padmanabhan Rajanbabu <p.rajanbabu@samsung.com>
> Cc: lgirdwood@gmail.com; robh+dt@kernel.org;
> krzysztof.kozlowski+dt@linaro.org; s.nawrocki@samsung.com;
> perex@perex.cz; tiwai@suse.com; pankaj.dubey@samsung.com;
> alim.akhtar@samsung.com; rcsekar@samsung.com;
> aswani.reddy@samsung.com; alsa-devel@alsa-project.org;
> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux-samsung-
> soc@vger.kernel.org
> Subject: Re: [PATCH 2/6] ASoC: samsung: i2s: configure PSR from sound card
> 
> On Tue, Nov 08, 2022 at 10:53:40AM +0530, Padmanabhan Rajanbabu wrote:
> 
> > > > We can overcome this scenario to an extent if we can get a
> > > > flexibility to Configure both PSR as well as RFS.
> 
> > > Why does it make sense for the machine driver to worry about this
> > > rather than having the I2S controller driver configure the clock tree?
> 
> > _____           |                  __
> > |
> > |         |	        |	             |   \
> > |
> > |CMU|	        |	             |     \
> > |
> > |FSD  |-  |---|-|--------->|       \        _________    _________
> > |
> > |___  |    |    | |op_clk0|         |      |               |     |
> > |             |
> > 	  |    | |	             |MUX|----|  PSR       |----|  RFS
> > |--cdclk  |
> > 	  |    | |              |         |      |_______|     |_______|
> > |
> > 	  |    | |--------->|        /
> > |
> > 	  |    |  op_clk1 |      /
> > |
> > 	  |    | 	             |_ /
> > |
> > 	  |    |___________________________________________|
> > 	  |
> > 	  |-----> To other FSD SoC Peripherals
> 
> > In FSD I2S, the clock source is not an independent source but a common
> > clock source being shared by many IPs in the same domain.
> 
> > Changing the clock tree will impact other IPs in the domain as they
> > are dependent on the same source for functionality.
> 
> I'm not sure I follow.  Perhaps your diagram is unclear but it looks like
PSR and
> RFS are both after a mux which appears to select which clock is going to
be
> used by the I2S controller?  The usage by other clocks appears to be
> upstream of the mux and dividers.
> 
> > We can understand your point to bring the PSR changes under the I2S
> > CPU DAI driver by adding a separate compatible and data for the FSD
> > SoC. But If we take the example of existing sound cards such as
> > sound/soc/samsung/tm2_wm5110.c, the op_clk is supplied via external
> > audio pll to the controller and PLL configuration is taken care by the
> > sound card. Since the configuration of PLL is more specific to the tm2
> > platform, it makes use of the flexibility of changing the RFS and BFS
> > using the sysclk and clkdiv hooks provided by exynos7-i2s CPU DAI
> > along with PLL tuning for precise sampling frequency.
> 
> The big reason for the clocking control (and indeed having a custom
machine
> driver) with the WM5110 is that it has multiple clocks to control and a
good
> deal of flexibility with placing them in clock domains and so on which
have
> power and performance impacts.  It's frankly a bit unclear to me if the
CPU
> I2S controller even needs the bitclock configuring given that the clocks
are
> being driven by the CODEC there, but regardless it's not clear to me why
the
> I2S controller would need anything other than the input clock to the block
> configuring?
> 
> > Similar to the above example, the choice of clock source under
> > discussion is not a limitation of exynos7-i2s controller, but instead
> > is a limitation on the FSD SoC.
> > By using the proposed change, we can ensure that the exynos CPU DAI
> > driver is giving additional hooks similar to existing hooks for BFS,
> > RFS and CDCLK direction so that sound cards can use
> > snd_soc_dai_set_sysclk and snd_soc_dai_set_clkdiv to customize the
> > same.
> 
> I'm still not seeing anything that articulates why pushing the
configuration of
> the dividers within the block into the machine driver solves a problem
here.
> Again, what's the upside to configuring clocks that are purely within the
> block?

Okay, I can understand the reason for de-linking these changes from the
machine
Driver. I'll post the v2 patches integrating the PSR changes into cpu dai
driver.

Thanks,
Padmanabhan R.


WARNING: multiple messages have this Message-ID (diff)
From: "Padmanabhan Rajanbabu" <p.rajanbabu@samsung.com>
To: "'Mark Brown'" <broonie@kernel.org>
Cc: <lgirdwood@gmail.com>, <robh+dt@kernel.org>,
	<krzysztof.kozlowski+dt@linaro.org>, <s.nawrocki@samsung.com>,
	<perex@perex.cz>, <tiwai@suse.com>, <pankaj.dubey@samsung.com>,
	<alim.akhtar@samsung.com>, <rcsekar@samsung.com>,
	<aswani.reddy@samsung.com>, <alsa-devel@alsa-project.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-samsung-soc@vger.kernel.org>
Subject: RE: [PATCH 2/6] ASoC: samsung: i2s: configure PSR from sound card
Date: Tue, 3 Jan 2023 10:25:02 +0530	[thread overview]
Message-ID: <025401d91f2f$8bf78a00$a3e69e00$@samsung.com> (raw)
In-Reply-To: <Y2vlqatX7dfPJ3Zi@sirena.org.uk>



> -----Original Message-----
> From: Mark Brown [mailto:broonie@kernel.org]
> Sent: 09 November 2022 11:09 PM
> To: Padmanabhan Rajanbabu <p.rajanbabu@samsung.com>
> Cc: lgirdwood@gmail.com; robh+dt@kernel.org;
> krzysztof.kozlowski+dt@linaro.org; s.nawrocki@samsung.com;
> perex@perex.cz; tiwai@suse.com; pankaj.dubey@samsung.com;
> alim.akhtar@samsung.com; rcsekar@samsung.com;
> aswani.reddy@samsung.com; alsa-devel@alsa-project.org;
> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux-samsung-
> soc@vger.kernel.org
> Subject: Re: [PATCH 2/6] ASoC: samsung: i2s: configure PSR from sound card
> 
> On Tue, Nov 08, 2022 at 10:53:40AM +0530, Padmanabhan Rajanbabu wrote:
> 
> > > > We can overcome this scenario to an extent if we can get a
> > > > flexibility to Configure both PSR as well as RFS.
> 
> > > Why does it make sense for the machine driver to worry about this
> > > rather than having the I2S controller driver configure the clock tree?
> 
> > _____           |                  __
> > |
> > |         |	        |	             |   \
> > |
> > |CMU|	        |	             |     \
> > |
> > |FSD  |-  |---|-|--------->|       \        _________    _________
> > |
> > |___  |    |    | |op_clk0|         |      |               |     |
> > |             |
> > 	  |    | |	             |MUX|----|  PSR       |----|  RFS
> > |--cdclk  |
> > 	  |    | |              |         |      |_______|     |_______|
> > |
> > 	  |    | |--------->|        /
> > |
> > 	  |    |  op_clk1 |      /
> > |
> > 	  |    | 	             |_ /
> > |
> > 	  |    |___________________________________________|
> > 	  |
> > 	  |-----> To other FSD SoC Peripherals
> 
> > In FSD I2S, the clock source is not an independent source but a common
> > clock source being shared by many IPs in the same domain.
> 
> > Changing the clock tree will impact other IPs in the domain as they
> > are dependent on the same source for functionality.
> 
> I'm not sure I follow.  Perhaps your diagram is unclear but it looks like
PSR and
> RFS are both after a mux which appears to select which clock is going to
be
> used by the I2S controller?  The usage by other clocks appears to be
> upstream of the mux and dividers.
> 
> > We can understand your point to bring the PSR changes under the I2S
> > CPU DAI driver by adding a separate compatible and data for the FSD
> > SoC. But If we take the example of existing sound cards such as
> > sound/soc/samsung/tm2_wm5110.c, the op_clk is supplied via external
> > audio pll to the controller and PLL configuration is taken care by the
> > sound card. Since the configuration of PLL is more specific to the tm2
> > platform, it makes use of the flexibility of changing the RFS and BFS
> > using the sysclk and clkdiv hooks provided by exynos7-i2s CPU DAI
> > along with PLL tuning for precise sampling frequency.
> 
> The big reason for the clocking control (and indeed having a custom
machine
> driver) with the WM5110 is that it has multiple clocks to control and a
good
> deal of flexibility with placing them in clock domains and so on which
have
> power and performance impacts.  It's frankly a bit unclear to me if the
CPU
> I2S controller even needs the bitclock configuring given that the clocks
are
> being driven by the CODEC there, but regardless it's not clear to me why
the
> I2S controller would need anything other than the input clock to the block
> configuring?
> 
> > Similar to the above example, the choice of clock source under
> > discussion is not a limitation of exynos7-i2s controller, but instead
> > is a limitation on the FSD SoC.
> > By using the proposed change, we can ensure that the exynos CPU DAI
> > driver is giving additional hooks similar to existing hooks for BFS,
> > RFS and CDCLK direction so that sound cards can use
> > snd_soc_dai_set_sysclk and snd_soc_dai_set_clkdiv to customize the
> > same.
> 
> I'm still not seeing anything that articulates why pushing the
configuration of
> the dividers within the block into the machine driver solves a problem
here.
> Again, what's the upside to configuring clocks that are purely within the
> block?

Okay, I can understand the reason for de-linking these changes from the
machine
Driver. I'll post the v2 patches integrating the PSR changes into cpu dai
driver.

Thanks,
Padmanabhan R.


  reply	other threads:[~2023-01-03  6:39 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20221014104843epcas5p47f6daaad2e67e0c9eedd68c2256c025b@epcas5p4.samsung.com>
2022-10-14 10:21 ` [PATCH 0/6] ASoC: samsung: fsd: audio support for FSD SoC Padmanabhan Rajanbabu
2022-10-14 10:21   ` Padmanabhan Rajanbabu
2022-10-14 10:21   ` [PATCH 1/6] ASoC: samsung: i2s: TDM Support for CPU DAI driver Padmanabhan Rajanbabu
2022-10-14 10:21     ` Padmanabhan Rajanbabu
2022-10-14 10:21   ` [PATCH 2/6] ASoC: samsung: i2s: configure PSR from sound card Padmanabhan Rajanbabu
2022-10-14 10:21     ` Padmanabhan Rajanbabu
2022-10-14 12:02     ` Mark Brown
2022-10-14 12:02       ` Mark Brown
2022-10-21  8:00       ` Padmanabhan Rajanbabu
2022-10-21  8:00         ` Padmanabhan Rajanbabu
2022-10-21 11:53         ` Mark Brown
2022-10-21 11:53           ` Mark Brown
2022-11-08  5:23           ` Padmanabhan Rajanbabu
2022-11-08  5:23             ` Padmanabhan Rajanbabu
2022-11-09 17:38             ` Mark Brown
2022-11-09 17:38               ` Mark Brown
2023-01-03  4:55               ` Padmanabhan Rajanbabu [this message]
2023-01-03  4:55                 ` Padmanabhan Rajanbabu
2022-10-23 13:12         ` Krzysztof Kozlowski
2022-10-23 13:12           ` Krzysztof Kozlowski
2022-10-14 10:21   ` [PATCH 3/6] dt-bindings: sound: Add sound card bindings for Tesla FSD Padmanabhan Rajanbabu
2022-10-14 10:21     ` Padmanabhan Rajanbabu
2022-10-14 15:13     ` Rob Herring
2022-10-14 15:13       ` Rob Herring
2022-10-21  8:44       ` Padmanabhan Rajanbabu
2022-10-21  8:44         ` Padmanabhan Rajanbabu
2022-10-22 16:48         ` Krzysztof Kozlowski
2022-10-22 16:48           ` Krzysztof Kozlowski
2022-11-08  5:33           ` Padmanabhan Rajanbabu
2022-11-08  5:33             ` Padmanabhan Rajanbabu
2022-11-08 10:36             ` Krzysztof Kozlowski
2022-11-08 10:36               ` Krzysztof Kozlowski
2022-10-14 10:21   ` [PATCH 4/6] ASoC: samsung: fsd: Add FSD soundcard driver Padmanabhan Rajanbabu
2022-10-14 10:21     ` Padmanabhan Rajanbabu
2022-10-14 12:23     ` Mark Brown
2022-10-14 12:23       ` Mark Brown
2022-10-21  8:09       ` Padmanabhan Rajanbabu
2022-10-21  8:09         ` Padmanabhan Rajanbabu
2022-10-16 15:18     ` Krzysztof Kozlowski
2022-10-16 15:18       ` Krzysztof Kozlowski
2022-10-21  9:04       ` Padmanabhan Rajanbabu
2022-10-21  9:04         ` Padmanabhan Rajanbabu
2022-10-14 10:21   ` [PATCH 5/6] arm64: dts: fsd: Add I2S DAI node for Tesla FSD Padmanabhan Rajanbabu
2022-10-14 10:21     ` Padmanabhan Rajanbabu
2022-10-14 13:24     ` Alim Akhtar
2022-10-14 13:24       ` Alim Akhtar
2022-10-21  8:09       ` Padmanabhan Rajanbabu
2022-10-21  8:09         ` Padmanabhan Rajanbabu
2022-10-16 15:14     ` Krzysztof Kozlowski
2022-10-16 15:14       ` Krzysztof Kozlowski
2022-10-21  8:49       ` Padmanabhan Rajanbabu
2022-10-21  8:49         ` Padmanabhan Rajanbabu
2022-10-21 13:01         ` Krzysztof Kozlowski
2022-10-21 13:01           ` Krzysztof Kozlowski
2022-11-08  5:26           ` Padmanabhan Rajanbabu
2022-11-08  5:26             ` Padmanabhan Rajanbabu
2022-10-14 10:21   ` [PATCH 6/6] arm64: dts: fsd: Add sound card " Padmanabhan Rajanbabu
2022-10-14 10:21     ` Padmanabhan Rajanbabu
2022-10-14 13:29     ` Alim Akhtar
2022-10-14 13:29       ` Alim Akhtar
2022-10-21  8:12       ` Padmanabhan Rajanbabu
2022-10-21  8:12         ` Padmanabhan Rajanbabu
2022-10-21 12:53         ` Krzysztof Kozlowski
2022-10-21 12:53           ` Krzysztof Kozlowski
2022-11-08  5:25           ` Padmanabhan Rajanbabu
2022-11-08  5:25             ` Padmanabhan Rajanbabu

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='025401d91f2f$8bf78a00$a3e69e00$@samsung.com' \
    --to=p.rajanbabu@samsung.com \
    --cc=alim.akhtar@samsung.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=aswani.reddy@samsung.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=pankaj.dubey@samsung.com \
    --cc=rcsekar@samsung.com \
    --cc=robh+dt@kernel.org \
    --cc=tiwai@suse.com \
    /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.