Re: [PATCH v3 0/1] ASoC: fsl_asrc: always select different clocks

2020-07-17 Thread Arnaud Ferraris
Le 17/07/2020 à 13:21, Mark Brown a écrit : > On Fri, Jul 17, 2020 at 12:38:56PM +0200, Arnaud Ferraris wrote: >> This patch fixes the automatic clock selection so it always selects >> distinct input and output clocks. > > Please don't send new patches in reply to old

Re: [PATCH 0/4] ASoC: fsl_asrc: allow selecting arbitrary clocks

2020-07-17 Thread Arnaud Ferraris
Hi Nic, Le 02/07/2020 à 20:42, Nicolin Chen a écrit : > Hi Arnaud, > > On Thu, Jul 02, 2020 at 04:22:31PM +0200, Arnaud Ferraris wrote: >> The current ASRC driver hardcodes the input and output clocks used for >> sample rate conversions. In order to allow greater flexibility

[PATCH v3 1/1] ASoC: fsl_asrc: make sure the input and output clocks are different

2020-07-17 Thread Arnaud Ferraris
inct input and output clocks. Signed-off-by: Arnaud Ferraris --- sound/soc/fsl/fsl_asrc.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index 02c81d2e34ad..de10c208d3c8 100644 --- a/sound/soc/fsl/fsl_asrc.c +

[PATCH v3 0/1] ASoC: fsl_asrc: always select different clocks

2020-07-17 Thread Arnaud Ferraris
e sure input and output clocks are different Arnaud Ferraris(1): ASoC: fsl_asrc: make sure the input and output clocks are different sound/soc/fsl/fsl_asrc.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-)

Re: [PATCH v2 2/2] ASoC: fsl_asrc: always use internal ratio

2020-07-17 Thread Arnaud Ferraris
Le 17/07/2020 à 01:37, Nicolin Chen a écrit : >> @@ -507,8 +507,7 @@ static int fsl_asrc_config_pair(struct fsl_asrc_pair >> *pair, bool use_ideal_rate) >> >> /* Enable Ideal Ratio mode */ > > The code is against the comments now -- need to update this line. It isn't, the following cod

[PATCH v2 2/2] ASoC: fsl_asrc: always use internal ratio

2020-07-16 Thread Arnaud Ferraris
sured ratio will be used", so setting this bit even when not in "Ideal Ratio" mode still makes sense. Signed-off-by: Arnaud Ferraris --- sound/soc/fsl/fsl_asrc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.

[PATCH v2 1/2] ASoC: fsl_asrc: make sure the input and output clocks are different

2020-07-16 Thread Arnaud Ferraris
The current clock selection algorithm might select the same clock for both input and output. This can happen when, for instance, the output sample rate is a multiple of the input rate. This patch makes sure it always selects distinct input and output clocks. Signed-off-by: Arnaud Ferraris

[PATCH v2 0/2] ASoC: fsl_asrc: improve clock selection and quality

2020-07-16 Thread Arnaud Ferraris
ock table) to make sure input and output clocks are different Arnaud Ferraris(2): ASoC: fsl_asrc: make sure the input and output clocks are different ASoC: fsl_asrc: always use internal ratio sound/soc/fsl/fsl_asrc.c | 8 1 file changed, 4 insertions(+), 4 deletions(-)

Re: [PATCH 1/2] ASoC: fsl_asrc: make sure the input and output clocks are different

2020-07-16 Thread Arnaud Ferraris
Le 16/07/2020 à 16:52, Arnaud Ferraris a écrit : > The current clock selection algorithm might select the same clock for > both input and output. This can happen when, for instance, the output > sample rate is a multiple of the input rate. > > This patch makes sure it always s

[PATCH 0/2] ASoC: fsl_asrc: improve clock selection and quality

2020-07-16 Thread Arnaud Ferraris
This series fixes the automatic clock selection and enables internal ratio in order to improve audio quality. The clock selection patches have been set aside for now, as the discussion is still ongoing regarding that matter. Arnaud Ferraris(2): ASoC: fsl_asrc: make sure the input and output

