Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dev-audio.c
Go to the documentation of this file.
1 /* linux/arch/arm/mach-s5p64x0/dev-audio.c
2  *
3  * Copyright (c) 2010 Samsung Electronics Co. Ltd
4  * Jaswinder Singh <[email protected]>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9 */
10 
11 #include <linux/platform_device.h>
12 #include <linux/dma-mapping.h>
13 #include <linux/gpio.h>
14 
15 #include <plat/gpio-cfg.h>
17 
18 #include <mach/map.h>
19 #include <mach/dma.h>
20 #include <mach/irqs.h>
21 
22 static const char *rclksrc[] = {
23  [0] = "iis",
24  [1] = "sclk_audio2",
25 };
26 
27 static int s5p6440_cfg_i2s(struct platform_device *pdev)
28 {
29  switch (pdev->id) {
30  case 0:
34  break;
35  default:
36  printk(KERN_ERR "Invalid Device %d\n", pdev->id);
37  return -EINVAL;
38  }
39 
40  return 0;
41 }
42 
43 static struct s3c_audio_pdata s5p6440_i2s_pdata = {
44  .cfg_gpio = s5p6440_cfg_i2s,
45  .type = {
46  .i2s = {
47  .quirks = QUIRK_PRI_6CHAN,
48  .src_clk = rclksrc,
49  },
50  },
51 };
52 
53 static struct resource s5p64x0_i2s0_resource[] = {
57 };
58 
60  .name = "samsung-i2s",
61  .id = 0,
62  .num_resources = ARRAY_SIZE(s5p64x0_i2s0_resource),
63  .resource = s5p64x0_i2s0_resource,
64  .dev = {
65  .platform_data = &s5p6440_i2s_pdata,
66  },
67 };
68 
69 static int s5p6450_cfg_i2s(struct platform_device *pdev)
70 {
71  switch (pdev->id) {
72  case 0:
75  break;
76  case 1:
79  break;
80  case 2:
82  break;
83  default:
84  printk(KERN_ERR "Invalid Device %d\n", pdev->id);
85  return -EINVAL;
86  }
87 
88  return 0;
89 }
90 
91 static struct s3c_audio_pdata s5p6450_i2s0_pdata = {
92  .cfg_gpio = s5p6450_cfg_i2s,
93  .type = {
94  .i2s = {
95  .quirks = QUIRK_PRI_6CHAN,
96  .src_clk = rclksrc,
97  },
98  },
99 };
100 
102  .name = "samsung-i2s",
103  .id = 0,
104  .num_resources = ARRAY_SIZE(s5p64x0_i2s0_resource),
105  .resource = s5p64x0_i2s0_resource,
106  .dev = {
107  .platform_data = &s5p6450_i2s0_pdata,
108  },
109 };
110 
111 static struct s3c_audio_pdata s5p6450_i2s_pdata = {
112  .cfg_gpio = s5p6450_cfg_i2s,
113  .type = {
114  .i2s = {
115  .src_clk = rclksrc,
116  },
117  },
118 };
119 
120 static struct resource s5p6450_i2s1_resource[] = {
124 };
125 
127  .name = "samsung-i2s",
128  .id = 1,
129  .num_resources = ARRAY_SIZE(s5p6450_i2s1_resource),
130  .resource = s5p6450_i2s1_resource,
131  .dev = {
132  .platform_data = &s5p6450_i2s_pdata,
133  },
134 };
135 
136 static struct resource s5p6450_i2s2_resource[] = {
140 };
141 
143  .name = "samsung-i2s",
144  .id = 2,
145  .num_resources = ARRAY_SIZE(s5p6450_i2s2_resource),
146  .resource = s5p6450_i2s2_resource,
147  .dev = {
148  .platform_data = &s5p6450_i2s_pdata,
149  },
150 };
151 
152 /* PCM Controller platform_devices */
153 
154 static int s5p6440_pcm_cfg_gpio(struct platform_device *pdev)
155 {
156  switch (pdev->id) {
157  case 0:
160  break;
161 
162  default:
163  printk(KERN_DEBUG "Invalid PCM Controller number!");
164  return -EINVAL;
165  }
166 
167  return 0;
168 }
169 
170 static struct s3c_audio_pdata s5p6440_pcm_pdata = {
171  .cfg_gpio = s5p6440_pcm_cfg_gpio,
172 };
173 
174 static struct resource s5p6440_pcm0_resource[] = {
178 };
179 
181  .name = "samsung-pcm",
182  .id = 0,
183  .num_resources = ARRAY_SIZE(s5p6440_pcm0_resource),
184  .resource = s5p6440_pcm0_resource,
185  .dev = {
186  .platform_data = &s5p6440_pcm_pdata,
187  },
188 };