aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlkka Koskinen <ilkka.koskinen@nokia.com>2010-01-08 10:48:31 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-01-11 12:13:11 -0500
commit2138301e1687bd4f22aa2b4df4829b6ffdae19bc (patch)
tree8b2354424ac4cfc06fce275ec8ccb6c5946b1593
parent53242c68333570631a15a69842851b458eca3d99 (diff)
ASoC: tpa6130a2: Support for tpa6140's regulators
tpa6140a2 uses different names for the regulators. Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--include/sound/tpa6130a2-plat.h6
-rw-r--r--sound/soc/codecs/tpa6130a2.c22
2 files changed, 26 insertions, 2 deletions
diff --git a/include/sound/tpa6130a2-plat.h b/include/sound/tpa6130a2-plat.h
index e8c901e749d8..e29fde6b5cbe 100644
--- a/include/sound/tpa6130a2-plat.h
+++ b/include/sound/tpa6130a2-plat.h
@@ -23,7 +23,13 @@
23#ifndef TPA6130A2_PLAT_H 23#ifndef TPA6130A2_PLAT_H
24#define TPA6130A2_PLAT_H 24#define TPA6130A2_PLAT_H
25 25
26enum tpa_model {
27 TPA6130A2,
28 TPA6140A2,
29};
30
26struct tpa6130a2_platform_data { 31struct tpa6130a2_platform_data {
32 enum tpa_model id;
27 int power_gpio; 33 int power_gpio;
28}; 34};
29 35
diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c
index 8e98ccfab75c..8b27281e62a1 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] = {
41 "Vdd", 41 "Vdd",
42}; 42};
43 43
44static const char *tpa6140a2_supply_names[TPA6130A2_NUM_SUPPLIES] = {
45 "HPVdd",
46 "AVdd",
47};
48
44/* This struct is used to save the context */ 49/* This struct is used to save the context */
45struct tpa6130a2_data { 50struct tpa6130a2_data {
46 struct mutex mutex; 51 struct mutex mutex;
@@ -420,8 +425,21 @@ static int tpa6130a2_probe(struct i2c_client *client,
420 gpio_direction_output(data->power_gpio, 0); 425 gpio_direction_output(data->power_gpio, 0);
421 } 426 }
422 427
423 for (i = 0; i < ARRAY_SIZE(data->supplies); i++) 428 switch (pdata->id) {
424 data->supplies[i].supply = tpa6130a2_supply_names[i]; 429 case TPA6130A2:
430 for (i = 0; i < ARRAY_SIZE(data->supplies); i++)
431 data->supplies[i].supply = tpa6130a2_supply_names[i];
432 break;
433 case TPA6140A2:
434 for (i = 0; i < ARRAY_SIZE(data->supplies); i++)
435 data->supplies[i].supply = tpa6140a2_supply_names[i];;
436 break;
437 default:
438 dev_warn(dev, "Unknown TPA model (%d). Assuming 6130A2\n",
439 pdata->id);
440 for (i = 0; i < ARRAY_SIZE(data->supplies); i++)
441 data->supplies[i].supply = tpa6130a2_supply_names[i];
442 }
425 443
426 ret = regulator_bulk_get(dev, ARRAY_SIZE(data->supplies), 444 ret = regulator_bulk_get(dev, ARRAY_SIZE(data->supplies),
427 data->supplies); 445 data->supplies);