]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - arch/arm/mach-s3c64xx/dev-audio.c
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / arch / arm / mach-s3c64xx / dev-audio.c
index 76426a32c013947aabffafc97d22b68efe63e54b..cad67022fa2577330663ec035a1a96ea36c7e1de 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,17 +73,22 @@ 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 = {
-       .name             = "s3c64xx-iis",
+       .name             = "samsung-i2s",
        .id               = 0,
        .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             = "s3c64xx-iis",
+       .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             = "s3c64xx-iis-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);
@@ -288,7 +296,7 @@ static struct s3c_audio_pdata s3c_ac97_pdata;
 static u64 s3c64xx_ac97_dmamask = DMA_BIT_MASK(32);
 
 struct platform_device s3c64xx_device_ac97 = {
-       .name             = "s3c-ac97",
+       .name             = "samsung-ac97",
        .id               = -1,
        .num_resources    = ARRAY_SIZE(s3c64xx_ac97_resource),
        .resource         = s3c64xx_ac97_resource,
@@ -307,16 +315,3 @@ void __init s3c64xx_ac97_setup_gpio(int num)
        else
                s3c_ac97_pdata.cfg_gpio = s3c64xx_ac97_cfg_gpe;
 }
-
-static u64 s3c_device_audio_dmamask = 0xffffffffUL;
-
-struct platform_device s3c_device_pcm = {
-       .name             = "s3c24xx-pcm-audio",
-       .id               = -1,
-       .dev              = {
-               .dma_mask = &s3c_device_audio_dmamask,
-               .coherent_dma_mask = 0xffffffffUL
-       }
-};
-EXPORT_SYMBOL(s3c_device_pcm);
-