ARM: S3C64XX: Upgrade platform device for I2S
authorJassi Brar <jassi.brar@samsung.com>
Thu, 18 Nov 2010 23:49:44 +0000 (08:49 +0900)
committerKukjin Kim <kgene.kim@samsung.com>
Thu, 18 Nov 2010 23:49:44 +0000 (08:49 +0900)
Add more information to I2S platform_devices in order to
prepare them for new controller driver.

Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
arch/arm/mach-s3c64xx/clock.c
arch/arm/mach-s3c64xx/dev-audio.c

index 7e03f0ae2fc821d8400846f4eb6dd8ea0b21256b..1c98d2ff2ed66e783bb63e0267eef60da69ba213 100644 (file)
@@ -695,7 +695,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk    = {
                        .name           = "audio-bus",
-                       .id             = -1,  /* There's only one IISv4 port */
+                       .id             = 2,
                        .ctrlbit        = S3C6410_CLKCON_SCLK_AUDIO2,
                        .enable         = s3c64xx_sclk_ctrl,
                },
index 447e4e7179ac9420f2fec549ea36094c4b9d08ff..7618627b98f5c6b53a1d97d89133fe828bfa7f7b 100644 (file)
 #include <plat/audio.h>
 #include <plat/gpio-cfg.h>
 
-static int s3c64xx_i2sv3_cfg_gpio(struct platform_device *pdev)
+static const char *rclksrc[] = {
+       [0] = "iis",
+       [1] = "audio-bus",
+};
+
+static int s3c64xx_i2s_cfg_gpio(struct platform_device *pdev)
 {
        unsigned int base;
 
@@ -33,6 +38,12 @@ static int s3c64xx_i2sv3_cfg_gpio(struct platform_device *pdev)
        case 1:
                base = S3C64XX_GPE(0);
                break;
+       case 2:
+               s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C_GPIO_SFN(5));
+               s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C_GPIO_SFN(5));
+               s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C_GPIO_SFN(5));
+               s3c_gpio_cfgpin_range(S3C64XX_GPH(6), 4, S3C_GPIO_SFN(5));
+               return 0;
        default:
                printk(KERN_DEBUG "Invalid I2S Controller number: %d\n",
                        pdev->id);
@@ -44,16 +55,6 @@ static int s3c64xx_i2sv3_cfg_gpio(struct platform_device *pdev)
        return 0;
 }
 
-static int s3c64xx_i2sv4_cfg_gpio(struct platform_device *pdev)
-{
-       s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C_GPIO_SFN(5));
-       s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C_GPIO_SFN(5));
-       s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C_GPIO_SFN(5));
-       s3c_gpio_cfgpin_range(S3C64XX_GPH(6), 4, S3C_GPIO_SFN(5));
-
-       return 0;
-}
-
 static struct resource s3c64xx_iis0_resource[] = {
        [0] = {
                .start = S3C64XX_PA_IIS0,
@@ -72,8 +73,13 @@ static struct resource s3c64xx_iis0_resource[] = {
        },
 };
 
-static struct s3c_audio_pdata s3c_i2s0_pdata = {
-       .cfg_gpio = s3c64xx_i2sv3_cfg_gpio,
+static struct s3c_audio_pdata i2sv3_pdata = {
+       .cfg_gpio = s3c64xx_i2s_cfg_gpio,
+       .type = {
+               .i2s = {
+                       .src_clk = rclksrc,
+               },
+       },
 };
 
 struct platform_device s3c64xx_device_iis0 = {
@@ -82,7 +88,7 @@ struct platform_device s3c64xx_device_iis0 = {
        .num_resources    = ARRAY_SIZE(s3c64xx_iis0_resource),
        .resource         = s3c64xx_iis0_resource,
        .dev = {
-               .platform_data = &s3c_i2s0_pdata,
+               .platform_data = &i2sv3_pdata,
        },
 };
 EXPORT_SYMBOL(s3c64xx_device_iis0);
@@ -105,17 +111,13 @@ static struct resource s3c64xx_iis1_resource[] = {
        },
 };
 
-static struct s3c_audio_pdata s3c_i2s1_pdata = {
-       .cfg_gpio = s3c64xx_i2sv3_cfg_gpio,
-};
-
 struct platform_device s3c64xx_device_iis1 = {
        .name             = "samsung-i2s",
        .id               = 1,
        .num_resources    = ARRAY_SIZE(s3c64xx_iis1_resource),
        .resource         = s3c64xx_iis1_resource,
        .dev = {
-               .platform_data = &s3c_i2s1_pdata,
+               .platform_data = &i2sv3_pdata,
        },
 };
 EXPORT_SYMBOL(s3c64xx_device_iis1);
@@ -138,17 +140,23 @@ static struct resource s3c64xx_iisv4_resource[] = {
        },
 };
 
-static struct s3c_audio_pdata s3c_i2sv4_pdata = {
-       .cfg_gpio = s3c64xx_i2sv4_cfg_gpio,
+static struct s3c_audio_pdata i2sv4_pdata = {
+       .cfg_gpio = s3c64xx_i2s_cfg_gpio,
+       .type = {
+               .i2s = {
+                       .quirks = QUIRK_PRI_6CHAN,
+                       .src_clk = rclksrc,
+               },
+       },
 };
 
 struct platform_device s3c64xx_device_iisv4 = {
-       .name             = "samsung-i2s-v4",
-       .id               = -1,
+       .name = "samsung-i2s",
+       .id = 2,
        .num_resources    = ARRAY_SIZE(s3c64xx_iisv4_resource),
        .resource         = s3c64xx_iisv4_resource,
        .dev = {
-               .platform_data = &s3c_i2sv4_pdata,
+               .platform_data = &i2sv4_pdata,
        },
 };
 EXPORT_SYMBOL(s3c64xx_device_iisv4);