aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c64xx/mach-crag6410-module.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-s3c64xx/mach-crag6410-module.c')
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410-module.c45
1 files changed, 42 insertions, 3 deletions
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410-module.c b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
index 32a30f38ba0..0ace108c3e3 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410-module.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
@@ -11,18 +11,38 @@
11#include <linux/export.h> 11#include <linux/export.h>
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13#include <linux/i2c.h> 13#include <linux/i2c.h>
14#include <linux/spi/spi.h>
14 15
15#include <linux/mfd/wm831x/irq.h> 16#include <linux/mfd/wm831x/irq.h>
16#include <linux/mfd/wm831x/gpio.h> 17#include <linux/mfd/wm831x/gpio.h>
17#include <linux/mfd/wm8994/pdata.h> 18#include <linux/mfd/wm8994/pdata.h>
18 19
20#include <linux/regulator/machine.h>
21
19#include <sound/wm5100.h> 22#include <sound/wm5100.h>
20#include <sound/wm8996.h> 23#include <sound/wm8996.h>
21#include <sound/wm8962.h> 24#include <sound/wm8962.h>
22#include <sound/wm9081.h> 25#include <sound/wm9081.h>
23 26
27#include <plat/s3c64xx-spi.h>
28
24#include <mach/crag6410.h> 29#include <mach/crag6410.h>
25 30
31static struct s3c64xx_spi_csinfo wm0010_spi_csinfo = {
32 .set_level = gpio_set_value,
33 .line = S3C64XX_GPC(3),
34};
35
36static struct spi_board_info wm1253_devs[] = {
37 [0] = {
38 .modalias = "wm0010",
39 .bus_num = 0,
40 .chip_select = 0,
41 .mode = SPI_MODE_0,
42 .controller_data = &wm0010_spi_csinfo,
43 },
44};
45
26static struct wm5100_pdata wm5100_pdata = { 46static struct wm5100_pdata wm5100_pdata = {
27 .ldo_ena = S3C64XX_GPN(7), 47 .ldo_ena = S3C64XX_GPN(7),
28 .irq_flags = IRQF_TRIGGER_HIGH, 48 .irq_flags = IRQF_TRIGGER_HIGH,
@@ -135,6 +155,14 @@ static const struct i2c_board_info wm1259_devs[] = {
135 }, 155 },
136}; 156};
137 157
158static struct regulator_init_data wm8994_ldo1 = {
159 .supply_regulator = "WALLVDD",
160};
161
162static struct regulator_init_data wm8994_ldo2 = {
163 .supply_regulator = "WALLVDD",
164};
165
138static struct wm8994_pdata wm8994_pdata = { 166static struct wm8994_pdata wm8994_pdata = {
139 .gpio_base = CODEC_GPIO_BASE, 167 .gpio_base = CODEC_GPIO_BASE,
140 .gpio_defaults = { 168 .gpio_defaults = {
@@ -142,8 +170,8 @@ static struct wm8994_pdata wm8994_pdata = {
142 }, 170 },
143 .irq_base = CODEC_IRQ_BASE, 171 .irq_base = CODEC_IRQ_BASE,
144 .ldo = { 172 .ldo = {
145 { .supply = "WALLVDD" }, 173 { .init_data = &wm8994_ldo1, },
146 { .supply = "WALLVDD" }, 174 { .init_data = &wm8994_ldo2, },
147 }, 175 },
148}; 176};
149 177
@@ -159,14 +187,21 @@ static __devinitdata const struct {
159 const char *name; 187 const char *name;
160 const struct i2c_board_info *i2c_devs; 188 const struct i2c_board_info *i2c_devs;
161 int num_i2c_devs; 189 int num_i2c_devs;
190 const struct spi_board_info *spi_devs;
191 int num_spi_devs;
162} gf_mods[] = { 192} gf_mods[] = {
163 { .id = 0x01, .name = "1250-EV1 Springbank" }, 193 { .id = 0x01, .name = "1250-EV1 Springbank" },
164 { .id = 0x02, .name = "1251-EV1 Jura" }, 194 { .id = 0x02, .name = "1251-EV1 Jura" },
165 { .id = 0x03, .name = "1252-EV1 Glenlivet" }, 195 { .id = 0x03, .name = "1252-EV1 Glenlivet" },
166 { .id = 0x11, .name = "6249-EV2 Glenfarclas", }, 196 { .id = 0x11, .name = "6249-EV2 Glenfarclas", },
197 { .id = 0x14, .name = "6271-EV1 Lochnagar" },
198 { .id = 0x15, .name = "XXXX-EV1 Bells" },
167 { .id = 0x21, .name = "1275-EV1 Mortlach" }, 199 { .id = 0x21, .name = "1275-EV1 Mortlach" },
168 { .id = 0x25, .name = "1274-EV1 Glencadam" }, 200 { .id = 0x25, .name = "1274-EV1 Glencadam" },
169 { .id = 0x31, .name = "1253-EV1 Tomatin", }, 201 { .id = 0x31, .name = "1253-EV1 Tomatin",
202 .spi_devs = wm1253_devs, .num_spi_devs = ARRAY_SIZE(wm1253_devs) },
203 { .id = 0x32, .name = "XXXX-EV1 Caol Illa" },
204 { .id = 0x33, .name = "XXXX-EV1 Oban" },
170 { .id = 0x39, .name = "1254-EV1 Dallas Dhu", 205 { .id = 0x39, .name = "1254-EV1 Dallas Dhu",
171 .i2c_devs = wm1254_devs, .num_i2c_devs = ARRAY_SIZE(wm1254_devs) }, 206 .i2c_devs = wm1254_devs, .num_i2c_devs = ARRAY_SIZE(wm1254_devs) },
172 { .id = 0x3a, .name = "1259-EV1 Tobermory", 207 { .id = 0x3a, .name = "1259-EV1 Tobermory",
@@ -198,12 +233,16 @@ static __devinit int wlf_gf_module_probe(struct i2c_client *i2c,
198 if (i < ARRAY_SIZE(gf_mods)) { 233 if (i < ARRAY_SIZE(gf_mods)) {
199 dev_info(&i2c->dev, "%s revision %d\n", 234 dev_info(&i2c->dev, "%s revision %d\n",
200 gf_mods[i].name, rev + 1); 235 gf_mods[i].name, rev + 1);
236
201 for (j = 0; j < gf_mods[i].num_i2c_devs; j++) { 237 for (j = 0; j < gf_mods[i].num_i2c_devs; j++) {
202 if (!i2c_new_device(i2c->adapter, 238 if (!i2c_new_device(i2c->adapter,
203 &(gf_mods[i].i2c_devs[j]))) 239 &(gf_mods[i].i2c_devs[j])))
204 dev_err(&i2c->dev, 240 dev_err(&i2c->dev,
205 "Failed to register dev: %d\n", ret); 241 "Failed to register dev: %d\n", ret);
206 } 242 }
243
244 spi_register_board_info(gf_mods[i].spi_devs,
245 gf_mods[i].num_spi_devs);
207 } else { 246 } else {
208 dev_warn(&i2c->dev, "Unknown module ID 0x%x revision %d\n", 247 dev_warn(&i2c->dev, "Unknown module ID 0x%x revision %d\n",
209 id, rev + 1); 248 id, rev + 1);