Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: tpa6130a2: Support for tpa6140's regulators
@ 2010-01-08 15:48 Ilkka Koskinen
  2010-01-11  7:07 ` Peter Ujfalusi
  0 siblings, 1 reply; 3+ messages in thread
From: Ilkka Koskinen @ 2010-01-08 15:48 UTC (permalink / raw)
  To: alsa-devel; +Cc: broonie, peter.ujfalusi

tpa6140a2 uses different names for the regulators.

Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
---
 include/sound/tpa6130a2-plat.h |    6 ++++++
 sound/soc/codecs/tpa6130a2.c   |   22 ++++++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/include/sound/tpa6130a2-plat.h b/include/sound/tpa6130a2-plat.h
index e8c901e..e29fde6 100644
--- a/include/sound/tpa6130a2-plat.h
+++ b/include/sound/tpa6130a2-plat.h
@@ -23,7 +23,13 @@
 #ifndef TPA6130A2_PLAT_H
 #define TPA6130A2_PLAT_H
 
+enum tpa_model {
+	TPA6130A2,
+	TPA6140A2,
+};
+
 struct tpa6130a2_platform_data {
+	enum tpa_model id;
 	int power_gpio;
 };
 
diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c
index 8e98ccf..8b27281 100644
--- a/sound/soc/codecs/tpa6130a2.c
+++ b/sound/soc/codecs/tpa6130a2.c
@@ -41,6 +41,11 @@ static const char *tpa6130a2_supply_names[TPA6130A2_NUM_SUPPLIES] = {
 	"Vdd",
 };
 
+static const char *tpa6140a2_supply_names[TPA6130A2_NUM_SUPPLIES] = {
+	"HPVdd",
+	"AVdd",
+};
+
 /* This struct is used to save the context */
 struct tpa6130a2_data {
 	struct mutex mutex;
@@ -420,8 +425,21 @@ static int tpa6130a2_probe(struct i2c_client *client,
 		gpio_direction_output(data->power_gpio, 0);
 	}
 
-	for (i = 0; i < ARRAY_SIZE(data->supplies); i++)
-		data->supplies[i].supply = tpa6130a2_supply_names[i];
+	switch (pdata->id) {
+	case TPA6130A2:
+		for (i = 0; i < ARRAY_SIZE(data->supplies); i++)
+			data->supplies[i].supply = tpa6130a2_supply_names[i];
+		break;
+	case TPA6140A2:
+		for (i = 0; i < ARRAY_SIZE(data->supplies); i++)
+			data->supplies[i].supply = tpa6140a2_supply_names[i];;
+		break;
+	default:
+		dev_warn(dev, "Unknown TPA model (%d). Assuming 6130A2\n",
+			 pdata->id);
+		for (i = 0; i < ARRAY_SIZE(data->supplies); i++)
+			data->supplies[i].supply = tpa6130a2_supply_names[i];
+	}
 
 	ret = regulator_bulk_get(dev, ARRAY_SIZE(data->supplies),
 				 data->supplies);
-- 
1.6.0.4

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

* Re: [PATCH] ASoC: tpa6130a2: Support for tpa6140's regulators
  2010-01-08 15:48 [PATCH] ASoC: tpa6130a2: Support for tpa6140's regulators Ilkka Koskinen
@ 2010-01-11  7:07 ` Peter Ujfalusi
  2010-01-11 17:16   ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Ujfalusi @ 2010-01-11  7:07 UTC (permalink / raw)
  To: Koskinen Ilkka (Nokia-D/Tampere)
  Cc: alsa-devel@alsa-project.org, broonie@opensource.wolfsonmicro.com

On Friday 08 January 2010 17:48:31 Koskinen Ilkka (Nokia-D/Tampere) wrote:
> tpa6140a2 uses different names for the regulators.
> 
> Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>

Looks good,

Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>

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

* Re: [PATCH] ASoC: tpa6130a2: Support for tpa6140's regulators
  2010-01-11  7:07 ` Peter Ujfalusi
@ 2010-01-11 17:16   ` Mark Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2010-01-11 17:16 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: alsa-devel@alsa-project.org, Koskinen Ilkka (Nokia-D/Tampere)

On Mon, Jan 11, 2010 at 09:07:57AM +0200, Peter Ujfalusi wrote:
> On Friday 08 January 2010 17:48:31 Koskinen Ilkka (Nokia-D/Tampere) wrote:
> > tpa6140a2 uses different names for the regulators.
> > 
> > Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
> 
> Looks good,
> 
> Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>

Applied, thanks.

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

end of thread, other threads:[~2010-01-11 17:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-08 15:48 [PATCH] ASoC: tpa6130a2: Support for tpa6140's regulators Ilkka Koskinen
2010-01-11  7:07 ` Peter Ujfalusi
2010-01-11 17:16   ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox