* [PATCH 08/10] S3C64XX I2S: Return correct codec clock
@ 2009-09-15 10:02 Jassi
2009-09-15 11:06 ` Mark Brown
0 siblings, 1 reply; 7+ messages in thread
From: Jassi @ 2009-09-15 10:02 UTC (permalink / raw)
To: linux-arm-kernel
When I2S controller is driven by PCLK, instead of SCLK_AUDIO, we
like to have iis_pclk.
Check the source clock selected and return appropriate clock pointer.
Signed-Off-by: Jassi <jassi.brar@samsung.com>
---
sound/soc/s3c24xx/s3c64xx-i2s.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/sound/soc/s3c24xx/s3c64xx-i2s.c b/sound/soc/s3c24xx/s3c64xx-i2s.c
index 62a7fce..66f4ded 100644
--- a/sound/soc/s3c24xx/s3c64xx-i2s.c
+++ b/sound/soc/s3c24xx/s3c64xx-i2s.c
@@ -133,8 +133,12 @@ static int s3c64xx_i2s_set_sysclk(struct snd_soc_dai *cpu_dai,
struct clk *s3c64xx_i2s_get_clock(struct snd_soc_dai *dai)
{
struct s3c_i2sv2_info *i2s = to_info(dai);
+ u32 iismod = readl(i2s->regs + S3C2412_IISMOD);
- return i2s->iis_cclk;
+ if(iismod & S3C64XX_IISMOD_IMS_SYSMUX)
+ return i2s->iis_cclk;
+ else
+ return i2s->iis_pclk;
}
EXPORT_SYMBOL_GPL(s3c64xx_i2s_get_clock);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 08/10] S3C64XX I2S: Return correct codec clock
2009-09-15 10:02 [PATCH 08/10] S3C64XX I2S: Return correct codec clock Jassi
@ 2009-09-15 11:06 ` Mark Brown
2009-09-15 11:21 ` jassi brar
0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2009-09-15 11:06 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Sep 15, 2009 at 07:02:40PM +0900, Jassi wrote:
> - return i2s->iis_cclk;
> + if(iismod & S3C64XX_IISMOD_IMS_SYSMUX)
> + return i2s->iis_cclk;
> + else
> + return i2s->iis_pclk;
There's three possible clocks here according to the datasheet - PCLK,
CLKAUDIO and I2SCLK - so this will still give the wrong clock some of
the time. Also, please use checkpatch.
Ideally we wouldn't have to export the clock at all, of course.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 08/10] S3C64XX I2S: Return correct codec clock
2009-09-15 11:06 ` Mark Brown
@ 2009-09-15 11:21 ` jassi brar
2009-09-15 11:56 ` Mark Brown
0 siblings, 1 reply; 7+ messages in thread
From: jassi brar @ 2009-09-15 11:21 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Sep 15, 2009 at 8:06 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Tue, Sep 15, 2009 at 07:02:40PM +0900, Jassi wrote:
>
>> - ? ? return i2s->iis_cclk;
>> + ? ? if(iismod & S3C64XX_IISMOD_IMS_SYSMUX)
>> + ? ? ? ? ? ? return i2s->iis_cclk;
>> + ? ? else
>> + ? ? ? ? ? ? return i2s->iis_pclk;
>
> There's three possible clocks here according to the datasheet - PCLK,
> CLKAUDIO and I2SCLK - so this will still give the wrong clock some of
> the time. ?Also, please use checkpatch
Yes, but the existing code doesn't consider I2SCLK at all.
The infra isn't there to provide the clock pointer anyhow.
Will use checkpatch, thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 08/10] S3C64XX I2S: Return correct codec clock
2009-09-15 11:21 ` jassi brar
@ 2009-09-15 11:56 ` Mark Brown
2009-09-16 5:16 ` jassi brar
0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2009-09-15 11:56 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Sep 15, 2009 at 08:21:05PM +0900, jassi brar wrote:
> On Tue, Sep 15, 2009 at 8:06 PM, Mark Brown
> > There's three possible clocks here according to the datasheet - PCLK,
> > CLKAUDIO and I2SCLK - so this will still give the wrong clock some of
> > the time. ?Also, please use checkpatch
> Yes, but the existing code doesn't consider I2SCLK at all.
> The infra isn't there to provide the clock pointer anyhow.
Please put a comment there explaining that, or ideally code that returns
an error in those cases, to make it clearer what's being done.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 08/10] S3C64XX I2S: Return correct codec clock
2009-09-15 11:56 ` Mark Brown
@ 2009-09-16 5:16 ` jassi brar
2009-09-16 11:09 ` Mark Brown
0 siblings, 1 reply; 7+ messages in thread
From: jassi brar @ 2009-09-16 5:16 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Sep 15, 2009 at 8:56 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Tue, Sep 15, 2009 at 08:21:05PM +0900, jassi brar wrote:
>> On Tue, Sep 15, 2009 at 8:06 PM, Mark Brown
>
>> > There's three possible clocks here according to the datasheet - PCLK,
>> > CLKAUDIO and I2SCLK - so this will still give the wrong clock some of
>> > the time. ?Also, please use checkpatch
>
>> Yes, but the existing code doesn't consider I2SCLK at all.
>> The infra isn't there to provide the clock pointer anyhow.
>
> Please put a comment there explaining that, or ideally code that returns
> an error in those cases, to make it clearer what's being done.
Wait, there is no option for selecting I2SCLK in the manual. That is
behind the MUX along with Mpll/Epll Out etc.
In the driver we actually have all the correct options : PCLK or
CLKAUDIO(which is the output of the MUX).
The IMS bit can select only either PCLK or CLKAUDIO.So, i guess
the patch is fine as it is.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 08/10] S3C64XX I2S: Return correct codec clock
2009-09-16 5:16 ` jassi brar
@ 2009-09-16 11:09 ` Mark Brown
2009-09-16 11:50 ` jassi brar
0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2009-09-16 11:09 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Sep 16, 2009 at 02:16:54PM +0900, jassi brar wrote:
> Wait, there is no option for selecting I2SCLK in the manual. That is
> behind the MUX along with Mpll/Epll Out etc.
> In the driver we actually have all the correct options : PCLK or
> CLKAUDIO(which is the output of the MUX).
> The IMS bit can select only either PCLK or CLKAUDIO.So, i guess
The datasheet I have says an IMS setting of 11 selects I2SCLK and an IMS
setting of 01 selects CLKAUDIOx. This seems odd to say the least but is
consistent with the move to a 2 bit register field for IMS rather than
adding a second register field for selection of master mode clock.
Could just be poor documentation, but it could be a restriction on the
clock that can be used in slave mode or an error in the diagram.
> the patch is fine as it is.
It at least needs checkpatch issues fixing.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 08/10] S3C64XX I2S: Return correct codec clock
2009-09-16 11:09 ` Mark Brown
@ 2009-09-16 11:50 ` jassi brar
0 siblings, 0 replies; 7+ messages in thread
From: jassi brar @ 2009-09-16 11:50 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Sep 16, 2009 at 8:09 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Wed, Sep 16, 2009 at 02:16:54PM +0900, jassi brar wrote:
>
>> Wait, there is no option for selecting I2SCLK in the manual. That is
>> behind the MUX along with Mpll/Epll Out etc.
>> In the driver we actually have all the correct options : PCLK or
>> CLKAUDIO(which is the output of the MUX).
>
>> The IMS bit can select only either PCLK or CLKAUDIO.So, i guess
>
> The datasheet I have says an IMS setting of 11 selects I2SCLK and an IMS
> setting of 01 selects CLKAUDIOx. ?This seems odd to say the least but is
> consistent with the move to a 2 bit register field for IMS rather than
> adding a second register field for selection of master mode clock.
> Could just be poor documentation, but it could be a restriction on the
> clock that can be used in slave mode or an error in the diagram.
Poor documentation, i guess, for i am myself unaware of any such limitation.
Revamping documentation is another part of the initiative.
>> ?the patch is fine as it is.
>
> It at least needs checkpatch issues fixing.
Ok, will resend. thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-09-16 11:50 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-15 10:02 [PATCH 08/10] S3C64XX I2S: Return correct codec clock Jassi
2009-09-15 11:06 ` Mark Brown
2009-09-15 11:21 ` jassi brar
2009-09-15 11:56 ` Mark Brown
2009-09-16 5:16 ` jassi brar
2009-09-16 11:09 ` Mark Brown
2009-09-16 11:50 ` jassi brar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).