Commit eaff82ed authored by Padmavathi Venna's avatar Padmavathi Venna Committed by Kukjin Kim

ARM: S5PC100: Add I2S clkdev support

I2S controller has an internal mux for RCLK source clk. The list
of source clk names were passed through platform data in non-dt case.
Register the existing RCLK source clocks with clkdev using generic
connection id. This is required as part of adding DT support
for I2S controller driver.
Signed-off-by: default avatarPadmavathi Venna <padma.v@samsung.com>
Acked-by: default avatarSangbeom Kim <sbkim73@samsung.com>
Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
parent db7af96e
...@@ -605,24 +605,6 @@ static struct clk init_clocks_off[] = { ...@@ -605,24 +605,6 @@ static struct clk init_clocks_off[] = {
.parent = &clk_div_d1_bus.clk, .parent = &clk_div_d1_bus.clk,
.enable = s5pc100_d1_4_ctrl, .enable = s5pc100_d1_4_ctrl,
.ctrlbit = (1 << 13), .ctrlbit = (1 << 13),
}, {
.name = "iis",
.devname = "samsung-i2s.0",
.parent = &clk_div_pclkd1.clk,
.enable = s5pc100_d1_5_ctrl,
.ctrlbit = (1 << 0),
}, {
.name = "iis",
.devname = "samsung-i2s.1",
.parent = &clk_div_pclkd1.clk,
.enable = s5pc100_d1_5_ctrl,
.ctrlbit = (1 << 1),
}, {
.name = "iis",
.devname = "samsung-i2s.2",
.parent = &clk_div_pclkd1.clk,
.enable = s5pc100_d1_5_ctrl,
.ctrlbit = (1 << 2),
}, { }, {
.name = "ac97", .name = "ac97",
.parent = &clk_div_pclkd1.clk, .parent = &clk_div_pclkd1.clk,
...@@ -724,6 +706,30 @@ static struct clk clk_48m_spi2 = { ...@@ -724,6 +706,30 @@ static struct clk clk_48m_spi2 = {
.ctrlbit = (1 << 9), .ctrlbit = (1 << 9),
}; };
static struct clk clk_i2s0 = {
.name = "iis",
.devname = "samsung-i2s.0",
.parent = &clk_div_pclkd1.clk,
.enable = s5pc100_d1_5_ctrl,
.ctrlbit = (1 << 0),
};
static struct clk clk_i2s1 = {
.name = "iis",
.devname = "samsung-i2s.1",
.parent = &clk_div_pclkd1.clk,
.enable = s5pc100_d1_5_ctrl,
.ctrlbit = (1 << 1),
};
static struct clk clk_i2s2 = {
.name = "iis",
.devname = "samsung-i2s.2",
.parent = &clk_div_pclkd1.clk,
.enable = s5pc100_d1_5_ctrl,
.ctrlbit = (1 << 2),
};
static struct clk clk_vclk54m = { static struct clk clk_vclk54m = {
.name = "vclk_54m", .name = "vclk_54m",
.rate = 54000000, .rate = 54000000,
...@@ -1154,6 +1160,9 @@ static struct clk *clk_cdev[] = { ...@@ -1154,6 +1160,9 @@ static struct clk *clk_cdev[] = {
&clk_48m_spi0, &clk_48m_spi0,
&clk_48m_spi1, &clk_48m_spi1,
&clk_48m_spi2, &clk_48m_spi2,
&clk_i2s0,
&clk_i2s1,
&clk_i2s2,
}; };
static struct clksrc_clk *clksrc_cdev[] = { static struct clksrc_clk *clksrc_cdev[] = {
...@@ -1321,6 +1330,9 @@ static struct clk_lookup s5pc100_clk_lookup[] = { ...@@ -1321,6 +1330,9 @@ static struct clk_lookup s5pc100_clk_lookup[] = {
CLKDEV_INIT("s5pc100-spi.1", "spi_busclk2", &clk_sclk_spi1.clk), CLKDEV_INIT("s5pc100-spi.1", "spi_busclk2", &clk_sclk_spi1.clk),
CLKDEV_INIT("s5pc100-spi.2", "spi_busclk1", &clk_48m_spi2), CLKDEV_INIT("s5pc100-spi.2", "spi_busclk1", &clk_48m_spi2),
CLKDEV_INIT("s5pc100-spi.2", "spi_busclk2", &clk_sclk_spi2.clk), CLKDEV_INIT("s5pc100-spi.2", "spi_busclk2", &clk_sclk_spi2.clk),
CLKDEV_INIT("samsung-i2s.0", "i2s_opclk0", &clk_i2s0),
CLKDEV_INIT("samsung-i2s.1", "i2s_opclk0", &clk_i2s1),
CLKDEV_INIT("samsung-i2s.2", "i2s_opclk0", &clk_i2s2),
}; };
void __init s5pc100_register_clocks(void) void __init s5pc100_register_clocks(void)
......
...@@ -39,18 +39,12 @@ static int s5pc100_cfg_i2s(struct platform_device *pdev) ...@@ -39,18 +39,12 @@ static int s5pc100_cfg_i2s(struct platform_device *pdev)
return 0; return 0;
} }
static const char *rclksrc_v5[] = {
[0] = "iis",
[1] = "i2sclkd2",
};
static struct s3c_audio_pdata i2sv5_pdata = { static struct s3c_audio_pdata i2sv5_pdata = {
.cfg_gpio = s5pc100_cfg_i2s, .cfg_gpio = s5pc100_cfg_i2s,
.type = { .type = {
.i2s = { .i2s = {
.quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI .quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI
| QUIRK_NEED_RSTCLR, | QUIRK_NEED_RSTCLR,
.src_clk = rclksrc_v5,
}, },
}, },
}; };
...@@ -72,18 +66,8 @@ struct platform_device s5pc100_device_iis0 = { ...@@ -72,18 +66,8 @@ struct platform_device s5pc100_device_iis0 = {
}, },
}; };
static const char *rclksrc_v3[] = {
[0] = "iis",
[1] = "sclk_audio",
};
static struct s3c_audio_pdata i2sv3_pdata = { static struct s3c_audio_pdata i2sv3_pdata = {
.cfg_gpio = s5pc100_cfg_i2s, .cfg_gpio = s5pc100_cfg_i2s,
.type = {
.i2s = {
.src_clk = rclksrc_v3,
},
},
}; };
static struct resource s5pc100_iis1_resource[] = { static struct resource s5pc100_iis1_resource[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment