diff options
Diffstat (limited to 'sound/soc/codecs/tlv320aic32x4.c')
-rw-r--r-- | sound/soc/codecs/tlv320aic32x4.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c index d7d0e18f794c..e39e08d5d8e4 100644 --- a/sound/soc/codecs/tlv320aic32x4.c +++ b/sound/soc/codecs/tlv320aic32x4.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | #include <linux/pm.h> | 30 | #include <linux/pm.h> |
31 | #include <linux/gpio.h> | ||
31 | #include <linux/i2c.h> | 32 | #include <linux/i2c.h> |
32 | #include <linux/cdev.h> | 33 | #include <linux/cdev.h> |
33 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
@@ -65,6 +66,7 @@ struct aic32x4_priv { | |||
65 | u32 power_cfg; | 66 | u32 power_cfg; |
66 | u32 micpga_routing; | 67 | u32 micpga_routing; |
67 | bool swapdacs; | 68 | bool swapdacs; |
69 | int rstn_gpio; | ||
68 | }; | 70 | }; |
69 | 71 | ||
70 | /* 0dB min, 1dB steps */ | 72 | /* 0dB min, 1dB steps */ |
@@ -627,10 +629,20 @@ static int aic32x4_probe(struct snd_soc_codec *codec) | |||
627 | { | 629 | { |
628 | struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec); | 630 | struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec); |
629 | u32 tmp_reg; | 631 | u32 tmp_reg; |
632 | int ret; | ||
630 | 633 | ||
631 | codec->hw_write = (hw_write_t) i2c_master_send; | 634 | codec->hw_write = (hw_write_t) i2c_master_send; |
632 | codec->control_data = aic32x4->control_data; | 635 | codec->control_data = aic32x4->control_data; |
633 | 636 | ||
637 | if (aic32x4->rstn_gpio >= 0) { | ||
638 | ret = devm_gpio_request_one(codec->dev, aic32x4->rstn_gpio, | ||
639 | GPIOF_OUT_INIT_LOW, "tlv320aic32x4 rstn"); | ||
640 | if (ret != 0) | ||
641 | return ret; | ||
642 | ndelay(10); | ||
643 | gpio_set_value(aic32x4->rstn_gpio, 1); | ||
644 | } | ||
645 | |||
634 | snd_soc_write(codec, AIC32X4_RESET, 0x01); | 646 | snd_soc_write(codec, AIC32X4_RESET, 0x01); |
635 | 647 | ||
636 | /* Power platform configuration */ | 648 | /* Power platform configuration */ |
@@ -723,10 +735,12 @@ static __devinit int aic32x4_i2c_probe(struct i2c_client *i2c, | |||
723 | aic32x4->power_cfg = pdata->power_cfg; | 735 | aic32x4->power_cfg = pdata->power_cfg; |
724 | aic32x4->swapdacs = pdata->swapdacs; | 736 | aic32x4->swapdacs = pdata->swapdacs; |
725 | aic32x4->micpga_routing = pdata->micpga_routing; | 737 | aic32x4->micpga_routing = pdata->micpga_routing; |
738 | aic32x4->rstn_gpio = pdata->rstn_gpio; | ||
726 | } else { | 739 | } else { |
727 | aic32x4->power_cfg = 0; | 740 | aic32x4->power_cfg = 0; |
728 | aic32x4->swapdacs = false; | 741 | aic32x4->swapdacs = false; |
729 | aic32x4->micpga_routing = 0; | 742 | aic32x4->micpga_routing = 0; |
743 | aic32x4->rstn_gpio = -1; | ||
730 | } | 744 | } |
731 | 745 | ||
732 | ret = snd_soc_register_codec(&i2c->dev, | 746 | ret = snd_soc_register_codec(&i2c->dev, |