[PATCH 1/2] ASoC: fsl_asrc: make sure the input and output clocks are different

2020-07-16 Thread Arnaud Ferraris
The current clock selection algorithm might select the same clock for both input and output. This can happen when, for instance, the output sample rate is a multiple of the input rate. This patch makes sure it always selects distinct input and output clocks. Signed-off-by: Arnaud Ferraris

[PATCH 2/2] ASoC: fsl_asrc: always use internal ratio

2020-07-16 Thread Arnaud Ferraris
sured ratio will be used", so setting this bit even when not in "Ideal Ratio" mode still makes sense. Signed-off-by: Arnaud Ferraris --- sound/soc/fsl/fsl_asrc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.

Re: [PATCH 0/4] ASoC: fsl_asrc: allow selecting arbitrary clocks

2020-07-16 Thread Arnaud Ferraris
Le 16/07/2020 à 14:18, Mark Brown a écrit : > On Wed, Jul 15, 2020 at 02:03:08PM -0700, Nicolin Chen wrote: >> On Wed, Jul 15, 2020 at 03:05:19PM +0100, Mark Brown wrote: >>> On Tue, Jul 14, 2020 at 01:50:50PM -0700, Nicolin Chen wrote: > Thanks for the input. Fox i.MX6, I don't feel it wo

Re: [PATCH 0/4] ASoC: fsl_asrc: allow selecting arbitrary clocks

2020-07-16 Thread Arnaud Ferraris
Le 15/07/2020 à 22:46, Nicolin Chen a écrit : >> Calculations are indeed good, but then the clock selection setting in >> the ASRCSR register would also use SSI1 as the input clock, which >> doesn't work in our case. > > Could you please elaborate why it doesn't work? > Hmm, actually it was a

Re: [PATCH 0/4] ASoC: fsl_asrc: allow selecting arbitrary clocks

2020-07-15 Thread Arnaud Ferraris
Le 15/07/2020 à 18:22, Mark Brown a écrit : > > Those look reasonable enough off the top of my head, not that I've > really looked at the hardware. > Alright, thanks for your feedback! Unless Nic has other comments I'll submit a v2 tomorrow then. Regards, Arnaud

Re: [PATCH 0/4] ASoC: fsl_asrc: allow selecting arbitrary clocks

2020-07-15 Thread Arnaud Ferraris
Hi, Le 15/07/2020 à 16:05, Mark Brown a écrit : > On Tue, Jul 14, 2020 at 01:50:50PM -0700, Nicolin Chen wrote: > Anything wrong with ASRC selecting SSI1 clock for both cases? The > driver calculates the divisors based on the given clock rate, so > the final internal rate should be the same. If th

Re: [PATCH 0/4] ASoC: fsl_asrc: allow selecting arbitrary clocks

2020-07-14 Thread Arnaud Ferraris
Hi Nic, Le 03/07/2020 à 11:38, Arnaud Ferraris a écrit : > Hi Nic, > > Le 02/07/2020 à 20:42, Nicolin Chen a écrit : >> Hi Arnaud, >> >> On Thu, Jul 02, 2020 at 04:22:31PM +0200, Arnaud Ferraris wrote: >>> The current ASRC driver hardcodes the input and ou

Re: [PATCH 0/4] ASoC: fsl_asrc: allow selecting arbitrary clocks

2020-07-03 Thread Arnaud Ferraris
Hi Nic, Le 02/07/2020 à 20:42, Nicolin Chen a écrit : > Hi Arnaud, > > On Thu, Jul 02, 2020 at 04:22:31PM +0200, Arnaud Ferraris wrote: >> The current ASRC driver hardcodes the input and output clocks used for >> sample rate conversions. In order to allow greater flexibility

Re: [PATCH 1/2] dt-bindings: sound: fsl-asoc-card: add new compatible for I2S slave

