Skip to contentSkip to conversation

S3C64XX IISv4 support

PATCH New Mark Brown 4 participants 23 messages Nov 27, 2009 – Dec 4, 2009

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

cover S3C64XX IISv4 support

This patch series adds the arch/arm changes required to support the IISv4 block on the S3C6410 CPU, plus providing hookup for the block on the SMDK6410. I know it's a bit late but it'd be great if we could get this into 2.6.33 - it'd be *very* handy for ASoC development.

Jassi (1):

      S3C64XX: Declare IISv4 PCLK for S3C6410

Mark Brown (6):
S3C64XX: Staticise platform data for PCM devices
S3C6410: Correct names of IISv4 data output pin definitions
S3C64XX: Add support for CLK_SRC2 configured clocks
S3C6410: Define CLK_AUDIO2 for IISv4 block
S3C6410: Use platform data to supply pin configuration for IISv4
SMDK6410: Register IISv4 device

 arch/arm/mach-s3c6410/mach-smdk6410.c            |    1 +
 arch/arm/plat-s3c64xx/clock.c                    |    8 +++
 arch/arm/plat-s3c64xx/dev-audio.c                |   26 ++++++++-
 arch/arm/plat-s3c64xx/include/plat/gpio-bank-c.h |    6 +-
 arch/arm/plat-s3c64xx/include/plat/regs-clock.h  |    4 ++
 arch/arm/plat-s3c64xx/s3c6400-clock.c            |   64 +++++++++++++++++++++-
 6 files changed, 101 insertions(+), 8 deletions(-)
author
#1 lore raw

PATCH 1/7 S3C64XX: Staticise platform data for PCM devices

The symbols aren't declared and don't need to be exported, they go along with the device structure.

---
 arch/arm/plat-s3c64xx/dev-audio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/plat-s3c64xx/dev-audio.c +2 -2
index 9e07344..a21a88f 100644
@@ -118,7 +118,7 @@ static struct resource s3c64xx_pcm0_resource[] = {
 	},
 };
 
-struct s3c_audio_pdata s3c_pcm0_pdata = {
+static struct s3c_audio_pdata s3c_pcm0_pdata = {
 	.cfg_gpio = s3c64xx_pcm_cfg_gpio,
 };
 
@@ -151,7 +151,7 @@ static struct resource s3c64xx_pcm1_resource[] = {
 	},
 };
 
-struct s3c_audio_pdata s3c_pcm1_pdata = {
+static struct s3c_audio_pdata s3c_pcm1_pdata = {
 	.cfg_gpio = s3c64xx_pcm_cfg_gpio,
 };
 
Signature · 1 line
1.6.5.3
#2 lore raw

PATCH 1/7 S3C64XX: Staticise platform data for PCM devices

Quoted 2 lines · Mark Brown

The symbols aren't declared and don't need to be exported, they go along with the device structure.

yes, that was a careless omission on my part. thanks.

Quoted 36 lines

---
?arch/arm/plat-s3c64xx/dev-audio.c | ? ?4 ++--
?1 files changed, 2 insertions(+), 2 deletions(-)

arch/arm/plat-s3c64xx/dev-audio.c +2 -3
index 9e07344..a21a88f 100644
@@ -118,7 +118,7 @@ static struct resource s3c64xx_pcm0_resource[] = {
 ? ? ? ?},
 ?};
 
-struct s3c_audio_pdata s3c_pcm0_pdata = {
+static struct s3c_audio_pdata s3c_pcm0_pdata = {
 ? ? ? ?.cfg_gpio = s3c64xx_pcm_cfg_gpio,
 ?};
 
@@ -151,7 +151,7 @@ static struct resource s3c64xx_pcm1_resource[] = {
 ? ? ? ?},
 ?};
 
-struct s3c_audio_pdata s3c_pcm1_pdata = {
+static struct s3c_audio_pdata s3c_pcm1_pdata = {
 ? ? ? ?.cfg_gpio = s3c64xx_pcm_cfg_gpio,
 ?};
 
--

1.6.5.3

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#3 lore raw

PATCH 1/7 S3C64XX: Staticise platform data for PCM devices

Quoted 5 lines · jassi brar
Quoted 2 lines · Mark Brown

The symbols aren't declared and don't need to be exported, they go along with the device structure.

yes, that was a careless omission on my part. thanks.

would be nice to supply an Acked-by: line if you think this is a good idea.

Quoted 41 lines
Quoted 31 lines

---
?arch/arm/plat-s3c64xx/dev-audio.c | ? ?4 ++--
?1 files changed, 2 insertions(+), 2 deletions(-)

arch/arm/plat-s3c64xx/dev-audio.c +2 -3
index 9e07344..a21a88f 100644
@@ -118,7 +118,7 @@ static struct resource s3c64xx_pcm0_resource[] = {
 ? ? ? ?},
 ?};
 
-struct s3c_audio_pdata s3c_pcm0_pdata = {
+static struct s3c_audio_pdata s3c_pcm0_pdata = {
 ? ? ? ?.cfg_gpio = s3c64xx_pcm_cfg_gpio,
 ?};
 
@@ -151,7 +151,7 @@ static struct resource s3c64xx_pcm1_resource[] = {
 ? ? ? ?},
 ?};
 
-struct s3c_audio_pdata s3c_pcm1_pdata = {
+static struct s3c_audio_pdata s3c_pcm1_pdata = {
 ? ? ? ?.cfg_gpio = s3c64xx_pcm_cfg_gpio,
 ?};
 
--

1.6.5.3

Quoted 5 lines

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Signature · 5 lines
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.
#4 lore raw

PATCH 1/7 S3C64XX: Staticise platform data for PCM devices

In reply to Mark Brown
Quoted 31 lines · Mark Brown

The symbols aren't declared and don't need to be exported, they go along with the device structure.

---
?arch/arm/plat-s3c64xx/dev-audio.c | ? ?4 ++--
?1 files changed, 2 insertions(+), 2 deletions(-)

arch/arm/plat-s3c64xx/dev-audio.c +2 -3
index 9e07344..a21a88f 100644
@@ -118,7 +118,7 @@ static struct resource s3c64xx_pcm0_resource[] = {
 ? ? ? ?},
 ?};
 
-struct s3c_audio_pdata s3c_pcm0_pdata = {
+static struct s3c_audio_pdata s3c_pcm0_pdata = {
 ? ? ? ?.cfg_gpio = s3c64xx_pcm_cfg_gpio,
 ?};
 
@@ -151,7 +151,7 @@ static struct resource s3c64xx_pcm1_resource[] = {
 ? ? ? ?},
 ?};
 
-struct s3c_audio_pdata s3c_pcm1_pdata = {
+static struct s3c_audio_pdata s3c_pcm1_pdata = {
 ? ? ? ?.cfg_gpio = s3c64xx_pcm_cfg_gpio,
 ?};
 
--
Quoted 1 line

1.6.5.3

#5 lore raw

PATCH 1/7 S3C64XX: Staticise platform data for PCM devices

In reply to Mark Brown
Quoted 2 lines · Mark Brown

The symbols aren't declared and don't need to be exported, they go along with the device structure.

hmm, the platform data configuration patch seems to be missing, is this based on something earlier that has been missed?

Quoted 35 lines
---
 arch/arm/plat-s3c64xx/dev-audio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/plat-s3c64xx/dev-audio.c +2 -2
index 9e07344..a21a88f 100644
@@ -118,7 +118,7 @@ static struct resource s3c64xx_pcm0_resource[] = {
 	},
 };
 
-struct s3c_audio_pdata s3c_pcm0_pdata = {
+static struct s3c_audio_pdata s3c_pcm0_pdata = {
 	.cfg_gpio = s3c64xx_pcm_cfg_gpio,
 };
 
@@ -151,7 +151,7 @@ static struct resource s3c64xx_pcm1_resource[] = {
 	},
 };
 
