Jelajahi Sumber

ASoC: tpa6130a2: Model support cleanup

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>
Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi 14 tahun lalu
induk
melakukan
07441006b2
1 mengubah file dengan 4 tambahan dan 3 penghapusan
  1. 4 3
      sound/soc/codecs/tpa6130a2.c

+ 4 - 3
sound/soc/codecs/tpa6130a2.c

@@ -383,7 +383,7 @@ static int __devinit tpa6130a2_probe(struct i2c_client *client,
 
 
 	pdata = client->dev.platform_data;
 	pdata = client->dev.platform_data;
 	data->power_gpio = pdata->power_gpio;
 	data->power_gpio = pdata->power_gpio;
-	data->id = pdata->id;
+	data->id = id->driver_data;
 
 
 	mutex_init(&data->mutex);
 	mutex_init(&data->mutex);
 
 
@@ -405,7 +405,7 @@ static int __devinit tpa6130a2_probe(struct i2c_client *client,
 	switch (data->id) {
 	switch (data->id) {
 	default:
 	default:
 		dev_warn(dev, "Unknown TPA model (%d). Assuming 6130A2\n",
 		dev_warn(dev, "Unknown TPA model (%d). Assuming 6130A2\n",
-			 pdata->id);
+			 data->id);
 	case TPA6130A2:
 	case TPA6130A2:
 		regulator = "Vdd";
 		regulator = "Vdd";
 		break;
 		break;
@@ -469,7 +469,8 @@ static int __devexit tpa6130a2_remove(struct i2c_client *client)
 }
 }
 
 
 static const struct i2c_device_id tpa6130a2_id[] = {
 static const struct i2c_device_id tpa6130a2_id[] = {
-	{ "tpa6130a2", 0 },
+	{ "tpa6130a2", TPA6130A2 },
+	{ "tpa6140a2", TPA6140A2 },
 	{ }
 	{ }
 };
 };
 MODULE_DEVICE_TABLE(i2c, tpa6130a2_id);
 MODULE_DEVICE_TABLE(i2c, tpa6130a2_id);