2020-07-03 Thread Arnaud Ferraris
Le 02/07/2020 à 17:42, Mark Brown a écrit : > On Thu, Jul 02, 2020 at 05:28:03PM +0200, Arnaud Ferraris wrote: >> Le 02/07/2020 à 16:31, Mark Brown a écrit : > >>> Why require that the CODEC be clock master here - why not make this >>> configurable, reusing the p

Re: [PATCH 1/2] dt-bindings: sound: fsl-asoc-card: add new compatible for I2S slave

2020-07-02 Thread Arnaud Ferraris
Hi Mark, Le 02/07/2020 à 16:31, Mark Brown a écrit : > On Thu, Jul 02, 2020 at 04:11:14PM +0200, Arnaud Ferraris wrote: >> fsl-asoc-card currently doesn't support generic codecs with the SoC >> acting as I2S slave. >> >> This commit adds a new `fsl,imx-audio-

[PATCH 3/4] ASoC: fsl_asrc: always use ratio for conversion

2020-07-02 Thread Arnaud Ferraris
Even when not in "Ideal Ratio" mode, ASRC can use an internally measured ratio, which greatly improves the conversion quality. This patch ensures we always use at least the internal ratio. Signed-off-by: Arnaud Ferraris --- sound/soc/fsl/fsl_asrc.c | 5 ++--- 1 file changed, 2 insert

[PATCH 1/4] dt-bindings: sound: fsl,asrc: add properties to select in/out clocks

2020-07-02 Thread Arnaud Ferraris
The ASRC peripheral accepts a wide range of input and output clocks, but no mechanism exists at the moment to define those as they are currently hardcoded in the driver. This commit adds new properties allowing selection of arbitrary input and output clocks. Signed-off-by: Arnaud Ferraris

[PATCH 2/4] ASoC: fsl_asrc: allow using arbitrary input and output clocks

2020-07-02 Thread Arnaud Ferraris
: Arnaud Ferraris --- sound/soc/fsl/fsl_asrc.c| 18 -- sound/soc/fsl/fsl_asrc_common.h | 3 +++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index 95f6a9617b0b..75df220e4b51 100644 --- a/sound/soc/fsl

[PATCH 4/4] ASoC: fsl_asrc: swap input and output clocks in capture mode

2020-07-02 Thread Arnaud Ferraris
streams. As some of the clocks have different ID's depending on whether they are used as input or output, this requires adding a new function to find the output clock ID corresponding to a given input clock. Signed-off-by: Arnaud Ferraris --- sound/soc/fsl/fsl_asrc.c

[PATCH 0/4] ASoC: fsl_asrc: allow selecting arbitrary clocks

2020-07-02 Thread Arnaud Ferraris
assignment so conversion can be conducted effectively in both directions with a good quality. Arnaud Ferraris (4): dt-bindings: sound: fsl,asrc: add properties to select in/out clocks ASoC: fsl_asrc: allow using arbitrary input and output clocks ASoC: fsl_asrc: always use ratio for conversion

[PATCH 1/2] dt-bindings: sound: fsl-asoc-card: add new compatible for I2S slave

2020-07-02 Thread Arnaud Ferraris
igned-off-by: Arnaud Ferraris --- .../bindings/sound/fsl-asoc-card.txt | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt b/Documentation/devicetree/bindings/sound/fsl-asoc-card.txt

[PATCH 2/2] ASoC: fsl-asoc-card: add support for generic I2S slave use-case

2020-07-02 Thread Arnaud Ferraris
benefit from it too. Signed-off-by: Arnaud Ferraris --- sound/soc/fsl/fsl-asoc-card.c | 46 ++- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index 57ea1b072326..6076b963c873 100644 --- a

[PATCH 0/2] ASoC: fsl-asoc-card: add support for generic codecs

2020-07-02 Thread Arnaud Ferraris
the sound subsystem. This will allow using simple/dummy codecs along with ASRC. Arnaud Ferraris (2): dt-bindings: sound: fsl-asoc-card: add new compatible for I2S slave ASoC: fsl-asoc-card: add support for generic I2S slave use-case Documentation/devicetree/bindings/sound/fsl-asoc-card.txt