diff options
author | Ola Lilja <ola.o.lilja@stericsson.com> | 2012-06-07 08:00:46 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-06-11 23:44:21 -0400 |
commit | f242e50eee1ec7692c4854d94e8cd543991cce71 (patch) | |
tree | 9c14bb93659d7de068f72868fd4714472d103a8e | |
parent | cfaf025112d3856637ff34a767ef785ef5cf2ca9 (diff) |
mfd/ab8500: Move platform-data for ab8500-codec into mfd-driver
The platform-data used by the Ux500 ASoC-driver is moved from the
machine-driver context into the codec-driver context. This means
adding the platform-data for 'ab8500-codec' into the main AB8500
platform-data.
Signed-off-by: Ola Lilja <ola.o.lilja@stericsson.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 14 | ||||
-rw-r--r-- | include/linux/mfd/abx500/ab8500-codec.h | 52 | ||||
-rw-r--r-- | include/linux/mfd/abx500/ab8500.h | 2 |
3 files changed, 68 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 9c74ac545849..c8a8fde777bb 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/mfd/tc3589x.h> | 25 | #include <linux/mfd/tc3589x.h> |
26 | #include <linux/mfd/tps6105x.h> | 26 | #include <linux/mfd/tps6105x.h> |
27 | #include <linux/mfd/abx500/ab8500-gpio.h> | 27 | #include <linux/mfd/abx500/ab8500-gpio.h> |
28 | #include <linux/mfd/abx500/ab8500-codec.h> | ||
28 | #include <linux/leds-lp5521.h> | 29 | #include <linux/leds-lp5521.h> |
29 | #include <linux/input.h> | 30 | #include <linux/input.h> |
30 | #include <linux/smsc911x.h> | 31 | #include <linux/smsc911x.h> |
@@ -97,6 +98,18 @@ static struct ab8500_gpio_platform_data ab8500_gpio_pdata = { | |||
97 | 0x7A, 0x00, 0x00}, | 98 | 0x7A, 0x00, 0x00}, |
98 | }; | 99 | }; |
99 | 100 | ||
101 | /* ab8500-codec */ | ||
102 | static struct ab8500_codec_platform_data ab8500_codec_pdata = { | ||
103 | .amics = { | ||
104 | .mic1_type = AMIC_TYPE_DIFFERENTIAL, | ||
105 | .mic2_type = AMIC_TYPE_DIFFERENTIAL, | ||
106 | .mic1a_micbias = AMIC_MICBIAS_VAMIC1, | ||
107 | .mic1b_micbias = AMIC_MICBIAS_VAMIC1, | ||
108 | .mic2_micbias = AMIC_MICBIAS_VAMIC2 | ||
109 | }, | ||
110 | .ear_cmv = EAR_CMV_0_95V | ||
111 | }; | ||
112 | |||
100 | static struct gpio_keys_button snowball_key_array[] = { | 113 | static struct gpio_keys_button snowball_key_array[] = { |
101 | { | 114 | { |
102 | .gpio = 32, | 115 | .gpio = 32, |
@@ -195,6 +208,7 @@ static struct ab8500_platform_data ab8500_platdata = { | |||
195 | .regulator = ab8500_regulators, | 208 | .regulator = ab8500_regulators, |
196 | .num_regulator = ARRAY_SIZE(ab8500_regulators), | 209 | .num_regulator = ARRAY_SIZE(ab8500_regulators), |
197 | .gpio = &ab8500_gpio_pdata, | 210 | .gpio = &ab8500_gpio_pdata, |
211 | .codec = &ab8500_codec_pdata, | ||
198 | }; | 212 | }; |
199 | 213 | ||
200 | static struct resource ab8500_resources[] = { | 214 | static struct resource ab8500_resources[] = { |
diff --git a/include/linux/mfd/abx500/ab8500-codec.h b/include/linux/mfd/abx500/ab8500-codec.h new file mode 100644 index 000000000000..dc6529202cdd --- /dev/null +++ b/include/linux/mfd/abx500/ab8500-codec.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson SA 2012 | ||
3 | * | ||
4 | * Author: Ola Lilja <ola.o.lilja@stericsson.com> | ||
5 | * for ST-Ericsson. | ||
6 | * | ||
7 | * License terms: | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License version 2 as published | ||
11 | * by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #ifndef AB8500_CORE_CODEC_H | ||
15 | #define AB8500_CORE_CODEC_H | ||
16 | |||
17 | /* Mic-types */ | ||
18 | enum amic_type { | ||
19 | AMIC_TYPE_SINGLE_ENDED, | ||
20 | AMIC_TYPE_DIFFERENTIAL | ||
21 | }; | ||
22 | |||
23 | /* Mic-biases */ | ||
24 | enum amic_micbias { | ||
25 | AMIC_MICBIAS_VAMIC1, | ||
26 | AMIC_MICBIAS_VAMIC2 | ||
27 | }; | ||
28 | |||
29 | /* Bias-voltage */ | ||
30 | enum ear_cm_voltage { | ||
31 | EAR_CMV_0_95V, | ||
32 | EAR_CMV_1_10V, | ||
33 | EAR_CMV_1_27V, | ||
34 | EAR_CMV_1_58V | ||
35 | }; | ||
36 | |||
37 | /* Analog microphone settings */ | ||
38 | struct amic_settings { | ||
39 | enum amic_type mic1_type; | ||
40 | enum amic_type mic2_type; | ||
41 | enum amic_micbias mic1a_micbias; | ||
42 | enum amic_micbias mic1b_micbias; | ||
43 | enum amic_micbias mic2_micbias; | ||
44 | }; | ||
45 | |||
46 | /* Platform data structure for the audio-parts of the AB8500 */ | ||
47 | struct ab8500_codec_platform_data { | ||
48 | struct amic_settings amics; | ||
49 | enum ear_cm_voltage ear_cmv; | ||
50 | }; | ||
51 | |||
52 | #endif | ||
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h index 91dd3ef63e99..bc9b84b60ec6 100644 --- a/include/linux/mfd/abx500/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h | |||
@@ -266,6 +266,7 @@ struct ab8500 { | |||
266 | struct regulator_reg_init; | 266 | struct regulator_reg_init; |
267 | struct regulator_init_data; | 267 | struct regulator_init_data; |
268 | struct ab8500_gpio_platform_data; | 268 | struct ab8500_gpio_platform_data; |
269 | struct ab8500_codec_platform_data; | ||
269 | 270 | ||
270 | /** | 271 | /** |
271 | * struct ab8500_platform_data - AB8500 platform data | 272 | * struct ab8500_platform_data - AB8500 platform data |
@@ -284,6 +285,7 @@ struct ab8500_platform_data { | |||
284 | int num_regulator; | 285 | int num_regulator; |
285 | struct regulator_init_data *regulator; | 286 | struct regulator_init_data *regulator; |
286 | struct ab8500_gpio_platform_data *gpio; | 287 | struct ab8500_gpio_platform_data *gpio; |
288 | struct ab8500_codec_platform_data *codec; | ||
287 | }; | 289 | }; |
288 | 290 | ||
289 | extern int __devinit ab8500_init(struct ab8500 *ab8500, | 291 | extern int __devinit ab8500_init(struct ab8500 *ab8500, |