-struct s3c_audio_pdata s3c_pcm1_pdata = {
+static struct s3c_audio_pdata s3c_pcm1_pdata = {
 	.cfg_gpio = s3c64xx_pcm_cfg_gpio,
 };
 
Signature · 7 lines
1.6.5.3


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.
author
#6 lore raw

PATCH 1/7 S3C64XX: Staticise platform data for PCM devices

Quoted 7 lines · Ben Dooks
Quoted 2 lines · Mark Brown

The symbols aren't declared and don't need to be exported, they go along with the device structure.

hmm, the platform data configuration patch seems to be missing, is this
based on something earlier that has been missed?

Doh, that's in the ASoC tree. I'll apply this myself. Sorry.

Quoted 47 lines
Quoted 39 lines

---
arch/arm/plat-s3c64xx/dev-audio.c | 4 ++--

1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/plat- renamed from arch/arm/plat-s3c64xx/dev-audio.c +0 -0

s3c64xx/dev-audio.c
index 9e07344..a21a88f 100644

arch/arm/plat-s3c64xx/dev-audio.c +2 -2
@@ -118,7 +118,7 @@ static struct resource s3c64xx_pcm0_resource[]  
 = {
   },
 };
 
-struct s3c_audio_pdata s3c_pcm0_pdata = {
+static struct s3c_audio_pdata s3c_pcm0_pdata = {
   .cfg_gpio = s3c64xx_pcm_cfg_gpio,
 };
@@ -151,7 +151,7 @@ static struct resource s3c64xx_pcm1_resource[]  
 = {
   },
 };
 
-struct s3c_audio_pdata s3c_pcm1_pdata = {
+static struct s3c_audio_pdata s3c_pcm1_pdata = {
   .cfg_gpio = s3c64xx_pcm_cfg_gpio,
 };
Signature · 8 lines
-- 
1.6.5.3


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.
author
#7 lore raw

PATCH 2/7 S3C6410: Correct names of IISv4 data output pin definitions

In reply to Mark Brown

The naming of the defines suggests that there are three IISv4 ports with one data line each when in fact there is a single IISv4 port with three data lines.

---
 arch/arm/plat-s3c64xx/include/plat/gpio-bank-c.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/plat-s3c64xx/include/plat/gpio-bank-c.h +3 -3
index c47daf7..e22b49f 100644
@@ -36,18 +36,18 @@
 
 #define S3C64XX_GPC4_SPI_MISO1		(0x02 << 16)
 #define S3C64XX_GPC4_MMC2_CMD		(0x03 << 16)
-#define S3C64XX_GPC4_I2S0_V40_DO	(0x05 << 16)
+#define S3C64XX_GPC4_I2S_V40_DO0	(0x05 << 16)
 #define S3C64XX_GPC4_EINT_G2_4		(0x07 << 16)
 
 #define S3C64XX_GPC5_SPI_CLK1		(0x02 << 20)
 #define S3C64XX_GPC5_MMC2_CLK		(0x03 << 20)
-#define S3C64XX_GPC5_I2S1_V40_DO	(0x05 << 20)
+#define S3C64XX_GPC5_I2S_V40_DO1	(0x05 << 20)
 #define S3C64XX_GPC5_EINT_G2_5		(0x07 << 20)
 
 #define S3C64XX_GPC6_SPI_MOSI1		(0x02 << 24)
 #define S3C64XX_GPC6_EINT_G2_6		(0x07 << 24)
 
 #define S3C64XX_GPC7_SPI_nCS1		(0x02 << 28)
-#define S3C64XX_GPC7_I2S2_V40_DO	(0x05 << 28)
+#define S3C64XX_GPC7_I2S_V40_DO2	(0x05 << 28)
 #define S3C64XX_GPC7_EINT_G2_7		(0x07 << 28)
 
Signature · 1 line
1.6.5.3
#8 lore raw

PATCH 2/7 S3C6410: Correct names of IISv4 data output pin definitions

Quoted 3 lines · Mark Brown

The naming of the defines suggests that there are three IISv4 ports with one data line each when in fact there is a single IISv4 port with three data lines.

ok, will sort this out.

Quoted 39 lines
---
 arch/arm/plat-s3c64xx/include/plat/gpio-bank-c.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/plat-s3c64xx/include/plat/gpio-bank-c.h +3 -3
index c47daf7..e22b49f 100644
@@ -36,18 +36,18 @@
 
 #define S3C64XX_GPC4_SPI_MISO1		(0x02 << 16)
 #define S3C64XX_GPC4_MMC2_CMD		(0x03 << 16)
-#define S3C64XX_GPC4_I2S0_V40_DO	(0x05 << 16)
+#define S3C64XX_GPC4_I2S_V40_DO0	(0x05 << 16)
 #define S3C64XX_GPC4_EINT_G2_4		(0x07 << 16)
 
 #define S3C64XX_GPC5_SPI_CLK1		(0x02 << 20)
 #define S3C64XX_GPC5_MMC2_CLK		(0x03 << 20)
-#define S3C64XX_GPC5_I2S1_V40_DO	(0x05 << 20)
+#define S3C64XX_GPC5_I2S_V40_DO1	(0x05 << 20)
 #define S3C64XX_GPC5_EINT_G2_5		(0x07 << 20)
 
 #define S3C64XX_GPC6_SPI_MOSI1		(0x02 << 24)
 #define S3C64XX_GPC6_EINT_G2_6		(0x07 << 24)
 
 #define S3C64XX_GPC7_SPI_nCS1		(0x02 << 28)
-#define S3C64XX_GPC7_I2S2_V40_DO	(0x05 << 28)
+#define S3C64XX_GPC7_I2S_V40_DO2	(0x05 << 28)
 #define S3C64XX_GPC7_EINT_G2_7		(0x07 << 28)
 
Signature · 7 lines
1.6.5.3


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.
author
#9 lore raw

PATCH 3/7 S3C64XX: Add support for CLK_SRC2 configured clocks

In reply to Mark Brown

The S3C6410 has two clock source registers used for the clock muxes but currently the s3c_clksrc_clk infrastructure hardcodes the first one (where almost all of the clocks are). Make the source register a part of the clock definition to support addition of clocks using CLK_SRC2.

---
 arch/arm/plat-s3c64xx/s3c6400-clock.c |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)
