diff options
| -rw-r--r-- | arch/arm/plat-s3c/include/plat/devs.h | 3 | ||||
| -rw-r--r-- | arch/arm/plat-s3c64xx/dev-audio.c | 101 |
2 files changed, 103 insertions, 1 deletions
diff --git a/arch/arm/plat-s3c/include/plat/devs.h b/arch/arm/plat-s3c/include/plat/devs.h index 0f540ea1e999..932cbbbb4273 100644 --- a/arch/arm/plat-s3c/include/plat/devs.h +++ b/arch/arm/plat-s3c/include/plat/devs.h | |||
| @@ -28,6 +28,9 @@ extern struct platform_device s3c64xx_device_iis0; | |||
| 28 | extern struct platform_device s3c64xx_device_iis1; | 28 | extern struct platform_device s3c64xx_device_iis1; |
| 29 | extern struct platform_device s3c64xx_device_iisv4; | 29 | extern struct platform_device s3c64xx_device_iisv4; |
| 30 | 30 | ||
| 31 | extern struct platform_device s3c64xx_device_pcm0; | ||
| 32 | extern struct platform_device s3c64xx_device_pcm1; | ||
| 33 | |||
| 31 | extern struct platform_device s3c_device_fb; | 34 | extern struct platform_device s3c_device_fb; |
| 32 | extern struct platform_device s3c_device_usb; | 35 | extern struct platform_device s3c_device_usb; |
| 33 | extern struct platform_device s3c_device_lcd; | 36 | extern struct platform_device s3c_device_lcd; |
diff --git a/arch/arm/plat-s3c64xx/dev-audio.c b/arch/arm/plat-s3c64xx/dev-audio.c index 1322beb40dd7..9e07344913d9 100644 --- a/arch/arm/plat-s3c64xx/dev-audio.c +++ b/arch/arm/plat-s3c64xx/dev-audio.c | |||
| @@ -15,9 +15,14 @@ | |||
| 15 | 15 | ||
| 16 | #include <mach/irqs.h> | 16 | #include <mach/irqs.h> |
| 17 | #include <mach/map.h> | 17 | #include <mach/map.h> |
| 18 | #include <mach/dma.h> | ||
| 19 | #include <mach/gpio.h> | ||
| 18 | 20 | ||
| 19 | #include <plat/devs.h> | 21 | #include <plat/devs.h> |
| 20 | 22 | #include <plat/audio.h> | |
| 23 | #include <plat/gpio-bank-d.h> | ||
| 24 | #include <plat/gpio-bank-e.h> | ||
| 25 | #include <plat/gpio-cfg.h> | ||
| 21 | 26 | ||
| 22 | static struct resource s3c64xx_iis0_resource[] = { | 27 | static struct resource s3c64xx_iis0_resource[] = { |
| 23 | [0] = { | 28 | [0] = { |
| @@ -66,3 +71,97 @@ struct platform_device s3c64xx_device_iisv4 = { | |||
| 66 | .resource = s3c64xx_iisv4_resource, | 71 | .resource = s3c64xx_iisv4_resource, |
| 67 | }; | 72 | }; |
| 68 | EXPORT_SYMBOL(s3c64xx_device_iisv4); | 73 | EXPORT_SYMBOL(s3c64xx_device_iisv4); |
| 74 | |||
| 75 | |||
| 76 | /* PCM Controller platform_devices */ | ||
| 77 | |||
| 78 | static int s3c64xx_pcm_cfg_gpio(struct platform_device *pdev) | ||
| 79 | { | ||
| 80 | switch (pdev->id) { | ||
| 81 | case 0: | ||
| 82 | s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C64XX_GPD0_PCM0_SCLK); | ||
| 83 | s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C64XX_GPD1_PCM0_EXTCLK); | ||
| 84 | s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C64XX_GPD2_PCM0_FSYNC); | ||
| 85 | s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C64XX_GPD3_PCM0_SIN); | ||
| 86 | s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C64XX_GPD4_PCM0_SOUT); | ||
| 87 | break; | ||
| 88 | case 1: | ||
| 89 | s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C64XX_GPE0_PCM1_SCLK); | ||
| 90 | s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C64XX_GPE1_PCM1_EXTCLK); | ||
| 91 | s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C64XX_GPE2_PCM1_FSYNC); | ||
| 92 | s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C64XX_GPE3_PCM1_SIN); | ||
| 93 | s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C64XX_GPE4_PCM1_SOUT); | ||
| 94 | break; | ||
| 95 | default: | ||
| 96 | printk(KERN_DEBUG "Invalid PCM Controller number!"); | ||
| 97 | return -EINVAL; | ||
| 98 | } | ||
| 99 | |||
| 100 | return 0; | ||
| 101 | } | ||
| 102 | |||
| 103 | static struct resource s3c64xx_pcm0_resource[] = { | ||
| 104 | [0] = { | ||
| 105 | .start = S3C64XX_PA_PCM0, | ||
| 106 | .end = S3C64XX_PA_PCM0 + 0x100 - 1, | ||
| 107 | .flags = IORESOURCE_MEM, | ||
| 108 | }, | ||
| 109 | [1] = { | ||
| 110 | .start = DMACH_PCM0_TX, | ||
| 111 | .end = DMACH_PCM0_TX, | ||
| 112 | .flags = IORESOURCE_DMA, | ||
| 113 | }, | ||
| 114 | [2] = { | ||
| 115 | .start = DMACH_PCM0_RX, | ||
| 116 | .end = DMACH_PCM0_RX, | ||
| 117 | .flags = IORESOURCE_DMA, | ||
| 118 | }, | ||
| 119 | }; | ||
| 120 | |||
| 121 | struct s3c_audio_pdata s3c_pcm0_pdata = { | ||
| 122 | .cfg_gpio = s3c64xx_pcm_cfg_gpio, | ||
| 123 | }; | ||
| 124 | |||
| 125 | struct platform_device s3c64xx_device_pcm0 = { | ||
| 126 | .name = "samsung-pcm", | ||
| 127 | .id = 0, | ||
| 128 | .num_resources = ARRAY_SIZE(s3c64xx_pcm0_resource), | ||
| 129 | .resource = s3c64xx_pcm0_resource, | ||
| 130 | .dev = { | ||
| 131 | .platform_data = &s3c_pcm0_pdata, | ||
| 132 | }, | ||
| 133 | }; | ||
| 134 | EXPORT_SYMBOL(s3c64xx_device_pcm0); | ||
| 135 | |||
| 136 | static struct resource s3c64xx_pcm1_resource[] = { | ||
| 137 | [0] = { | ||
| 138 | .start = S3C64XX_PA_PCM1, | ||
| 139 | .end = S3C64XX_PA_PCM1 + 0x100 - 1, | ||
| 140 | .flags = IORESOURCE_MEM, | ||
| 141 | }, | ||
| 142 | [1] = { | ||
| 143 | .start = DMACH_PCM1_TX, | ||
| 144 | .end = DMACH_PCM1_TX, | ||
| 145 | .flags = IORESOURCE_DMA, | ||
| 146 | }, | ||
| 147 | [2] = { | ||
| 148 | .start = DMACH_PCM1_RX, | ||
| 149 | .end = DMACH_PCM1_RX, | ||
| 150 | .flags = IORESOURCE_DMA, | ||
| 151 | }, | ||
| 152 | }; | ||
| 153 | |||
| 154 | struct s3c_audio_pdata s3c_pcm1_pdata = { | ||
| 155 | .cfg_gpio = s3c64xx_pcm_cfg_gpio, | ||
| 156 | }; | ||
| 157 | |||
| 158 | struct platform_device s3c64xx_device_pcm1 = { | ||
| 159 | .name = "samsung-pcm", | ||
| 160 | .id = 1, | ||
| 161 | .num_resources = ARRAY_SIZE(s3c64xx_pcm1_resource), | ||
| 162 | .resource = s3c64xx_pcm1_resource, | ||
| 163 | .dev = { | ||
| 164 | .platform_data = &s3c_pcm1_pdata, | ||
| 165 | }, | ||
| 166 | }; | ||
| 167 | EXPORT_SYMBOL(s3c64xx_device_pcm1); | ||
