aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/tpa6130a2.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/tpa6130a2.c')
-rw-r--r--sound/soc/codecs/tpa6130a2.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c
index 239e0c461068..7eeca79d7387 100644
--- a/sound/soc/codecs/tpa6130a2.c
+++ b/sound/soc/codecs/tpa6130a2.c
@@ -33,6 +33,11 @@
33 33
34#include "tpa6130a2.h" 34#include "tpa6130a2.h"
35 35
36enum tpa_model {
37 TPA6130A2,
38 TPA6140A2,
39};
40
36static struct i2c_client *tpa6130a2_client; 41static struct i2c_client *tpa6130a2_client;
37 42
38/* This struct is used to save the context */ 43/* This struct is used to save the context */
@@ -383,7 +388,7 @@ static int __devinit tpa6130a2_probe(struct i2c_client *client,
383 388
384 pdata = client->dev.platform_data; 389 pdata = client->dev.platform_data;
385 data->power_gpio = pdata->power_gpio; 390 data->power_gpio = pdata->power_gpio;
386 data->id = pdata->id; 391 data->id = id->driver_data;
387 392
388 mutex_init(&data->mutex); 393 mutex_init(&data->mutex);
389 394
@@ -405,7 +410,7 @@ static int __devinit tpa6130a2_probe(struct i2c_client *client,
405 switch (data->id) { 410 switch (data->id) {
406 default: 411 default:
407 dev_warn(dev, "Unknown TPA model (%d). Assuming 6130A2\n", 412 dev_warn(dev, "Unknown TPA model (%d). Assuming 6130A2\n",
408 pdata->id); 413 data->id);
409 case TPA6130A2: 414 case TPA6130A2:
410 regulator = "Vdd"; 415 regulator = "Vdd";
411 break; 416 break;
@@ -446,7 +451,6 @@ err_regulator:
446 gpio_free(data->power_gpio); 451 gpio_free(data->power_gpio);
447err_gpio: 452err_gpio:
448 kfree(data); 453 kfree(data);
449 i2c_set_clientdata(tpa6130a2_client, NULL);
450 tpa6130a2_client = NULL; 454 tpa6130a2_client = NULL;
451 455
452 return ret; 456 return ret;
@@ -470,7 +474,8 @@ static int __devexit tpa6130a2_remove(struct i2c_client *client)
470} 474}
471 475
472static const struct i2c_device_id tpa6130a2_id[] = { 476static const struct i2c_device_id tpa6130a2_id[] = {
473 { "tpa6130a2", 0 }, 477 { "tpa6130a2", TPA6130A2 },
478 { "tpa6140a2", TPA6140A2 },
474 { } 479 { }
475}; 480};
476MODULE_DEVICE_TABLE(i2c, tpa6130a2_id); 481MODULE_DEVICE_TABLE(i2c, tpa6130a2_id);