ASoC: tpa6130a2: Support for tpa6140's regulators
Subsystems (3)
PATCH 1/1 ASoC: tpa6130a2: Support for tpa6140's regulators
tpa6140a2 uses different names for the regulators.
Signed-off-by Ilkka Koskinen <[email protected]>
--- include/sound/tpa6130a2-plat.h | 6 ++++++ sound/soc/codecs/tpa6130a2.c | 22 ++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-)
include/sound/tpa6130a2-plat.h +6 -0
@@ -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; };
sound/soc/codecs/tpa6130a2.c +20 -2
@@ -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);
Signature · 1 line
1.6.0.4
Quoted 3 lines · 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 <[email protected]>
Looks good,
Acked-by Peter Ujfalusi <[email protected]>
Mark Brown
AppliedQuoted 8 lines · Peter Ujfalusi
Quoted 3 lines · 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 <[email protected]>Looks good,
Acked-by Peter Ujfalusi <[email protected]>
Applied, thanks.