diff options
Diffstat (limited to 'sound/soc/codecs/tpa6130a2.c')
-rw-r--r-- | sound/soc/codecs/tpa6130a2.c | 22 |
1 files changed, 20 insertions, 2 deletions
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 | ||
44 | static 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 */ |
45 | struct tpa6130a2_data { | 50 | struct 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); |