diff options
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
| -rw-r--r-- | sound/pci/hda/hda_codec.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index d1d5fb9d7afb..aa0e1c18b606 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
| @@ -165,28 +165,29 @@ static int codec_exec_verb(struct hda_codec *codec, unsigned int cmd, | |||
| 165 | unsigned int *res) | 165 | unsigned int *res) |
| 166 | { | 166 | { |
| 167 | struct hda_bus *bus = codec->bus; | 167 | struct hda_bus *bus = codec->bus; |
| 168 | int err, repeated = 0; | 168 | int err; |
| 169 | 169 | ||
| 170 | if (res) | 170 | if (res) |
| 171 | *res = -1; | 171 | *res = -1; |
| 172 | again: | ||
| 172 | snd_hda_power_up(codec); | 173 | snd_hda_power_up(codec); |
| 173 | mutex_lock(&bus->cmd_mutex); | 174 | mutex_lock(&bus->cmd_mutex); |
| 174 | again: | ||
| 175 | err = bus->ops.command(bus, cmd); | 175 | err = bus->ops.command(bus, cmd); |
| 176 | if (!err) { | 176 | if (!err && res) |
| 177 | if (res) { | 177 | *res = bus->ops.get_response(bus); |
| 178 | *res = bus->ops.get_response(bus); | ||
| 179 | if (*res == -1 && bus->rirb_error) { | ||
| 180 | if (repeated++ < 1) { | ||
| 181 | snd_printd(KERN_WARNING "hda_codec: " | ||
| 182 | "Trying verb 0x%08x again\n", cmd); | ||
| 183 | goto again; | ||
| 184 | } | ||
| 185 | } | ||
| 186 | } | ||
| 187 | } | ||
| 188 | mutex_unlock(&bus->cmd_mutex); | 178 | mutex_unlock(&bus->cmd_mutex); |
| 189 | snd_hda_power_down(codec); | 179 | snd_hda_power_down(codec); |
| 180 | if (res && *res == -1 && bus->rirb_error) { | ||
| 181 | if (bus->response_reset) { | ||
| 182 | snd_printd("hda_codec: resetting BUS due to " | ||
| 183 | "fatal communication error\n"); | ||
| 184 | bus->ops.bus_reset(bus); | ||
| 185 | } | ||
| 186 | goto again; | ||
| 187 | } | ||
| 188 | /* clear reset-flag when the communication gets recovered */ | ||
| 189 | if (!err) | ||
| 190 | bus->response_reset = 0; | ||
| 190 | return err; | 191 | return err; |
| 191 | } | 192 | } |
| 192 | 193 | ||
| @@ -3894,11 +3895,10 @@ EXPORT_SYMBOL_HDA(auto_pin_cfg_labels); | |||
| 3894 | /** | 3895 | /** |
| 3895 | * snd_hda_suspend - suspend the codecs | 3896 | * snd_hda_suspend - suspend the codecs |
| 3896 | * @bus: the HDA bus | 3897 | * @bus: the HDA bus |
| 3897 | * @state: suspsend state | ||
| 3898 | * | 3898 | * |
| 3899 | * Returns 0 if successful. | 3899 | * Returns 0 if successful. |
| 3900 | */ | 3900 | */ |
| 3901 | int snd_hda_suspend(struct hda_bus *bus, pm_message_t state) | 3901 | int snd_hda_suspend(struct hda_bus *bus) |
| 3902 | { | 3902 | { |
| 3903 | struct hda_codec *codec; | 3903 | struct hda_codec *codec; |
| 3904 | 3904 | ||
