Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion sound/hda/ext/hdac_ext_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ int snd_hdac_ext_bus_init(struct hdac_bus *bus, struct device *dev,
INIT_LIST_HEAD(&bus->hlink_list);
bus->idx = idx++;

mutex_init(&bus->lock);
bus->cmd_dma_state = true;

return 0;
Expand Down
1 change: 1 addition & 0 deletions sound/hda/hdac_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ int snd_hdac_bus_init(struct hdac_bus *bus, struct device *dev,
INIT_WORK(&bus->unsol_work, snd_hdac_bus_process_unsol_events);
spin_lock_init(&bus->reg_lock);
mutex_init(&bus->cmd_mutex);
mutex_init(&bus->lock);
bus->irq = -1;
return 0;
}
Expand Down
6 changes: 5 additions & 1 deletion sound/hda/hdac_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,15 @@ void snd_hdac_display_power(struct hdac_bus *bus, unsigned int idx, bool enable)

dev_dbg(bus->dev, "display power %s\n",
enable ? "enable" : "disable");

mutex_lock(&bus->lock);
if (enable)
set_bit(idx, &bus->display_power_status);
else
clear_bit(idx, &bus->display_power_status);

if (!acomp || !acomp->ops)
return;
goto unlock;

if (bus->display_power_status) {
if (!bus->display_power_active) {
Expand All @@ -92,6 +94,8 @@ void snd_hdac_display_power(struct hdac_bus *bus, unsigned int idx, bool enable)
bus->display_power_active = false;
}
}
unlock:
mutex_unlock(&bus->lock);
}
EXPORT_SYMBOL_GPL(snd_hdac_display_power);

Expand Down
11 changes: 11 additions & 0 deletions sound/soc/codecs/hdac_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1854,6 +1854,17 @@ static int hdmi_codec_probe(struct snd_soc_component *component)
/* Imp: Store the card pointer in hda_codec */
hdmi->card = dapm->card->snd_card;

/*
* Setup a device_link between card device and HDMI codec device.
* The card device is the consumer and the HDMI codec device is
* the supplier. With this setting, we can make sure that the audio
* domain in display power will be always turned on before operating
* on the HDMI audio codec registers.
* Let's use the flag DL_FLAG_AUTOREMOVE_CONSUMER. This can make
* sure the device link is freed when the machine driver is removed.
*/
device_link_add(component->card->dev, &hdev->dev, DL_FLAG_RPM_ACTIVE |
DL_FLAG_AUTOREMOVE_CONSUMER);
/*
* hdac_device core already sets the state to active and calls
* get_noresume. So enable runtime and set the device to suspend.
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ static const struct snd_pcm_hw_constraint_list constraints_dmic_channels = {
};

static const unsigned int dmic_2ch[] = {
4,
2,
};

static const struct snd_pcm_hw_constraint_list constraints_dmic_2ch = {
Expand Down
8 changes: 1 addition & 7 deletions sound/soc/intel/haswell/sst-haswell-ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,6 @@ static inline u32 msg_get_stream_type(u32 msg)
return (msg & IPC_STR_TYPE_MASK) >> IPC_STR_TYPE_SHIFT;
}

static inline u32 msg_get_stage_type(u32 msg)
{
return (msg & IPC_STG_TYPE_MASK) >> IPC_STG_TYPE_SHIFT;
}

static inline u32 msg_get_stream_id(u32 msg)
{
return (msg & IPC_STR_ID_MASK) >> IPC_STR_ID_SHIFT;
Expand Down Expand Up @@ -666,13 +661,12 @@ static int hsw_module_message(struct sst_hsw *hsw, u32 header)

static int hsw_stream_message(struct sst_hsw *hsw, u32 header)
{
u32 stream_msg, stream_id, stage_type;
u32 stream_msg, stream_id;
struct sst_hsw_stream *stream;
int handled = 0;

stream_msg = msg_get_stream_type(header);
stream_id = msg_get_stream_id(header);
stage_type = msg_get_stage_type(header);

stream = get_stream_by_id(hsw, stream_id);
if (stream == NULL)
Expand Down
12 changes: 9 additions & 3 deletions sound/soc/soc-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,10 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
continue;

if (component->driver->module_get_upon_open &&
!try_module_get(component->dev->driver->owner))
return -ENODEV;
!try_module_get(component->dev->driver->owner)) {
ret = -ENODEV;
goto module_err;
}

ret = component->driver->ops->open(substream);
if (ret < 0) {
Expand Down Expand Up @@ -636,7 +638,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)

component_err:
soc_pcm_components_close(substream, component);

module_err:
if (cpu_dai->driver->ops->shutdown)
cpu_dai->driver->ops->shutdown(substream, cpu_dai);
out:
Expand Down Expand Up @@ -2164,6 +2166,10 @@ int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int stream)
}
}

/* copy the fixed-up hw params for BE dai */
memcpy(&be->dpcm[stream].hw_params, &dpcm->hw_params,
sizeof(struct snd_pcm_hw_params));

/* only allow hw_params() if no connected FEs are running */
if (!snd_soc_dpcm_can_be_params(fe, be, stream))
continue;
Expand Down