Re: [alsa-devel] [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Nicolin Chen
On Tue, Feb 25, 2014 at 12:54:04AM -0300, Fabio Estevam wrote: > Hi Nicolin, > > On Tue, Feb 25, 2014 at 12:46 AM, Nicolin Chen > wrote: > >> So register it from the ESAI driver then. > > > > Then I think I need to find a way to pass the clock to CODEC driver... > > Does this example from

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Nicolin Chen
On Tue, Feb 25, 2014 at 12:52:32PM +0900, Mark Brown wrote: > On Tue, Feb 25, 2014 at 11:46:36AM +0800, Nicolin Chen wrote: > > On Tue, Feb 25, 2014 at 12:39:29PM +0900, Mark Brown wrote: > > > > So register it from the ESAI driver then. > > > Then I think I need to find a way to pass the clock

Re: [alsa-devel] [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Fabio Estevam
Hi Nicolin, On Tue, Feb 25, 2014 at 12:46 AM, Nicolin Chen wrote: >> So register it from the ESAI driver then. > > Then I think I need to find a way to pass the clock to CODEC driver... Does this example from mxs-saif help? commit 7c9e6150f2e7cbd60e0bc9a19118ca1dc97d2780 Author: Shawn Guo

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Mark Brown
On Tue, Feb 25, 2014 at 11:46:36AM +0800, Nicolin Chen wrote: > On Tue, Feb 25, 2014 at 12:39:29PM +0900, Mark Brown wrote: > > So register it from the ESAI driver then. > Then I think I need to find a way to pass the clock to CODEC driver... Won't the normal DT mechanisms work here? I'd

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Nicolin Chen
On Tue, Feb 25, 2014 at 12:39:29PM +0900, Mark Brown wrote: > On Tue, Feb 25, 2014 at 11:13:14AM +0800, Nicolin Chen wrote: > > On Tue, Feb 25, 2014 at 12:09:47PM +0900, Mark Brown wrote: > > > > We should be able to arrange to have the ESAI be a clock provider > > > shouldn't we? If the clocks

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Mark Brown
On Tue, Feb 25, 2014 at 11:13:14AM +0800, Nicolin Chen wrote: > On Tue, Feb 25, 2014 at 12:09:47PM +0900, Mark Brown wrote: > > We should be able to arrange to have the ESAI be a clock provider > > shouldn't we? If the clocks need to interface to other things (and they > > do) then we should be

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Nicolin Chen
On Tue, Feb 25, 2014 at 12:09:47PM +0900, Mark Brown wrote: > On Tue, Feb 25, 2014 at 10:38:41AM +0800, Nicolin Chen wrote: > > > Hmm...my words might not be so clear last time: we have to handle the > > dividers > > of ESAI in ESAI driver because the dividers is in the ESAI's IP, not in the >

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Mark Brown
On Tue, Feb 25, 2014 at 10:38:41AM +0800, Nicolin Chen wrote: > Hmm...my words might not be so clear last time: we have to handle the dividers > of ESAI in ESAI driver because the dividers is in the ESAI's IP, not in the > SoC > clock controlling unit. So it's hard to get them visible in the

Re: [alsa-devel] [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Nicolin Chen
On Mon, Feb 24, 2014 at 06:54:09PM +0100, Lars-Peter Clausen wrote: > Hi, > > Couple of trivial things. Will fix them all. Thanks a lot, Nicolin Chen > > On 02/24/2014 07:55 AM, Nicolin Chen wrote: > [...] > >+config SND_SOC_CS42888 > >+tristate "Cirrus Logic CS42888 CODEC" > >+

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Nicolin Chen
On Tue, Feb 25, 2014 at 09:00:27AM +0900, Mark Brown wrote: > On Tue, Feb 25, 2014 at 12:06:49AM +0800, Nicolin Chen wrote: > > On Mon, Feb 24, 2014 at 03:52:24PM +, Austin, Brian wrote: > > > Wait...Regarding this clock part, I just forgot the reason I put the code: > > > 385

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Nicolin Chen
On Mon, Feb 24, 2014 at 04:32:06PM +, Austin, Brian wrote: > > On Feb 24, 2014, at 10:06 AM, Nicolin Chen wrote: > > > On Mon, Feb 24, 2014 at 03:52:24PM +, Austin, Brian wrote: > +if (!IS_ERR(cs42888->clk)) > +clk_disable_unprepare(cs42888->clk); > >>>

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Mark Brown
On Tue, Feb 25, 2014 at 12:06:49AM +0800, Nicolin Chen wrote: > On Mon, Feb 24, 2014 at 03:52:24PM +, Austin, Brian wrote: > Wait...Regarding this clock part, I just forgot the reason I put the code: > 385 cs42888->clk = devm_clk_get(>dev, "mclk"); > 386 if

Re: [alsa-devel] [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Lars-Peter Clausen
Hi, Couple of trivial things. On 02/24/2014 07:55 AM, Nicolin Chen wrote: [...] +config SND_SOC_CS42888 + tristate "Cirrus Logic CS42888 CODEC" + depends on I2C should select REGMAP_I2C + [...] +#define CS42888_NUM_SUPPLIES 4 +static const char

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Austin, Brian
On Feb 24, 2014, at 10:06 AM, Nicolin Chen wrote: > On Mon, Feb 24, 2014 at 03:52:24PM +, Austin, Brian wrote: + if (!IS_ERR(cs42888->clk)) + clk_disable_unprepare(cs42888->clk); >>> >>> Does the device work without MCLK? >> Yes, MCLK is required. If you can’t get the

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Nicolin Chen
On Mon, Feb 24, 2014 at 03:52:24PM +, Austin, Brian wrote: > >> + if (!IS_ERR(cs42888->clk)) > >> + clk_disable_unprepare(cs42888->clk); > > > > Does the device work without MCLK? > Yes, MCLK is required. If you can’t get the clock you should error out. Wait...Regarding this clock

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Nicolin Chen
On Mon, Feb 24, 2014 at 03:52:24PM +, Austin, Brian wrote: > > > > >> + /* Disable auto-mute */ > >> + regmap_update_bits(cs42888->regmap, CS42888_TXCTL, > >> + CS42888_TXCTL_AMUTE | CS42888_TXCTL_DAC_SZC_MASK, > >> + CS42888_TXCTL_DAC_SZC_SR); > >

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Nicolin Chen
On Mon, Feb 24, 2014 at 08:30:11PM +0900, Mark Brown wrote: > On Mon, Feb 24, 2014 at 02:55:29PM +0800, Nicolin Chen wrote: > > This patch adds support for the Cirrus Logic CS42888 Audio CODEC that > > has four 24-bit A/D and eight 24-bit D/A converters. > > Looks generally good, some fairly

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Austin, Brian
> >> +/* Disable auto-mute */ >> +regmap_update_bits(cs42888->regmap, CS42888_TXCTL, >> + CS42888_TXCTL_AMUTE | CS42888_TXCTL_DAC_SZC_MASK, >> + CS42888_TXCTL_DAC_SZC_SR); > > Does this interfere with the manual mute controls or is it a

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Mark Brown
On Mon, Feb 24, 2014 at 02:55:29PM +0800, Nicolin Chen wrote: > This patch adds support for the Cirrus Logic CS42888 Audio CODEC that > has four 24-bit A/D and eight 24-bit D/A converters. Looks generally good, some fairly small nits below. > [ CS42888 supports both I2C and SPI control ports. As

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Mark Brown
On Mon, Feb 24, 2014 at 02:55:29PM +0800, Nicolin Chen wrote: This patch adds support for the Cirrus Logic CS42888 Audio CODEC that has four 24-bit A/D and eight 24-bit D/A converters. Looks generally good, some fairly small nits below. [ CS42888 supports both I2C and SPI control ports. As

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Austin, Brian
+/* Disable auto-mute */ +regmap_update_bits(cs42888-regmap, CS42888_TXCTL, + CS42888_TXCTL_AMUTE | CS42888_TXCTL_DAC_SZC_MASK, + CS42888_TXCTL_DAC_SZC_SR); Does this interfere with the manual mute controls or is it a separate thing?

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Nicolin Chen
On Mon, Feb 24, 2014 at 08:30:11PM +0900, Mark Brown wrote: On Mon, Feb 24, 2014 at 02:55:29PM +0800, Nicolin Chen wrote: This patch adds support for the Cirrus Logic CS42888 Audio CODEC that has four 24-bit A/D and eight 24-bit D/A converters. Looks generally good, some fairly small nits

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Nicolin Chen
On Mon, Feb 24, 2014 at 03:52:24PM +, Austin, Brian wrote: + /* Disable auto-mute */ + regmap_update_bits(cs42888-regmap, CS42888_TXCTL, + CS42888_TXCTL_AMUTE | CS42888_TXCTL_DAC_SZC_MASK, + CS42888_TXCTL_DAC_SZC_SR); Does this

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Nicolin Chen
On Mon, Feb 24, 2014 at 03:52:24PM +, Austin, Brian wrote: + if (!IS_ERR(cs42888-clk)) + clk_disable_unprepare(cs42888-clk); Does the device work without MCLK? Yes, MCLK is required. If you can’t get the clock you should error out. Wait...Regarding this clock part, I just

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Austin, Brian
On Feb 24, 2014, at 10:06 AM, Nicolin Chen guangyu.c...@freescale.com wrote: On Mon, Feb 24, 2014 at 03:52:24PM +, Austin, Brian wrote: + if (!IS_ERR(cs42888-clk)) + clk_disable_unprepare(cs42888-clk); Does the device work without MCLK? Yes, MCLK is required. If you can’t

Re: [alsa-devel] [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Lars-Peter Clausen
Hi, Couple of trivial things. On 02/24/2014 07:55 AM, Nicolin Chen wrote: [...] +config SND_SOC_CS42888 + tristate Cirrus Logic CS42888 CODEC + depends on I2C should select REGMAP_I2C + [...] +#define CS42888_NUM_SUPPLIES 4 +static const char

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Mark Brown
On Tue, Feb 25, 2014 at 12:06:49AM +0800, Nicolin Chen wrote: On Mon, Feb 24, 2014 at 03:52:24PM +, Austin, Brian wrote: Wait...Regarding this clock part, I just forgot the reason I put the code: 385 cs42888-clk = devm_clk_get(i2c-dev, mclk); 386 if (IS_ERR(cs42888-clk))

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Nicolin Chen
On Mon, Feb 24, 2014 at 04:32:06PM +, Austin, Brian wrote: On Feb 24, 2014, at 10:06 AM, Nicolin Chen guangyu.c...@freescale.com wrote: On Mon, Feb 24, 2014 at 03:52:24PM +, Austin, Brian wrote: +if (!IS_ERR(cs42888-clk)) +

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Nicolin Chen
On Tue, Feb 25, 2014 at 09:00:27AM +0900, Mark Brown wrote: On Tue, Feb 25, 2014 at 12:06:49AM +0800, Nicolin Chen wrote: On Mon, Feb 24, 2014 at 03:52:24PM +, Austin, Brian wrote: Wait...Regarding this clock part, I just forgot the reason I put the code: 385 cs42888-clk =

Re: [alsa-devel] [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Nicolin Chen
On Mon, Feb 24, 2014 at 06:54:09PM +0100, Lars-Peter Clausen wrote: Hi, Couple of trivial things. Will fix them all. Thanks a lot, Nicolin Chen On 02/24/2014 07:55 AM, Nicolin Chen wrote: [...] +config SND_SOC_CS42888 +tristate Cirrus Logic CS42888 CODEC +depends on I2C

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Mark Brown
On Tue, Feb 25, 2014 at 10:38:41AM +0800, Nicolin Chen wrote: Hmm...my words might not be so clear last time: we have to handle the dividers of ESAI in ESAI driver because the dividers is in the ESAI's IP, not in the SoC clock controlling unit. So it's hard to get them visible in the clock

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Nicolin Chen
On Tue, Feb 25, 2014 at 12:09:47PM +0900, Mark Brown wrote: On Tue, Feb 25, 2014 at 10:38:41AM +0800, Nicolin Chen wrote: Hmm...my words might not be so clear last time: we have to handle the dividers of ESAI in ESAI driver because the dividers is in the ESAI's IP, not in the SoC

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Mark Brown
On Tue, Feb 25, 2014 at 11:13:14AM +0800, Nicolin Chen wrote: On Tue, Feb 25, 2014 at 12:09:47PM +0900, Mark Brown wrote: We should be able to arrange to have the ESAI be a clock provider shouldn't we? If the clocks need to interface to other things (and they do) then we should be able to

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Nicolin Chen
On Tue, Feb 25, 2014 at 12:39:29PM +0900, Mark Brown wrote: On Tue, Feb 25, 2014 at 11:13:14AM +0800, Nicolin Chen wrote: On Tue, Feb 25, 2014 at 12:09:47PM +0900, Mark Brown wrote: We should be able to arrange to have the ESAI be a clock provider shouldn't we? If the clocks need to

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Mark Brown
On Tue, Feb 25, 2014 at 11:46:36AM +0800, Nicolin Chen wrote: On Tue, Feb 25, 2014 at 12:39:29PM +0900, Mark Brown wrote: So register it from the ESAI driver then. Then I think I need to find a way to pass the clock to CODEC driver... Won't the normal DT mechanisms work here? I'd expect

Re: [alsa-devel] [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Fabio Estevam
Hi Nicolin, On Tue, Feb 25, 2014 at 12:46 AM, Nicolin Chen guangyu.c...@freescale.com wrote: So register it from the ESAI driver then. Then I think I need to find a way to pass the clock to CODEC driver... Does this example from mxs-saif help? commit 7c9e6150f2e7cbd60e0bc9a19118ca1dc97d2780

Re: [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Nicolin Chen
On Tue, Feb 25, 2014 at 12:52:32PM +0900, Mark Brown wrote: On Tue, Feb 25, 2014 at 11:46:36AM +0800, Nicolin Chen wrote: On Tue, Feb 25, 2014 at 12:39:29PM +0900, Mark Brown wrote: So register it from the ESAI driver then. Then I think I need to find a way to pass the clock to CODEC

Re: [alsa-devel] [PATCH] ASoC: cs42888: Add codec driver support

2014-02-24 Thread Nicolin Chen
On Tue, Feb 25, 2014 at 12:54:04AM -0300, Fabio Estevam wrote: Hi Nicolin, On Tue, Feb 25, 2014 at 12:46 AM, Nicolin Chen guangyu.c...@freescale.com wrote: So register it from the ESAI driver then. Then I think I need to find a way to pass the clock to CODEC driver... Does this

[PATCH] ASoC: cs42888: Add codec driver support

2014-02-23 Thread Nicolin Chen
This patch adds support for the Cirrus Logic CS42888 Audio CODEC that has four 24-bit A/D and eight 24-bit D/A converters. [ CS42888 supports both I2C and SPI control ports. As initial patch, this patch only adds the support for I2C. ] Signed-off-by: Nicolin Chen ---

[PATCH] ASoC: cs42888: Add codec driver support

2014-02-23 Thread Nicolin Chen
This patch adds support for the Cirrus Logic CS42888 Audio CODEC that has four 24-bit A/D and eight 24-bit D/A converters. [ CS42888 supports both I2C and SPI control ports. As initial patch, this patch only adds the support for I2C. ] Signed-off-by: Nicolin Chen guangyu.c...@freescale.com ---