[alsa-devel] [PATCH 0/3] ASoC: tpa6130a2: model handling cleanup
Hello,
Small cleanup for the tpa6130a2 driver for model handling: Remove the model_id from platform_data, and use the device name/device_data to distinguish between the supported models of TPA.
Regards, Peter --- Peter Ujfalusi (3): ASoC: tpa6130a2: Model support cleanup OMAP: RX51: No need to configure the tpa_model ASoC: tpa6130a2: Remove model_id from platform data
arch/arm/mach-omap2/board-rx51-peripherals.c | 1 - include/sound/tpa6130a2-plat.h | 6 ------ sound/soc/codecs/tpa6130a2.c | 12 +++++++++--- 3 files changed, 9 insertions(+), 10 deletions(-)
Use the device name and driver_data to identify the TPA model supported by the driver. Board files should use either "tpa6130a2" or "tpa6140a2" as device name to specify the model in used on the specific board.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- sound/soc/codecs/tpa6130a2.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c index 239e0c4..0c0fcb3 100644 --- a/sound/soc/codecs/tpa6130a2.c +++ b/sound/soc/codecs/tpa6130a2.c @@ -383,7 +383,7 @@ static int __devinit tpa6130a2_probe(struct i2c_client *client,
pdata = client->dev.platform_data; data->power_gpio = pdata->power_gpio; - data->id = pdata->id; + data->id = id->driver_data;
mutex_init(&data->mutex);
@@ -405,7 +405,7 @@ static int __devinit tpa6130a2_probe(struct i2c_client *client, switch (data->id) { default: dev_warn(dev, "Unknown TPA model (%d). Assuming 6130A2\n", - pdata->id); + data->id); case TPA6130A2: regulator = "Vdd"; break; @@ -470,7 +470,8 @@ static int __devexit tpa6130a2_remove(struct i2c_client *client) }
static const struct i2c_device_id tpa6130a2_id[] = { - { "tpa6130a2", 0 }, + { "tpa6130a2", TPA6130A2 }, + { "tpa6140a2", TPA6140A2 }, { } }; MODULE_DEVICE_TABLE(i2c, tpa6130a2_id);
The TPA driver now uses the name for model support. n900 has tpa61030a2 model of TPA.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- arch/arm/mach-omap2/board-rx51-peripherals.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index 5a886cd..ba1aa07 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c @@ -900,7 +900,6 @@ static struct twl4030_platform_data rx51_twldata __initdata = { };
static struct tpa6130a2_platform_data rx51_tpa6130a2_data __initdata_or_module = { - .id = TPA6130A2, .power_gpio = 98, };
The model_id is no longer needed within the platform_data for the TPA driver since the model of TPA specified with the device name (tpa6130a2/tpa6140a2).
Signed-off-by: Peter Ujfalusi peter.ujfalusi@ti.com --- include/sound/tpa6130a2-plat.h | 6 ------ sound/soc/codecs/tpa6130a2.c | 5 +++++ 2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/include/sound/tpa6130a2-plat.h b/include/sound/tpa6130a2-plat.h index 89beccb..4cc1093 100644 --- a/include/sound/tpa6130a2-plat.h +++ b/include/sound/tpa6130a2-plat.h @@ -23,13 +23,7 @@ #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 0c0fcb3..f37a02b 100644 --- a/sound/soc/codecs/tpa6130a2.c +++ b/sound/soc/codecs/tpa6130a2.c @@ -33,6 +33,11 @@
#include "tpa6130a2.h"
+enum tpa_model { + TPA6130A2, + TPA6140A2, +}; + static struct i2c_client *tpa6130a2_client;
/* This struct is used to save the context */
On 08/30/2011 02:39 PM, Peter Ujfalusi wrote:
Hello,
Small cleanup for the tpa6130a2 driver for model handling: Remove the model_id from platform_data, and use the device name/device_data to distinguish between the supported models of TPA.
Regards, Peter
Peter Ujfalusi (3): ASoC: tpa6130a2: Model support cleanup OMAP: RX51: No need to configure the tpa_model ASoC: tpa6130a2: Remove model_id from platform data
arch/arm/mach-omap2/board-rx51-peripherals.c | 1 - include/sound/tpa6130a2-plat.h | 6 ------ sound/soc/codecs/tpa6130a2.c | 12 +++++++++--- 3 files changed, 9 insertions(+), 10 deletions(-)
Tested-by: Jarkko Nikula jarkko.nikula@bitmer.com
On Tue, Aug 30, 2011 at 04:38:50PM +0300, Jarkko Nikula wrote:
Tested-by: Jarkko Nikula jarkko.nikula@bitmer.com
I applied these with the last two patches squashed together in order to preserve bisection - the two patches should have been combined as patch 2 removes a field that the existing code is using.
Hello Mark, Tony,
On Tuesday 30 August 2011 13:39:51 Ujfalusi, Peter wrote:
Hello,
Small cleanup for the tpa6130a2 driver for model handling: Remove the model_id from platform_data, and use the device name/device_data to distinguish between the supported models of TPA.
Would you have time to take a look at this series (it got the Tested-by from Jarkko)?
Thank you, Péter
On Tue, 2011-09-13 at 13:27 +0100, Mark Brown wrote:
On Tue, Sep 13, 2011 at 03:11:41PM +0300, Péter Ujfalusi wrote:
Would you have time to take a look at this series (it got the Tested-by from Jarkko)?
I'm fine with it, I'm waiting for Liam's review.
Acked-by: Liam Girdwood lrg@ti.com
participants (4)
-
Jarkko Nikula
-
Liam Girdwood
-
Mark Brown
-
Peter Ujfalusi