diff options
| -rw-r--r-- | sound/soc/codecs/tpa6130a2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c index 329acc1a2074..83b5631b13a8 100644 --- a/sound/soc/codecs/tpa6130a2.c +++ b/sound/soc/codecs/tpa6130a2.c | |||
| @@ -125,7 +125,7 @@ static int tpa6130a2_power(int power) | |||
| 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; |