arch/arm/plat-s3c64xx/s3c6400-clock.c +18 -3
index 6ffa21e..b7e2015 100644
@@ -61,6 +61,7 @@ struct clksrc_clk {
 
 	unsigned int		divider_shift;
 	void __iomem		*reg_divider;
+	void __iomem		*reg_src;
 };
 
 static struct clk clk_fout_apll = {
@@ -86,6 +87,7 @@ static struct clksrc_clk clk_mout_apll = {
 	.shift		= S3C6400_CLKSRC_APLL_MOUT_SHIFT,
 	.mask		= S3C6400_CLKSRC_APLL_MOUT,
 	.sources	= &clk_src_apll,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clk clk_fout_epll = {
@@ -111,6 +113,7 @@ static struct clksrc_clk clk_mout_epll = {
 	.shift		= S3C6400_CLKSRC_EPLL_MOUT_SHIFT,
 	.mask		= S3C6400_CLKSRC_EPLL_MOUT,
 	.sources	= &clk_src_epll,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clk *clk_src_mpll_list[] = {
@@ -131,6 +134,7 @@ static struct clksrc_clk clk_mout_mpll = {
 	.shift		= S3C6400_CLKSRC_MPLL_MOUT_SHIFT,
 	.mask		= S3C6400_CLKSRC_MPLL_MOUT,
 	.sources	= &clk_src_mpll,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static unsigned int armclk_mask;
@@ -313,7 +317,7 @@ static int s3c64xx_setparent_clksrc(struct clk *clk, struct clk *parent)
 {
 	struct clksrc_clk *sclk = to_clksrc(clk);
 	struct clk_sources *srcs = sclk->sources;
-	u32 clksrc = __raw_readl(S3C_CLK_SRC);
+	u32 clksrc = __raw_readl(sclk->reg_src);
 	int src_nr = -1;
 	int ptr;
 
@@ -327,7 +331,7 @@ static int s3c64xx_setparent_clksrc(struct clk *clk, struct clk *parent)
 		clksrc &= ~sclk->mask;
 		clksrc |= src_nr << sclk->shift;
 
-		__raw_writel(clksrc, S3C_CLK_SRC);
+		__raw_writel(clksrc, sclk->reg_src);
 
 		clk->parent = parent;
 		return 0;
@@ -374,6 +378,7 @@ static struct clksrc_clk clk_mmc0 = {
 	.sources	= &clkset_spi_mmc,
 	.divider_shift	= S3C6400_CLKDIV1_MMC0_SHIFT,
 	.reg_divider	= S3C_CLK_DIV1,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clksrc_clk clk_mmc1 = {
@@ -392,6 +397,7 @@ static struct clksrc_clk clk_mmc1 = {
 	.sources	= &clkset_spi_mmc,
 	.divider_shift	= S3C6400_CLKDIV1_MMC1_SHIFT,
 	.reg_divider	= S3C_CLK_DIV1,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clksrc_clk clk_mmc2 = {
@@ -410,6 +416,7 @@ static struct clksrc_clk clk_mmc2 = {
 	.sources	= &clkset_spi_mmc,
 	.divider_shift	= S3C6400_CLKDIV1_MMC2_SHIFT,
 	.reg_divider	= S3C_CLK_DIV1,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clksrc_clk clk_usbhost = {
@@ -428,6 +435,7 @@ static struct clksrc_clk clk_usbhost = {
 	.sources	= &clkset_uhost,
 	.divider_shift	= S3C6400_CLKDIV1_UHOST_SHIFT,
 	.reg_divider	= S3C_CLK_DIV1,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clksrc_clk clk_uart_uclk1 = {
@@ -446,6 +454,7 @@ static struct clksrc_clk clk_uart_uclk1 = {
 	.sources	= &clkset_uart,
 	.divider_shift	= S3C6400_CLKDIV2_UART_SHIFT,
 	.reg_divider	= S3C_CLK_DIV2,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 /* Where does UCLK0 come from? */
@@ -466,6 +475,7 @@ static struct clksrc_clk clk_spi0 = {
 	.sources	= &clkset_spi_mmc,
 	.divider_shift	= S3C6400_CLKDIV2_SPI0_SHIFT,
 	.reg_divider	= S3C_CLK_DIV2,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clksrc_clk clk_spi1 = {
@@ -484,6 +494,7 @@ static struct clksrc_clk clk_spi1 = {
 	.sources	= &clkset_spi_mmc,
 	.divider_shift	= S3C6400_CLKDIV2_SPI1_SHIFT,
 	.reg_divider	= S3C_CLK_DIV2,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clk clk_iis_cd0 = {
@@ -530,6 +541,7 @@ static struct clksrc_clk clk_audio0 = {
 	.sources	= &clkset_audio0,
 	.divider_shift	= S3C6400_CLKDIV2_AUDIO0_SHIFT,
 	.reg_divider	= S3C_CLK_DIV2,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clk *clkset_audio1_list[] = {
@@ -561,6 +573,7 @@ static struct clksrc_clk clk_audio1 = {
 	.sources	= &clkset_audio1,
 	.divider_shift	= S3C6400_CLKDIV2_AUDIO1_SHIFT,
 	.reg_divider	= S3C_CLK_DIV2,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clksrc_clk clk_irda = {
@@ -579,6 +592,7 @@ static struct clksrc_clk clk_irda = {
 	.sources	= &clkset_irda,
 	.divider_shift	= S3C6400_CLKDIV2_IRDA_SHIFT,
 	.reg_divider	= S3C_CLK_DIV2,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clk *clkset_camif_list[] = {
@@ -606,6 +620,7 @@ static struct clksrc_clk clk_camif = {
 	.sources	= &clkset_camif,
 	.divider_shift	= S3C6400_CLKDIV0_CAM_SHIFT,
 	.reg_divider	= S3C_CLK_DIV0,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 /* Clock initialisation code */
@@ -630,7 +645,7 @@ static struct clksrc_clk *init_parents[] = {
 static void __init_or_cpufreq s3c6400_set_clksrc(struct clksrc_clk *clk)
 {
 	struct clk_sources *srcs = clk->sources;
-	u32 clksrc = __raw_readl(S3C_CLK_SRC);
+	u32 clksrc = __raw_readl(clk->reg_src);
 
 	clksrc &= clk->mask;
 	clksrc >>= clk->shift;
Signature · 1 line
1.6.5.3
#10 lore raw

PATCH 3/7 S3C64XX: Add support for CLK_SRC2 configured clocks

Quoted 5 lines · Mark Brown

The S3C6410 has two clock source registers used for the clock muxes but currently the s3c_clksrc_clk infrastructure hardcodes the first one (where almost all of the clocks are). Make the source register a part of the clock definition to support addition of clocks using CLK_SRC2.

The s3c clock support is being restructured by Ben, so I didn't submit some patches that i had ready at one time. Maybe this too wud either have to wait or get consumed in the final changes.

Quoted 165 lines

---
?arch/arm/plat-s3c64xx/s3c6400-clock.c | ? 21 ++++++++++++++++++--- ?1 files changed, 18 insertions(+), 3 deletions(-)

arch/arm/plat-s3c64xx/s3c6400-clock.c +11 -2
index 6ffa21e..b7e2015 100644
@@ -61,6 +61,7 @@ struct clksrc_clk {
 
 ? ? ? ?unsigned int ? ? ? ? ? ?divider_shift;
 ? ? ? ?void __iomem ? ? ? ? ? ?*reg_divider;
+ ? ? ? void __iomem ? ? ? ? ? ?*reg_src;
 ?};
 
 ?static struct clk clk_fout_apll = {
@@ -86,6 +87,7 @@ static struct clksrc_clk clk_mout_apll = {
 ? ? ? ?.shift ? ? ? ? ?= S3C6400_CLKSRC_APLL_MOUT_SHIFT,
 ? ? ? ?.mask ? ? ? ? ? = S3C6400_CLKSRC_APLL_MOUT,
 ? ? ? ?.sources ? ? ? ?= &clk_src_apll,
+ ? ? ? .reg_src ? ? ? ?= S3C_CLK_SRC,
 ?};
 
 ?static struct clk clk_fout_epll = {
@@ -111,6 +113,7 @@ static struct clksrc_clk clk_mout_epll = {
 ? ? ? ?.shift ? ? ? ? ?= S3C6400_CLKSRC_EPLL_MOUT_SHIFT,
 ? ? ? ?.mask ? ? ? ? ? = S3C6400_CLKSRC_EPLL_MOUT,
 ? ? ? ?.sources ? ? ? ?= &clk_src_epll,
+ ? ? ? .reg_src ? ? ? ?= S3C_CLK_SRC,
 ?};
 
 ?static struct clk *clk_src_mpll_list[] = {
@@ -131,6 +134,7 @@ static struct clksrc_clk clk_mout_mpll = {
 ? ? ? ?.shift ? ? ? ? ?= S3C6400_CLKSRC_MPLL_MOUT_SHIFT,
 ? ? ? ?.mask ? ? ? ? ? = S3C6400_CLKSRC_MPLL_MOUT,
 ? ? ? ?.sources ? ? ? ?= &clk_src_mpll,
+ ? ? ? .reg_src ? ? ? ?= S3C_CLK_SRC,
 ?};
 
 ?static unsigned int armclk_mask;
@@ -313,7 +317,7 @@ static int s3c64xx_setparent_clksrc(struct clk *clk, struct clk *parent)
 ?{
 ? ? ? ?struct clksrc_clk *sclk = to_clksrc(clk);
 ? ? ? ?struct clk_sources *srcs = sclk->sources;
- ? ? ? u32 clksrc = __raw_readl(S3C_CLK_SRC);
+ ? ? ? u32 clksrc = __raw_readl(sclk->reg_src);
 ? ? ? ?int src_nr = -1;
 ? ? ? ?int ptr;
 
@@ -327,7 +331,7 @@ static int s3c64xx_setparent_clksrc(struct clk *clk, struct clk *parent)
 ? ? ? ? ? ? ? ?clksrc &= ~sclk->mask;
 ? ? ? ? ? ? ? ?clksrc |= src_nr << sclk->shift;
 
- ? ? ? ? ? ? ? __raw_writel(clksrc, S3C_CLK_SRC);
+ ? ? ? ? ? ? ? __raw_writel(clksrc, sclk->reg_src);
 
 ? ? ? ? ? ? ? ?clk->parent = parent;
 ? ? ? ? ? ? ? ?return 0;
@@ -374,6 +378,7 @@ static struct clksrc_clk clk_mmc0 = {
 ? ? ? ?.sources ? ? ? ?= &clkset_spi_mmc,
 ? ? ? ?.divider_shift ?= S3C6400_CLKDIV1_MMC0_SHIFT,
 ? ? ? ?.reg_divider ? ?= S3C_CLK_DIV1,
+ ? ? ? .reg_src ? ? ? ?= S3C_CLK_SRC,
 ?};
 
 ?static struct clksrc_clk clk_mmc1 = {
@@ -392,6 +397,7 @@ static struct clksrc_clk clk_mmc1 = {
 ? ? ? ?.sources ? ? ? ?= &clkset_spi_mmc,
 ? ? ? ?.divider_shift ?= S3C6400_CLKDIV1_MMC1_SHIFT,
 ? ? ? ?.reg_divider ? ?= S3C_CLK_DIV1,
+ ? ? ? .reg_src ? ? ? ?= S3C_CLK_SRC,
 ?};
 
 ?static struct clksrc_clk clk_mmc2 = {
@@ -410,6 +416,7 @@ static struct clksrc_clk clk_mmc2 = {
 ? ? ? ?.sources ? ? ? ?= &clkset_spi_mmc,
 ? ? ? ?.divider_shift ?= S3C6400_CLKDIV1_MMC2_SHIFT,
 ? ? ? ?.reg_divider ? ?= S3C_CLK_DIV1,
+ ? ? ? .reg_src ? ? ? ?= S3C_CLK_SRC,
 ?};
 
 ?static struct clksrc_clk clk_usbhost = {
@@ -428,6 +435,7 @@ static struct clksrc_clk clk_usbhost = {
 ? ? ? ?.sources ? ? ? ?= &clkset_uhost,
 ? ? ? ?.divider_shift ?= S3C6400_CLKDIV1_UHOST_SHIFT,
 ? ? ? ?.reg_divider ? ?= S3C_CLK_DIV1,
+ ? ? ? .reg_src ? ? ? ?= S3C_CLK_SRC,
 ?};
 
 ?static struct clksrc_clk clk_uart_uclk1 = {
@@ -446,6 +454,7 @@ static struct clksrc_clk clk_uart_uclk1 = {
 ? ? ? ?.sources ? ? ? ?= &clkset_uart,
 ? ? ? ?.divider_shift ?= S3C6400_CLKDIV2_UART_SHIFT,
 ? ? ? ?.reg_divider ? ?= S3C_CLK_DIV2,
+ ? ? ? .reg_src ? ? ? ?= S3C_CLK_SRC,
 ?};
 

?/* Where does UCLK0 come from? */

arch/arm/plat-s3c64xx/s3c6400-clock.c +6 -0
@@ -466,6 +475,7 @@ static struct clksrc_clk clk_spi0 = {
 ? ? ? ?.sources ? ? ? ?= &clkset_spi_mmc,
 ? ? ? ?.divider_shift ?= S3C6400_CLKDIV2_SPI0_SHIFT,
 ? ? ? ?.reg_divider ? ?= S3C_CLK_DIV2,
+ ? ? ? .reg_src ? ? ? ?= S3C_CLK_SRC,
 ?};
 
 ?static struct clksrc_clk clk_spi1 = {
@@ -484,6 +494,7 @@ static struct clksrc_clk clk_spi1 = {
 ? ? ? ?.sources ? ? ? ?= &clkset_spi_mmc,
 ? ? ? ?.divider_shift ?= S3C6400_CLKDIV2_SPI1_SHIFT,
 ? ? ? ?.reg_divider ? ?= S3C_CLK_DIV2,
+ ? ? ? .reg_src ? ? ? ?= S3C_CLK_SRC,
 ?};
 
 ?static struct clk clk_iis_cd0 = {
@@ -530,6 +541,7 @@ static struct clksrc_clk clk_audio0 = {
 ? ? ? ?.sources ? ? ? ?= &clkset_audio0,
 ? ? ? ?.divider_shift ?= S3C6400_CLKDIV2_AUDIO0_SHIFT,
 ? ? ? ?.reg_divider ? ?= S3C_CLK_DIV2,
+ ? ? ? .reg_src ? ? ? ?= S3C_CLK_SRC,
 ?};
 
 ?static struct clk *clkset_audio1_list[] = {
@@ -561,6 +573,7 @@ static struct clksrc_clk clk_audio1 = {
 ? ? ? ?.sources ? ? ? ?= &clkset_audio1,
 ? ? ? ?.divider_shift ?= S3C6400_CLKDIV2_AUDIO1_SHIFT,
 ? ? ? ?.reg_divider ? ?= S3C_CLK_DIV2,
+ ? ? ? .reg_src ? ? ? ?= S3C_CLK_SRC,
 ?};
 
 ?static struct clksrc_clk clk_irda = {
@@ -579,6 +592,7 @@ static struct clksrc_clk clk_irda = {
 ? ? ? ?.sources ? ? ? ?= &clkset_irda,
 ? ? ? ?.divider_shift ?= S3C6400_CLKDIV2_IRDA_SHIFT,
 ? ? ? ?.reg_divider ? ?= S3C_CLK_DIV2,
+ ? ? ? .reg_src ? ? ? ?= S3C_CLK_SRC,
 ?};
 
 ?static struct clk *clkset_camif_list[] = {
@@ -606,6 +620,7 @@ static struct clksrc_clk clk_camif = {
 ? ? ? ?.sources ? ? ? ?= &clkset_camif,
 ? ? ? ?.divider_shift ?= S3C6400_CLKDIV0_CAM_SHIFT,
 ? ? ? ?.reg_divider ? ?= S3C_CLK_DIV0,
+ ? ? ? .reg_src ? ? ? ?= S3C_CLK_SRC,
 ?};
 

?/* Clock initialisation code */

arch/arm/plat-s3c64xx/s3c6400-clock.c +1 -2
@@ -630,7 +645,7 @@ static struct clksrc_clk *init_parents[] = {
 ?static void __init_or_cpufreq s3c6400_set_clksrc(struct clksrc_clk *clk)
 ?{
 ? ? ? ?struct clk_sources *srcs = clk->sources;
- ? ? ? u32 clksrc = __raw_readl(S3C_CLK_SRC);
+ ? ? ? u32 clksrc = __raw_readl(clk->reg_src);
 
 ? ? ? ?clksrc &= clk->mask;
 ? ? ? ?clksrc >>= clk->shift;
--

1.6.5.3

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#11 lore raw

PATCH 3/7 S3C64XX: Add support for CLK_SRC2 configured clocks

In reply to Mark Brown
Quoted 5 lines · Mark Brown

The S3C6410 has two clock source registers used for the clock muxes but currently the s3c_clksrc_clk infrastructure hardcodes the first one (where almost all of the clocks are). Make the source register a part of the clock definition to support addition of clocks using CLK_SRC2.

the clock updates that where posted late last night will sort this out.

Quoted 164 lines
---
 arch/arm/plat-s3c64xx/s3c6400-clock.c |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)
arch/arm/plat-s3c64xx/s3c6400-clock.c +18 -3
index 6ffa21e..b7e2015 100644
@@ -61,6 +61,7 @@ struct clksrc_clk {
 
 	unsigned int		divider_shift;
 	void __iomem		*reg_divider;
+	void __iomem		*reg_src;
 };
 
 static struct clk clk_fout_apll = {
@@ -86,6 +87,7 @@ static struct clksrc_clk clk_mout_apll = {
 	.shift		= S3C6400_CLKSRC_APLL_MOUT_SHIFT,
 	.mask		= S3C6400_CLKSRC_APLL_MOUT,
 	.sources	= &clk_src_apll,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clk clk_fout_epll = {
@@ -111,6 +113,7 @@ static struct clksrc_clk clk_mout_epll = {
 	.shift		= S3C6400_CLKSRC_EPLL_MOUT_SHIFT,
 	.mask		= S3C6400_CLKSRC_EPLL_MOUT,
 	.sources	= &clk_src_epll,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clk *clk_src_mpll_list[] = {
@@ -131,6 +134,7 @@ static struct clksrc_clk clk_mout_mpll = {
 	.shift		= S3C6400_CLKSRC_MPLL_MOUT_SHIFT,
 	.mask		= S3C6400_CLKSRC_MPLL_MOUT,
 	.sources	= &clk_src_mpll,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static unsigned int armclk_mask;
@@ -313,7 +317,7 @@ static int s3c64xx_setparent_clksrc(struct clk *clk, struct clk *parent)
 {
 	struct clksrc_clk *sclk = to_clksrc(clk);
 	struct clk_sources *srcs = sclk->sources;
-	u32 clksrc = __raw_readl(S3C_CLK_SRC);
+	u32 clksrc = __raw_readl(sclk->reg_src);
 	int src_nr = -1;
 	int ptr;
 
@@ -327,7 +331,7 @@ static int s3c64xx_setparent_clksrc(struct clk *clk, struct clk *parent)
 		clksrc &= ~sclk->mask;
 		clksrc |= src_nr << sclk->shift;
 
-		__raw_writel(clksrc, S3C_CLK_SRC);
+		__raw_writel(clksrc, sclk->reg_src);
 
 		clk->parent = parent;
 		return 0;
@@ -374,6 +378,7 @@ static struct clksrc_clk clk_mmc0 = {
 	.sources	= &clkset_spi_mmc,
 	.divider_shift	= S3C6400_CLKDIV1_MMC0_SHIFT,
 	.reg_divider	= S3C_CLK_DIV1,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clksrc_clk clk_mmc1 = {
@@ -392,6 +397,7 @@ static struct clksrc_clk clk_mmc1 = {
 	.sources	= &clkset_spi_mmc,
 	.divider_shift	= S3C6400_CLKDIV1_MMC1_SHIFT,
 	.reg_divider	= S3C_CLK_DIV1,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clksrc_clk clk_mmc2 = {
@@ -410,6 +416,7 @@ static struct clksrc_clk clk_mmc2 = {
 	.sources	= &clkset_spi_mmc,
 	.divider_shift	= S3C6400_CLKDIV1_MMC2_SHIFT,
 	.reg_divider	= S3C_CLK_DIV1,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clksrc_clk clk_usbhost = {
@@ -428,6 +435,7 @@ static struct clksrc_clk clk_usbhost = {
 	.sources	= &clkset_uhost,
 	.divider_shift	= S3C6400_CLKDIV1_UHOST_SHIFT,
 	.reg_divider	= S3C_CLK_DIV1,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clksrc_clk clk_uart_uclk1 = {
@@ -446,6 +454,7 @@ static struct clksrc_clk clk_uart_uclk1 = {
 	.sources	= &clkset_uart,
 	.divider_shift	= S3C6400_CLKDIV2_UART_SHIFT,
 	.reg_divider	= S3C_CLK_DIV2,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 /* Where does UCLK0 come from? */
@@ -466,6 +475,7 @@ static struct clksrc_clk clk_spi0 = {
 	.sources	= &clkset_spi_mmc,
 	.divider_shift	= S3C6400_CLKDIV2_SPI0_SHIFT,
 	.reg_divider	= S3C_CLK_DIV2,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clksrc_clk clk_spi1 = {
@@ -484,6 +494,7 @@ static struct clksrc_clk clk_spi1 = {
 	.sources	= &clkset_spi_mmc,
 	.divider_shift	= S3C6400_CLKDIV2_SPI1_SHIFT,
 	.reg_divider	= S3C_CLK_DIV2,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clk clk_iis_cd0 = {
@@ -530,6 +541,7 @@ static struct clksrc_clk clk_audio0 = {
 	.sources	= &clkset_audio0,
 	.divider_shift	= S3C6400_CLKDIV2_AUDIO0_SHIFT,
 	.reg_divider	= S3C_CLK_DIV2,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clk *clkset_audio1_list[] = {
@@ -561,6 +573,7 @@ static struct clksrc_clk clk_audio1 = {
 	.sources	= &clkset_audio1,
 	.divider_shift	= S3C6400_CLKDIV2_AUDIO1_SHIFT,
 	.reg_divider	= S3C_CLK_DIV2,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clksrc_clk clk_irda = {
@@ -579,6 +592,7 @@ static struct clksrc_clk clk_irda = {
 	.sources	= &clkset_irda,
 	.divider_shift	= S3C6400_CLKDIV2_IRDA_SHIFT,
 	.reg_divider	= S3C_CLK_DIV2,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 static struct clk *clkset_camif_list[] = {
@@ -606,6 +620,7 @@ static struct clksrc_clk clk_camif = {
 	.sources	= &clkset_camif,
 	.divider_shift	= S3C6400_CLKDIV0_CAM_SHIFT,
 	.reg_divider	= S3C_CLK_DIV0,
+	.reg_src	= S3C_CLK_SRC,
 };
 
 /* Clock initialisation code */
@@ -630,7 +645,7 @@ static struct clksrc_clk *init_parents[] = {
 static void __init_or_cpufreq s3c6400_set_clksrc(struct clksrc_clk *clk)
 {
 	struct clk_sources *srcs = clk->sources;
-	u32 clksrc = __raw_readl(S3C_CLK_SRC);
+	u32 clksrc = __raw_readl(clk->reg_src);
 
 	clksrc &= clk->mask;
 	clksrc >>= clk->shift;
Signature · 7 lines
1.6.5.3


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.
author
#12 lore raw

PATCH 4/7 S3C64XX: Declare IISv4 PCLK for S3C6410

In reply to Mark Brown

From: Jassi <[email protected]>

[Updated the device ID to -1 since there's only one IISv4 device but the S3C clock API tries to match based on the ID of the requesting device (and not the name) -- broonie.]

---
 arch/arm/plat-s3c64xx/clock.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/plat-s3c64xx/clock.c +8 -0
index 7a36e89..2f1548e 100644
@@ -129,6 +129,14 @@ static struct clk init_clocks_disable[] = {
 		.enable		= s3c64xx_pclk_ctrl,
 		.ctrlbit	= S3C_CLKCON_PCLK_IIS1,
 	}, {
+#ifdef CONFIG_CPU_S3C6410
+		.name		= "iis",
+		.id		= -1,  /* There's only one IISv4 port */
+		.parent		= &clk_p,
+		.enable		= s3c64xx_pclk_ctrl,
+		.ctrlbit	= S3C6410_CLKCON_PCLK_IIS2,
+	}, {
+#endif
 		.name		= "spi",
 		.id		= 0,
 		.parent		= &clk_p,
Signature · 1 line
1.6.5.3
#13 lore raw

PATCH 4/7 S3C64XX: Declare IISv4 PCLK for S3C6410

Quoted 5 lines · Mark Brown

From: Jassi <[email protected]>

[Updated the device ID to -1 since there's only one IISv4 device but the S3C clock API tries to match based on the ID of the requesting device (and not the name) -- broonie.]

I had a quick look at the other clock changes and there are a couple of questions that have come up:

1) If changing the .id field of the iisv4 device really a good idea, especially if there might be more than one of them in the future?

2) The clock name for the current audio bus clock for the iisv4 unit is wrong as we're using it for both the iis and iisv4 blocks. It might be worth renaming the clock for the iisv4 audio bus before looking at changing the usage of the clock support (once the current changes have been sorted)

As such is the #ifdef of the clock code when the S3C6410 support really necesary?

Quoted 33 lines
---
 arch/arm/plat-s3c64xx/clock.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/plat-s3c64xx/clock.c +8 -0
index 7a36e89..2f1548e 100644
@@ -129,6 +129,14 @@ static struct clk init_clocks_disable[] = {
 		.enable		= s3c64xx_pclk_ctrl,
 		.ctrlbit	= S3C_CLKCON_PCLK_IIS1,
 	}, {
+#ifdef CONFIG_CPU_S3C6410
+		.name		= "iis",
+		.id		= -1,  /* There's only one IISv4 port */
+		.parent		= &clk_p,
+		.enable		= s3c64xx_pclk_ctrl,
+		.ctrlbit	= S3C6410_CLKCON_PCLK_IIS2,
+	}, {
+#endif
 		.name		= "spi",
 		.id		= 0,
 		.parent		= &clk_p,
Signature · 7 lines
1.6.5.3


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.
#14 lore raw

PATCH 4/7 S3C64XX: Declare IISv4 PCLK for S3C6410

Quoted 7 lines · Ben Dooks
Quoted 5 lines · Mark Brown

From: Jassi <[email protected]>

[Updated the device ID to -1 since there's only one IISv4 device but the S3C clock API tries to match based on the ID of the requesting device (and not the name) -- broonie.]

Quoted 5 lines

I had a quick look at the other clock changes and there are a couple of questions that have come up:

1) If changing the .id field of the iisv4 device really a good idea, ? especially if there might be more than one of them in the future?

I agree.
Also, changing indices of devices with disregard to their respective clock might force further adhoc changes in system resources.

I think, best wud be to modify s3c64xx_i2s.c to support 2 channel, 6 channel, h/w mixing(maybe LP-Audio feature too) and pass flag for each feature via platform data
by something like:- .has_6_channels, .has_hw_mixer, .has_lp_audio etc

The point to note here is to write drivers around functionality, rather than version, of the controller.

Quoted 55 lines

2) The clock name for the current audio bus clock for the iisv4 unit ? is wrong as we're using it for both the iis and iisv4 blocks. It ? might be worth renaming the clock for the iisv4 audio bus before ? looking at changing the usage of the clock support (once the current ? changes have been sorted)
As such is the #ifdef of the clock code when the S3C6410 support really necesary?

Quoted 29 lines

---
?arch/arm/plat-s3c64xx/clock.c | ? ?8 ++++++++
?1 files changed, 8 insertions(+), 0 deletions(-)

arch/arm/plat-s3c64xx/clock.c +8 -1
index 7a36e89..2f1548e 100644
@@ -129,6 +129,14 @@ static struct clk init_clocks_disable[] = {
 ? ? ? ? ? ? ? .enable ? ? ? ? = s3c64xx_pclk_ctrl,
 ? ? ? ? ? ? ? .ctrlbit ? ? ? ?= S3C_CLKCON_PCLK_IIS1,
 ? ? ? }, {
+#ifdef CONFIG_CPU_S3C6410
+ ? ? ? ? ? ? .name ? ? ? ? ? = "iis",
+ ? ? ? ? ? ? .id ? ? ? ? ? ? = -1, ?/* There's only one IISv4 port */
+ ? ? ? ? ? ? .parent ? ? ? ? = &clk_p,
+ ? ? ? ? ? ? .enable ? ? ? ? = s3c64xx_pclk_ctrl,
+ ? ? ? ? ? ? .ctrlbit ? ? ? ?= S3C6410_CLKCON_PCLK_IIS2,
+ ? ? }, {
+#endif
 ? ? ? ? ? ? ? .name ? ? ? ? ? = "spi",
 ? ? ? ? ? ? ? .id ? ? ? ? ? ? = 0,
 ? ? ? ? ? ? ? .parent ? ? ? ? = &clk_p,
--

1.6.5.3

Quoted 4 lines

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

--
--
Ben

Q: ? ? ?What's a light-year?
A: ? ? ?One-third less calories than a regular year.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

author
#15 lore raw

PATCH 4/7 S3C64XX: Declare IISv4 PCLK for S3C6410

Quoted 7 lines · jassi brar
Quoted 2 lines · Ben Dooks

1) If changing the .id field of the iisv4 device really a good idea, ? especially if there might be more than one of them in the future?

Also, changing indices of devices with disregard to their respective clock might force further adhoc changes in system resources.

Well, from that point of view we'd be much better off with clkdev which completely avoids the need to fiddle with id numbers to match clocks and devices; the fact that this is a concern is really a limitation of the clock API and open to fragility. There would also be issues if someone decided to do something like hang the PCM controllers off CLKAUDIO1 and 2 instead of 0 and 1, for example. It's only a concern because there is insufficient abstracton between the devices and clocks.

Quoted 7 lines

I think, best wud be to modify s3c64xx_i2s.c to support 2 channel, 6 channel, h/w mixing(maybe LP-Audio feature too) and pass flag for each feature via platform data
by something like:- .has_6_channels, .has_hw_mixer, .has_lp_audio etc

The point to note here is to write drivers around functionality, rather than version, of the controller.

This can also be addressed via use of library code (which is what's happening at the minute for the stuff that's shared between the 24xx and 64xx series). You can also look at this from the point of view of saying that IP blocks that are documented as having separate programming interfaces should be presented in a similar way to the user so that it's easier for them to find the functionality they need.

None of the approach I'm suggesting means that we can't have a single driver file which handles more than one revision of the controller, we can always move the registration of multiple variants into a single source file. The benefit is that we're not forced to do that so if the conditional code gets to be too much which does seem likely - there's already differences going from 24xx to 64xx, and I seem to recall that there are some incompatibilities between IISv2 and IISv4 on the 6410 too.

Since Samsung have not been willing to share documentation (I do have access to some but not all) it's hard to comment in detail on the most tasteful way of handling all these things but I have particular concerns about trying to fit more substantial functionality like hardware mixing support into the existing driver.

#16 lore raw

PATCH 4/7 S3C64XX: Declare IISv4 PCLK for S3C6410

Quoted 22 lines · Mark Brown
Quoted 7 lines · jassi brar
Quoted 2 lines · Ben Dooks

1) If changing the .id field of the iisv4 device really a good idea, ? especially if there might be more than one of them in the future?

Also, changing indices of devices with disregard to their respective clock might force further adhoc changes in system resources.

Well, from that point of view we'd be much better off with clkdev which completely avoids the need to fiddle with id numbers to match clocks and devices; the fact that this is a concern is really a limitation of the clock API and open to fragility. ?There would also be issues if someone decided to do something like hang the PCM controllers off CLKAUDIO1 and 2 instead of 0 and 1, for example. ?It's only a concern because there is insufficient abstracton between the devices and clocks.

Quoted 4 lines

I think, best wud be to modify s3c64xx_i2s.c to support 2 channel, 6 channel, h/w mixing(maybe LP-Audio feature too) and pass flag for each feature via platform data
by something like:- ?.has_6_channels, .has_hw_mixer, .has_lp_audio etc

Quoted 6 lines
Quoted 2 lines

The point to note here is to write drivers around functionality, rather than version, of the controller.

This can also be addressed via use of library code (which is what's happening at the minute for the stuff that's shared between the 24xx and 64xx series).

yes ofcourse.

Quoted 13 lines

?You can also look at this from the point of view of
saying that IP blocks that are documented as having separate programming interfaces should be presented in a similar way to the user so that it's easier for them to find the functionality they need.

None of the approach I'm suggesting means that we can't have a single driver file which handles more than one revision of the controller, we can always move the registration of multiple variants into a single source file. ?The benefit is that we're not forced to do that so if the conditional code gets to be too much which does seem likely - there's already differences going from 24xx to 64xx, and I seem to recall that there are some incompatibilities between IISv2 and IISv4 on the 6410 too.

Quoted 3 lines

Since Samsung have not been willing to share documentation (I do have access to some but not all) it's hard to comment in detail on the most tasteful way of handling all these things

If I am aware of what things u miss, i can try to reply in some permissible way.

Quoted 3 lines

but I have particular concerns
about trying to fit more substantial functionality like hardware mixing support into the existing driver.

that was just to make the point. I understand h/w mixing needs to be implemented as a 'secondary' playback stream. I have not got down to implement more features as yet.

author
#17 lore raw

PATCH 4/7 S3C64XX: Declare IISv4 PCLK for S3C6410

In reply to Ben Dooks
Quoted 10 lines · Ben Dooks
Quoted 2 lines · Mark Brown

[Updated the device ID to -1 since there's only one IISv4 device but the S3C clock API tries to match based on the ID of the requesting device

I had a quick look at the other clock changes and there are a couple of questions that have come up:

1) If changing the .id field of the iisv4 device really a good idea, especially if there might be more than one of them in the future?

Half the problem here is that the current S3C clock implementation is doing a half clkdevish thing and matching on the id field of the struct device that gets passed in with no indirection. This means that the either the devices or the clocks need their ids fixing to match the other. If we're worrying about further chips sharing the same clock tree definition tables we also need to worry about the possibility that a chip is going to come along which swaps out the hookup for one IP block with another unrelated IP block.

With the current scheme I imagine that all of this would be handled with conditional registration of the affected clocks based on the chip we're running on.

Quoted 2 lines

2) The clock name for the current audio bus clock for the iisv4 unit is wrong as we're using it for both the iis and iisv4 blocks. It

I'm not sure what you mean by this. The IIS and IISv4 blocks both use the same clock names in their documentation (as does the PCM block).

Quoted 3 lines

might be worth renaming the clock for the iisv4 audio bus before looking at changing the usage of the clock support (once the current changes have been sorted)

What name would you suggest?

Quoted 2 lines

As such is the #ifdef of the clock code when the S3C6410 support really necesary?

I inherited that bit from Jassi's original patch. The IISv4 block is not present on the S3C6400 so it didn't seem unreasonable.

author
#18 lore raw

PATCH 5/7 S3C6410: Define CLK_AUDIO2 for IISv4 block

In reply to Mark Brown

Note that due to the way the S3C clock API does matching based on the ID of the platform device the ID of CLK_AUDIO2 is set to -1.

---
 arch/arm/plat-s3c64xx/include/plat/regs-clock.h |    4 ++
 arch/arm/plat-s3c64xx/s3c6400-clock.c           |   43 +++++++++++++++++++++++
 2 files changed, 47 insertions(+), 0 deletions(-)
arch/arm/plat-s3c64xx/include/plat/regs-clock.h +4 -0
index ff46e7f..8c429bb 100644
@@ -25,6 +25,7 @@
 #define S3C_EPLL_CON0		S3C_CLKREG(0x14)
 #define S3C_EPLL_CON1		S3C_CLKREG(0x18)
 #define S3C_CLK_SRC		S3C_CLKREG(0x1C)
+#define S3C_CLK_SRC2		S3C_CLKREG(0x10C)
 #define S3C_CLK_DIV0		S3C_CLKREG(0x20)
 #define S3C_CLK_DIV1		S3C_CLKREG(0x24)
 #define S3C_CLK_DIV2		S3C_CLKREG(0x28)
@@ -221,5 +222,8 @@
 #define S3C6400_CLKSRC_UHOST_MASK	(0x3 << 5)
 #define S3C6400_CLKSRC_UHOST_SHIFT	(5)
 
+/* CLK_SRC2 */
+#define S3C6410_CLKSRC_AUDIO2_MASK	(0x7 << 0)
+#define S3C6410_CLKSRC_AUDIO2_SHIFT	(0)
 
 #endif /* _PLAT_REGS_CLOCK_H */
arch/arm/plat-s3c64xx/s3c6400-clock.c +43 -0

67 lines not on this page · raw message

Signature · 1 line
1.6.5.3
author
#19 lore raw

PATCH 6/7 S3C6410: Use platform data to supply pin configuration for IISv4

In reply to Mark Brown

Follow the lead of the PCM controller and make the driver less directly dependant on the particular CPU configuration.

---
 arch/arm/plat-s3c64xx/dev-audio.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
arch/arm/plat-s3c64xx/dev-audio.c +22 -0
index a21a88f..e49e1eb 100644
@@ -20,8 +20,10 @@
 
 #include <plat/devs.h>
 #include <plat/audio.h>
+#include <plat/gpio-bank-c.h>
 #include <plat/gpio-bank-d.h>
 #include <plat/gpio-bank-e.h>
+#include <plat/gpio-bank-h.h>
 #include <plat/gpio-cfg.h>
 
 static struct resource s3c64xx_iis0_resource[] = {
@@ -56,6 +58,23 @@ struct platform_device s3c64xx_device_iis1 = {
 };
 EXPORT_SYMBOL(s3c64xx_device_iis1);
 
+static int s3c64xx_iisv4_cfg_gpio(struct platform_device *pdev)
+{
+	s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C64XX_GPC4_I2S_V40_DO0);
+	s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C64XX_GPC5_I2S_V40_DO1);
+	s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C64XX_GPC7_I2S_V40_DO2);
+	s3c_gpio_cfgpin(S3C64XX_GPH(6), S3C64XX_GPH6_I2S_V40_BCLK);
+	s3c_gpio_cfgpin(S3C64XX_GPH(7), S3C64XX_GPH7_I2S_V40_CDCLK);
+	s3c_gpio_cfgpin(S3C64XX_GPH(8), S3C64XX_GPH8_I2S_V40_LRCLK);
+	s3c_gpio_cfgpin(S3C64XX_GPH(9), S3C64XX_GPH9_I2S_V40_DI);
+
+	return 0;
+}
+
+static struct s3c_audio_pdata s3c64xx_iisv4_pdata = {
+	.cfg_gpio = s3c64xx_iisv4_cfg_gpio,
+};
+
 static struct resource s3c64xx_iisv4_resource[] = {
 	[0] = {
 		.start = S3C64XX_PA_IISV4,
@@ -69,6 +88,9 @@ struct platform_device s3c64xx_device_iisv4 = {
 	.id		  = -1,
 	.num_resources	  = ARRAY_SIZE(s3c64xx_iisv4_resource),
 	.resource	  = s3c64xx_iisv4_resource,
+	.dev = {
+		.platform_data = &s3c64xx_iisv4_pdata,
+	},
 };
 EXPORT_SYMBOL(s3c64xx_device_iisv4);
 
Signature · 1 line
1.6.5.3
#20 lore raw

PATCH 6/7 S3C6410: Use platform data to supply pin configuration for IISv4

Quoted 34 lines · Mark Brown

Follow the lead of the PCM controller and make the driver less directly dependant on the particular CPU configuration.

---
?arch/arm/plat-s3c64xx/dev-audio.c | ? 22 ++++++++++++++++++++++ ?1 files changed, 22 insertions(+), 0 deletions(-)

arch/arm/plat-s3c64xx/dev-audio.c +0 -0
index a21a88f..e49e1eb 100644
@@ -20,8 +20,10 @@
 

?#include <plat/devs.h>
?#include <plat/audio.h>
+#include <plat/gpio-bank-c.h>
?#include <plat/gpio-bank-d.h>
?#include <plat/gpio-bank-e.h>
+#include <plat/gpio-bank-h.h>
?#include <plat/gpio-cfg.h>

?static struct resource s3c64xx_iis0_resource[] = {

arch/arm/plat-s3c64xx/dev-audio.c +7 -0
@@ -56,6 +58,23 @@ struct platform_device s3c64xx_device_iis1 = {
 ?};
 ?EXPORT_SYMBOL(s3c64xx_device_iis1);
 
+static int s3c64xx_iisv4_cfg_gpio(struct platform_device *pdev)
+{
+ ? ? ? s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C64XX_GPC4_I2S_V40_DO0);
+ ? ? ? s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C64XX_GPC5_I2S_V40_DO1);
+ ? ? ? s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C64XX_GPC7_I2S_V40_DO2);
+ ? ? ? s3c_gpio_cfgpin(S3C64XX_GPH(6), S3C64XX_GPH6_I2S_V40_BCLK);
+ ? ? ? s3c_gpio_cfgpin(S3C64XX_GPH(7), S3C64XX_GPH7_I2S_V40_CDCLK);

arch/arm/plat-s3c64xx/dev-audio.c struct platform_device s3c64xx_device_iis1 = { · line 77

Quoted 10 lines
arch/arm/plat-s3c64xx/dev-audio.c +10 -0
+ ? ? ? s3c_gpio_cfgpin(S3C64XX_GPH(8), S3C64XX_GPH8_I2S_V40_LRCLK);
+ ? ? ? s3c_gpio_cfgpin(S3C64XX_GPH(9), S3C64XX_GPH9_I2S_V40_DI);
+
+ ? ? ? return 0;
+}
+
+static struct s3c_audio_pdata s3c64xx_iisv4_pdata = {
+ ? ? ? .cfg_gpio = s3c64xx_iisv4_cfg_gpio,
+};
+

Yes. And I was preparing for v3 I2S controllers of s3c64xx too to be converted this way, otherwise the forthcoming support for 6440,C100,C110 etc wud need duplication of the code.

Quoted 12 lines
arch/arm/plat-s3c64xx/dev-audio.c +3 -0
 ?static struct resource s3c64xx_iisv4_resource[] = {
 ? ? ? ?[0] = {
 ? ? ? ? ? ? ? ?.start = S3C64XX_PA_IISV4,
@@ -69,6 +88,9 @@ struct platform_device s3c64xx_device_iisv4 = {
 ? ? ? ?.id ? ? ? ? ? ? ? = -1,
 ? ? ? ?.num_resources ? ?= ARRAY_SIZE(s3c64xx_iisv4_resource),
 ? ? ? ?.resource ? ? ? ? = s3c64xx_iisv4_resource,
+ ? ? ? .dev = {
+ ? ? ? ? ? ? ? .platform_data = &s3c64xx_iisv4_pdata,
+ ? ? ? },
 ?};
 ?EXPORT_SYMBOL(s3c64xx_device_iisv4);
#21 lore raw

PATCH 6/7 S3C6410: Use platform data to supply pin configuration for IISv4

In reply to Mark Brown
Quoted 2 lines · Mark Brown

Follow the lead of the PCM controller and make the driver less directly dependant on the particular CPU configuration.

ok, will apply.

Quoted 62 lines
---
 arch/arm/plat-s3c64xx/dev-audio.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
arch/arm/plat-s3c64xx/dev-audio.c +22 -0
index a21a88f..e49e1eb 100644
@@ -20,8 +20,10 @@
 
 #include <plat/devs.h>
 #include <plat/audio.h>
+#include <plat/gpio-bank-c.h>
 #include <plat/gpio-bank-d.h>
 #include <plat/gpio-bank-e.h>
+#include <plat/gpio-bank-h.h>
 #include <plat/gpio-cfg.h>
 
 static struct resource s3c64xx_iis0_resource[] = {
@@ -56,6 +58,23 @@ struct platform_device s3c64xx_device_iis1 = {
 };
 EXPORT_SYMBOL(s3c64xx_device_iis1);
 
+static int s3c64xx_iisv4_cfg_gpio(struct platform_device *pdev)
+{
+	s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C64XX_GPC4_I2S_V40_DO0);
+	s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C64XX_GPC5_I2S_V40_DO1);
+	s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C64XX_GPC7_I2S_V40_DO2);
+	s3c_gpio_cfgpin(S3C64XX_GPH(6), S3C64XX_GPH6_I2S_V40_BCLK);
+	s3c_gpio_cfgpin(S3C64XX_GPH(7), S3C64XX_GPH7_I2S_V40_CDCLK);
+	s3c_gpio_cfgpin(S3C64XX_GPH(8), S3C64XX_GPH8_I2S_V40_LRCLK);
+	s3c_gpio_cfgpin(S3C64XX_GPH(9), S3C64XX_GPH9_I2S_V40_DI);
+
+	return 0;
+}
+
+static struct s3c_audio_pdata s3c64xx_iisv4_pdata = {
+	.cfg_gpio = s3c64xx_iisv4_cfg_gpio,
+};
+
 static struct resource s3c64xx_iisv4_resource[] = {
 	[0] = {
 		.start = S3C64XX_PA_IISV4,
@@ -69,6 +88,9 @@ struct platform_device s3c64xx_device_iisv4 = {
 	.id		  = -1,
 	.num_resources	  = ARRAY_SIZE(s3c64xx_iisv4_resource),
 	.resource	  = s3c64xx_iisv4_resource,
+	.dev = {
+		.platform_data = &s3c64xx_iisv4_pdata,
+	},
 };
 EXPORT_SYMBOL(s3c64xx_device_iisv4);
 
Signature · 7 lines
1.6.5.3


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.
author
#22 lore raw

PATCH 7/7 SMDK6410: Register IISv4 device

In reply to Mark Brown

The IISv4 controller is connected to the WM8580 on the board.

---
 arch/arm/mach-s3c6410/mach-smdk6410.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/mach-s3c6410/mach-smdk6410.c +1 -0
index 480d297..52d431c 100644
@@ -236,6 +236,7 @@ static struct platform_device *smdk6410_devices[] __initdata = {
 	&s3c_device_fb,
 	&s3c_device_usb,
 	&s3c_device_usb_hsotg,
+	&s3c64xx_device_iisv4,
 
 #ifdef CONFIG_REGULATOR
 	&smdk6410_b_pwr_5v,
Signature · 1 line
1.6.5.3