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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c
index 329acc1a2074..ee4fb201de60 100644
--- a/sound/soc/codecs/tpa6130a2.c
+++ b/sound/soc/codecs/tpa6130a2.c
@@ -119,13 +119,13 @@ static int tpa6130a2_power(int power)
119{ 119{
120 struct tpa6130a2_data *data; 120 struct tpa6130a2_data *data;
121 u8 val; 121 u8 val;
122 int ret; 122 int ret = 0;
123 123
124 BUG_ON(tpa6130a2_client == NULL); 124 BUG_ON(tpa6130a2_client == NULL);
125 data = i2c_get_clientdata(tpa6130a2_client); 125 data = i2c_get_clientdata(tpa6130a2_client);
126 126
127 mutex_lock(&data->mutex); 127 mutex_lock(&data->mutex);
128 if (power) { 128 if (power && !data->power_state) {
129 /* Power on */ 129 /* Power on */
130 if (data->power_gpio >= 0) 130 if (data->power_gpio >= 0)
131 gpio_set_value(data->power_gpio, 1); 131 gpio_set_value(data->power_gpio, 1);
@@ -153,7 +153,7 @@ static int tpa6130a2_power(int power)
153 val = tpa6130a2_read(TPA6130A2_REG_CONTROL); 153 val = tpa6130a2_read(TPA6130A2_REG_CONTROL);
154 val &= ~TPA6130A2_SWS; 154 val &= ~TPA6130A2_SWS;
155 tpa6130a2_i2c_write(TPA6130A2_REG_CONTROL, val); 155 tpa6130a2_i2c_write(TPA6130A2_REG_CONTROL, val);
156 } else { 156 } else if (!power && data->power_state) {
157 /* set SWS */ 157 /* set SWS */
158 val = tpa6130a2_read(TPA6130A2_REG_CONTROL); 158 val = tpa6130a2_read(TPA6130A2_REG_CONTROL);
159 val |= TPA6130A2_SWS; 159 val |= TPA6130A2_SWS;