All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] mfd/ab8500: Move platform-data for ab8500-codec into mfd-driver
@ 2012-06-07 12:00 Ola Lilja
  2012-06-12  3:48 ` Mark Brown
  2012-06-12 14:21 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Ola Lilja @ 2012-06-07 12:00 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, alsa-devel; +Cc: Ola Lilja, Linus Walleij

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>
---
 arch/arm/mach-ux500/board-mop500.c      |   14 ++++++++
 include/linux/mfd/abx500/ab8500-codec.h |   52 +++++++++++++++++++++++++++++++
 include/linux/mfd/abx500/ab8500.h       |    2 +
 3 files changed, 68 insertions(+), 0 deletions(-)
 create mode 100644 include/linux/mfd/abx500/ab8500-codec.h

diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index c41912c..679a354 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -24,6 +24,7 @@
 #include <linux/mfd/tc3589x.h>
 #include <linux/mfd/tps6105x.h>
 #include <linux/mfd/abx500/ab8500-gpio.h>
+#include <linux/mfd/abx500/ab8500-codec.h>
 #include <linux/leds-lp5521.h>
 #include <linux/input.h>
 #include <linux/smsc911x.h>
@@ -96,6 +97,18 @@ static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
 					0x7A, 0x00, 0x00},
 };
 
+/* ab8500-codec */
+static struct ab8500_codec_platform_data ab8500_codec_pdata = {
+	.amics =  {
+		.mic1_type = AMIC_TYPE_DIFFERENTIAL,
+		.mic2_type = AMIC_TYPE_DIFFERENTIAL,
+		.mic1a_micbias = AMIC_MICBIAS_VAMIC1,
+		.mic1b_micbias = AMIC_MICBIAS_VAMIC1,
+		.mic2_micbias = AMIC_MICBIAS_VAMIC2
+	},
+	.ear_cmv = EAR_CMV_0_95V
+};
+
 static struct gpio_keys_button snowball_key_array[] = {
 	{
 		.gpio           = 32,
@@ -194,6 +207,7 @@ static struct ab8500_platform_data ab8500_platdata = {
 	.regulator	= ab8500_regulators,
 	.num_regulator	= ARRAY_SIZE(ab8500_regulators),
 	.gpio		= &ab8500_gpio_pdata,
+	.codec		= &ab8500_codec_pdata,
 };
 
 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 0000000..dc65292
--- /dev/null
+++ b/include/linux/mfd/abx500/ab8500-codec.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) ST-Ericsson SA 2012
+ *
+ * Author: Ola Lilja <ola.o.lilja@stericsson.com>
+ *         for ST-Ericsson.
+ *
+ * License terms:
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#ifndef AB8500_CORE_CODEC_H
+#define AB8500_CORE_CODEC_H
+
+/* Mic-types */
+enum amic_type {
+	AMIC_TYPE_SINGLE_ENDED,
+	AMIC_TYPE_DIFFERENTIAL
+};
+
+/* Mic-biases */
+enum amic_micbias {
+	AMIC_MICBIAS_VAMIC1,
+	AMIC_MICBIAS_VAMIC2
+};
+
+/* Bias-voltage */
+enum ear_cm_voltage {
+	EAR_CMV_0_95V,
+	EAR_CMV_1_10V,
+	EAR_CMV_1_27V,
+	EAR_CMV_1_58V
+};
+
+/* Analog microphone settings */
+struct amic_settings {
+	enum amic_type mic1_type;
+	enum amic_type mic2_type;
+	enum amic_micbias mic1a_micbias;
+	enum amic_micbias mic1b_micbias;
+	enum amic_micbias mic2_micbias;
+};
+
+/* Platform data structure for the audio-parts of the AB8500 */
+struct ab8500_codec_platform_data {
+	struct amic_settings amics;
+	enum ear_cm_voltage ear_cmv;
+};
+
+#endif
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h
index 91dd3ef..bc9b84b 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -266,6 +266,7 @@ struct ab8500 {
 struct regulator_reg_init;
 struct regulator_init_data;
 struct ab8500_gpio_platform_data;
+struct ab8500_codec_platform_data;
 
 /**
  * struct ab8500_platform_data - AB8500 platform data
@@ -284,6 +285,7 @@ struct ab8500_platform_data {
 	int num_regulator;
 	struct regulator_init_data *regulator;
 	struct ab8500_gpio_platform_data *gpio;
+	struct ab8500_codec_platform_data *codec;
 };
 
 extern int __devinit ab8500_init(struct ab8500 *ab8500,
-- 
1.7.8.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/3] mfd/ab8500: Move platform-data for ab8500-codec into mfd-driver
  2012-06-07 12:00 [PATCH 3/3] mfd/ab8500: Move platform-data for ab8500-codec into mfd-driver Ola Lilja
@ 2012-06-12  3:48 ` Mark Brown
  2012-06-12 14:21 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2012-06-12  3:48 UTC (permalink / raw)
  To: Ola Lilja; +Cc: alsa-devel, Liam Girdwood, Linus Walleij


[-- Attachment #1.1: Type: text/plain, Size: 416 bytes --]

On Thu, Jun 07, 2012 at 02:00:46PM +0200, Ola Lilja wrote:
> 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.

Applied, thanks - it's needed to fix the build so I'm just applying
before acks.

This should really have been sent to Samuel as well...

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/3] mfd/ab8500: Move platform-data for ab8500-codec into mfd-driver
  2012-06-07 12:00 [PATCH 3/3] mfd/ab8500: Move platform-data for ab8500-codec into mfd-driver Ola Lilja
  2012-06-12  3:48 ` Mark Brown
@ 2012-06-12 14:21 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2012-06-12 14:21 UTC (permalink / raw)
  To: Ola Lilja; +Cc: alsa-devel, Mark Brown, Liam Girdwood

On Thu, Jun 7, 2012 at 2:00 PM, Ola Lilja <ola.o.lilja@stericsson.com> wrote:

> 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>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Thanks,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-12 14:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-07 12:00 [PATCH 3/3] mfd/ab8500: Move platform-data for ab8500-codec into mfd-driver Ola Lilja
2012-06-12  3:48 ` Mark Brown
2012-06-12 14:21 ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.