[PATCH v2 0/2] soundwire: set frame shape and divider based on actual clk

Bard Liao posted 2 patches 11 months ago
drivers/soundwire/cadence_master.c  | 22 +++++++++++++++++++---
drivers/soundwire/intel_auxdevice.c | 21 ---------------------
2 files changed, 19 insertions(+), 24 deletions(-)
[PATCH v2 0/2] soundwire: set frame shape and divider based on actual clk
Posted by Bard Liao 11 months ago
Set frame shape and clock divider based on actual clock frequency. And
with that change, we can support ckock change in Intel platforms.

v2:
 - Mave the check before writing the divider registers
 - Remove the 'freq' intermediate variable which is multiplied by two
   after divided by two.

Bard Liao (2):
  soundwire: cadence_master: set frame shape and divider based on actual
    clk freq
  Revert "soundwire: intel_auxdevice: start the bus at default
    frequency"

 drivers/soundwire/cadence_master.c  | 22 +++++++++++++++++++---
 drivers/soundwire/intel_auxdevice.c | 21 ---------------------
 2 files changed, 19 insertions(+), 24 deletions(-)

-- 
2.43.0
Re: [PATCH v2 0/2] soundwire: set frame shape and divider based on actual clk
Posted by Pierre-Louis Bossart 11 months ago
On 1/14/25 12:16 AM, Bard Liao wrote:
> Set frame shape and clock divider based on actual clock frequency. And
> with that change, we can support ckock change in Intel platforms.
> 
> v2:
>  - Mave the check before writing the divider registers
>  - Remove the 'freq' intermediate variable which is multiplied by two
>    after divided by two.
> 
> Bard Liao (2):
>   soundwire: cadence_master: set frame shape and divider based on actual
>     clk freq
>   Revert "soundwire: intel_auxdevice: start the bus at default
>     frequency"

This looks fine so 

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>

but one additional question: what is the default start frequency? There is an expectation in SoundWire 1.2 that the bus starts at the slowest speed to allow for potential programming of PHY registers before bumping the speed to a higher rate. I don't recall what is typically listed in the _DSD properties, it'd be a mistake to start blindly with the first listed value if it happens to be the max rate.

>  drivers/soundwire/cadence_master.c  | 22 +++++++++++++++++++---
>  drivers/soundwire/intel_auxdevice.c | 21 ---------------------
>  2 files changed, 19 insertions(+), 24 deletions(-)
>
RE: [PATCH v2 0/2] soundwire: set frame shape and divider based on actual clk
Posted by Liao, Bard 11 months ago

> -----Original Message-----
> From: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
> Sent: Saturday, January 18, 2025 12:11 AM
> To: Bard Liao <yung-chuan.liao@linux.intel.com>; linux-sound@vger.kernel.org;
> vkoul@kernel.org
> Cc: vinod.koul@linaro.org; linux-kernel@vger.kernel.org; Liao, Bard
> <bard.liao@intel.com>
> Subject: Re: [PATCH v2 0/2] soundwire: set frame shape and divider based on
> actual clk
> 
> On 1/14/25 12:16 AM, Bard Liao wrote:
> > Set frame shape and clock divider based on actual clock frequency. And
> > with that change, we can support ckock change in Intel platforms.
> >
> > v2:
> >  - Mave the check before writing the divider registers
> >  - Remove the 'freq' intermediate variable which is multiplied by two
> >    after divided by two.
> >
> > Bard Liao (2):
> >   soundwire: cadence_master: set frame shape and divider based on actual
> >     clk freq
> >   Revert "soundwire: intel_auxdevice: start the bus at default
> >     frequency"
> 
> This looks fine so
> 
> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
> 
> but one additional question: what is the default start frequency? There is an
> expectation in SoundWire 1.2 that the bus starts at the slowest speed to allow
> for potential programming of PHY registers before bumping the speed to a
> higher rate. I don't recall what is typically listed in the _DSD properties, it'd be a
> mistake to start blindly with the first listed value if it happens to be the max
> rate.

Currently, we start with the first listed value. I checked the listed
values, and the first value is the slowest and the latter is faster.
But, yes, I agree that we can't rely on the _DSD properties.
Let's sort it when we get the values.

> 
> >  drivers/soundwire/cadence_master.c  | 22 +++++++++++++++++++---
> >  drivers/soundwire/intel_auxdevice.c | 21 ---------------------
> >  2 files changed, 19 insertions(+), 24 deletions(-)
> >