From: Jassi Brar <jassi.brar@samsung.com>
To: alsa-devel@alsa-project.org
Cc: broonie@opensource.wolfsonmicro.com,
Jassi Brar <jassi.brar@samsung.com>,
ben-linux@fluff.org
Subject: [PATCH 15/20] ASoC: S3C: I2Sv2: Unify i2s_get_clock callback
Date: Wed, 10 Mar 2010 16:49:04 +0900 [thread overview]
Message-ID: <1268207349-9979-15-git-send-email-jassi.brar@samsung.com> (raw)
In-Reply-To: <1268207349-9979-14-git-send-email-jassi.brar@samsung.com>
Now that we have two callbacks s3c2412_i2s_get_clock & s3c64xx_i2s_get_clock
doing exactly the same thing, we can define one generic s3c_i2sv2_get_clock
and discard other two copies. Also, switch the users to make calls to the
newly defined and generic s3c_i2sv2_get_clock
Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
---
sound/soc/s3c24xx/jive_wm8750.c | 2 +-
sound/soc/s3c24xx/s3c-i2s-v2.c | 12 ++++++++++++
sound/soc/s3c24xx/s3c-i2s-v2.h | 2 ++
sound/soc/s3c24xx/s3c2412-i2s.c | 13 -------------
sound/soc/s3c24xx/s3c2412-i2s.h | 2 --
sound/soc/s3c24xx/s3c64xx-i2s.c | 12 ------------
sound/soc/s3c24xx/s3c64xx-i2s.h | 2 --
7 files changed, 15 insertions(+), 30 deletions(-)
diff --git a/sound/soc/s3c24xx/jive_wm8750.c b/sound/soc/s3c24xx/jive_wm8750.c
index 59dc2c6..304240d 100644
--- a/sound/soc/s3c24xx/jive_wm8750.c
+++ b/sound/soc/s3c24xx/jive_wm8750.c
@@ -70,7 +70,7 @@ static int jive_hw_params(struct snd_pcm_substream *substream,
}
s3c_i2sv2_iis_calc_rate(&div, NULL, params_rate(params),
- s3c2412_get_iisclk());
+ s3c_i2sv2_get_clock(cpu_dai));
/* set codec DAI configuration */
ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
diff --git a/sound/soc/s3c24xx/s3c-i2s-v2.c b/sound/soc/s3c24xx/s3c-i2s-v2.c
index 1b29b4b..ecb3054 100644
--- a/sound/soc/s3c24xx/s3c-i2s-v2.c
+++ b/sound/soc/s3c24xx/s3c-i2s-v2.c
@@ -499,6 +499,18 @@ static snd_pcm_sframes_t s3c2412_i2s_delay(struct snd_pcm_substream *substream,
return delay;
}
+struct clk *s3c_i2sv2_get_clock(struct snd_soc_dai *cpu_dai)
+{
+ struct s3c_i2sv2_info *i2s = to_info(cpu_dai);
+ u32 iismod = readl(i2s->regs + S3C2412_IISMOD);
+
+ if (iismod & S3C2412_IISMOD_IMS_SYSMUX)
+ return i2s->iis_cclk;
+ else
+ return i2s->iis_pclk;
+}
+EXPORT_SYMBOL_GPL(s3c_i2sv2_get_clock);
+
/* default table of all avaialable root fs divisors */
static unsigned int iis_fs_tab[] = { 256, 512, 384, 768 };
diff --git a/sound/soc/s3c24xx/s3c-i2s-v2.h b/sound/soc/s3c24xx/s3c-i2s-v2.h
index ea56467..39a6db6 100644
--- a/sound/soc/s3c24xx/s3c-i2s-v2.h
+++ b/sound/soc/s3c24xx/s3c-i2s-v2.h
@@ -60,6 +60,8 @@ struct s3c_i2sv2_info {
u32 suspend_iispsr;
};
+extern struct clk *s3c_i2sv2_get_clock(struct snd_soc_dai *cpu_dai);
+
struct s3c_i2sv2_rate_calc {
unsigned int clk_div; /* for prescaler */
unsigned int fs_div; /* for root frame clock */
diff --git a/sound/soc/s3c24xx/s3c2412-i2s.c b/sound/soc/s3c24xx/s3c2412-i2s.c
index 4996843..fe90867 100644
--- a/sound/soc/s3c24xx/s3c2412-i2s.c
+++ b/sound/soc/s3c24xx/s3c2412-i2s.c
@@ -91,19 +91,6 @@ static int s3c2412_i2s_set_sysclk(struct snd_soc_dai *cpu_dai,
return 0;
}
-
-struct clk *s3c2412_get_iisclk(void)
-{
- struct s3c_i2sv2_info *i2s = &s3c2412_i2s;
- u32 iismod = readl(i2s->regs + S3C2412_IISMOD);
-
- if (iismod & S3C2412_IISMOD_IMS_SYSMUX)
- return i2s->iis_cclk;
- else
- return i2s->iis_pclk;
-}
-EXPORT_SYMBOL_GPL(s3c2412_get_iisclk);
-
static inline struct s3c_i2sv2_info *to_info(struct snd_soc_dai *cpu_dai)
{
return cpu_dai->private_data;
diff --git a/sound/soc/s3c24xx/s3c2412-i2s.h b/sound/soc/s3c24xx/s3c2412-i2s.h
index 60cac00..0b5686b 100644
--- a/sound/soc/s3c24xx/s3c2412-i2s.h
+++ b/sound/soc/s3c24xx/s3c2412-i2s.h
@@ -24,8 +24,6 @@
#define S3C2412_CLKSRC_PCLK S3C_I2SV2_CLKSRC_PCLK
#define S3C2412_CLKSRC_I2SCLK S3C_I2SV2_CLKSRC_AUDIOBUS
-extern struct clk *s3c2412_get_iisclk(void);
-
extern struct snd_soc_dai s3c2412_i2s_dai;
#endif /* __SND_SOC_S3C24XX_S3C2412_I2S_H */
diff --git a/sound/soc/s3c24xx/s3c64xx-i2s.c b/sound/soc/s3c24xx/s3c64xx-i2s.c
index 9bcc99d..9343349 100644
--- a/sound/soc/s3c24xx/s3c64xx-i2s.c
+++ b/sound/soc/s3c24xx/s3c64xx-i2s.c
@@ -91,18 +91,6 @@ static int s3c64xx_i2s_set_sysclk(struct snd_soc_dai *cpu_dai,
return 0;
}
-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);
-
- if (iismod & S3C64XX_IISMOD_IMS_SYSMUX)
- return i2s->iis_cclk;
- else
- return i2s->iis_pclk;
-}
-EXPORT_SYMBOL_GPL(s3c64xx_i2s_get_clock);
-
static int s3c64xx_i2s_probe(struct platform_device *pdev,
struct snd_soc_dai *dai)
{
diff --git a/sound/soc/s3c24xx/s3c64xx-i2s.h b/sound/soc/s3c24xx/s3c64xx-i2s.h
index 53d2a0a..f27ed50 100644
--- a/sound/soc/s3c24xx/s3c64xx-i2s.h
+++ b/sound/soc/s3c24xx/s3c64xx-i2s.h
@@ -38,6 +38,4 @@ struct clk;
extern struct snd_soc_dai s3c64xx_i2s_dai[];
-extern struct clk *s3c64xx_i2s_get_clock(struct snd_soc_dai *dai);
-
#endif /* __SND_SOC_S3C24XX_S3C64XX_I2S_H */
--
1.6.2.5
next prev parent reply other threads:[~2010-03-10 8:23 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-10 7:48 [PATCH 01/20] ASoC: S3C: I2Sv2: Add missing semicolon Jassi Brar
2010-03-10 7:48 ` [PATCH 02/20] ASoC: S3C: I2Sv2: Reject immidiate register value Jassi Brar
2010-03-10 7:48 ` [PATCH 03/20] ASoC: S3C64XX: I2S: Make BCLK independent of sample size Jassi Brar
2010-03-10 7:48 ` [PATCH 04/20] ASoC: S3C: I2Sv2: Remove S3C_IIS_V2_SUPPORTED define Jassi Brar
2010-03-10 7:48 ` [PATCH 05/20] ASoC: S3C: I2Sv2: Unify clock source IDs Jassi Brar
2010-03-10 7:48 ` [PATCH 06/20] ASoC: s3c-i2s-v2 remove unnecessary headers Jassi Brar
2010-03-10 7:48 ` [PATCH 07/20] ASoC: s3c64xx-i2s remove unncessary headers Jassi Brar
2010-03-10 7:48 ` [PATCH 08/20] ASoC: S3C64XX: I2S: Move RATE and FMT defines to header Jassi Brar
2010-03-10 7:48 ` [PATCH 09/20] ASoC: S3C: I2Sv2: Segregate hw_params callback Jassi Brar
2010-03-10 7:48 ` [PATCH 10/20] ASoC: S3C: I2Sv2: Move register definitions closer to driver Jassi Brar
2010-03-10 7:49 ` [PATCH 11/20] ASoC: SAMSUNG: I2S: Add bit definitions Jassi Brar
2010-03-10 7:49 ` [PATCH 12/20] ASoC: S3C2412: I2S: Debug IMS field Jassi Brar
2010-03-10 7:49 ` [PATCH 13/20] ASoC: S3C2412: I2S: Return correct source clock Jassi Brar
2010-03-10 7:49 ` [PATCH 14/20] ASoC: S3C: I2Sv2: Discard redundant field iis_clk Jassi Brar
2010-03-10 7:49 ` Jassi Brar [this message]
2010-03-10 7:49 ` [PATCH 16/20] ASoC: S3C64XX: I2S: Use s3c2412 defines Jassi Brar
2010-03-10 7:49 ` [PATCH 17/20] ASoC: S3C: I2Sv2: Define new field for controller features Jassi Brar
2010-03-10 7:49 ` [PATCH 18/20] ASoC: S3C: I2S: Move set_sysclk callback to common code Jassi Brar
2010-03-10 7:49 ` [PATCH 19/20] ASoC: S3C64XX: IISv4: Add CPU driver Jassi Brar
2010-03-10 7:49 ` [PATCH 20/20] ASoC: SMDK64XX: Switch to IISv4 " Jassi Brar
2010-03-10 11:40 ` Mark Brown
2010-03-10 13:05 ` jassi brar
2010-03-10 11:39 ` [PATCH 19/20] ASoC: S3C64XX: IISv4: Add " Mark Brown
2010-03-10 12:57 ` jassi brar
2010-03-10 11:09 ` [PATCH 17/20] ASoC: S3C: I2Sv2: Define new field for controller features Mark Brown
2010-03-10 11:11 ` Mark Brown
2010-03-10 11:00 ` [PATCH 11/20] ASoC: SAMSUNG: I2S: Add bit definitions Mark Brown
2010-03-10 12:24 ` jassi brar
2010-03-10 12:38 ` Mark Brown
2010-03-10 12:49 ` jassi brar
2010-03-10 12:56 ` Mark Brown
2010-03-10 13:03 ` jassi brar
2010-03-10 14:11 ` Mark Brown
2010-04-27 2:55 ` [PATCH 10/20] ASoC: S3C: I2Sv2: Move register definitions closer to driver Ben Dooks
2010-03-10 14:14 ` [PATCH 09/20] ASoC: S3C: I2Sv2: Segregate hw_params callback Mark Brown
2010-03-10 18:46 ` Mark Brown
2010-03-10 10:51 ` [PATCH 08/20] ASoC: S3C64XX: I2S: Move RATE and FMT defines to header Mark Brown
2010-03-10 12:52 ` jassi brar
2010-03-10 12:59 ` Mark Brown
2010-03-10 13:01 ` [PATCH 07/20] ASoC: s3c64xx-i2s remove unncessary headers Mark Brown
2010-03-10 13:01 ` [PATCH 06/20] ASoC: s3c-i2s-v2 remove unnecessary headers Mark Brown
2010-03-10 13:01 ` [PATCH 05/20] ASoC: S3C: I2Sv2: Unify clock source IDs Mark Brown
2010-03-10 10:49 ` [PATCH 04/20] ASoC: S3C: I2Sv2: Remove S3C_IIS_V2_SUPPORTED define Mark Brown
2010-03-10 12:38 ` jassi brar
2010-03-10 12:51 ` Mark Brown
2010-03-10 12:31 ` [PATCH 03/20] ASoC: S3C64XX: I2S: Make BCLK independent of sample size Mark Brown
2010-03-10 12:46 ` jassi brar
2010-03-10 13:00 ` Mark Brown
2010-03-10 10:32 ` [PATCH 02/20] ASoC: S3C: I2Sv2: Reject immidiate register value Mark Brown
2010-03-10 12:27 ` jassi brar
2010-03-10 12:48 ` Mark Brown
2010-03-10 12:32 ` [PATCH 01/20] ASoC: S3C: I2Sv2: Add missing semicolon Mark Brown
2010-03-10 13:00 ` Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2010-03-10 8:12 [PATCH 15/20] ASoC: S3C: I2Sv2: Unify i2s_get_clock callback Jassi Brar
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=1268207349-9979-15-git-send-email-jassi.brar@samsung.com \
--to=jassi.brar@samsung.com \
--cc=alsa-devel@alsa-project.org \
--cc=ben-linux@fluff.org \
--cc=broonie@opensource.wolfsonmicro.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 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).