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
4 changes: 0 additions & 4 deletions sound/soc/sof/intel/cnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ static irqreturn_t cnl_ipc_irq_thread(int irq, void *context)
u32 msg_ext;
Comment thread
plbossart marked this conversation as resolved.
Outdated
irqreturn_t ret = IRQ_NONE;

/* here we handle IPC interrupts only */
if (!(sdev->irq_status & HDA_DSP_ADSPIS_IPC))
return ret;

hipcida = snd_sof_dsp_read(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCIDA);
hipcctl = snd_sof_dsp_read(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCCTL);
hipctdr = snd_sof_dsp_read(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCTDR);
Expand Down
13 changes: 5 additions & 8 deletions sound/soc/sof/intel/hda-ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,6 @@ irqreturn_t hda_dsp_ipc_irq_thread(int irq, void *context)
u32 msg;
u32 msg_ext;

/* here we handle IPC interrupts only */
if (!(sdev->irq_status & HDA_DSP_ADSPIS_IPC))
return IRQ_NONE;

Comment thread
plbossart marked this conversation as resolved.
Outdated
/* read IPC status */
hipcie = snd_sof_dsp_read(sdev, HDA_DSP_BAR,
HDA_DSP_REG_HIPCIE);
Expand Down Expand Up @@ -234,19 +230,20 @@ irqreturn_t hda_dsp_ipc_irq_handler(int irq, void *context)
{
Comment thread
plbossart marked this conversation as resolved.
Outdated
Comment thread
plbossart marked this conversation as resolved.
Outdated
struct snd_sof_dev *sdev = context;
int ret = IRQ_NONE;
u32 irq_status;

spin_lock(&sdev->hw_lock);

/* store status */
sdev->irq_status = snd_sof_dsp_read(sdev, HDA_DSP_BAR,
HDA_DSP_REG_ADSPIS);
irq_status = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPIS);
dev_vdbg(sdev->dev, "irq handler: irq_status:0x%x\n", irq_status);

/* invalid message ? */
if (sdev->irq_status == 0xffffffff)
if (irq_status == 0xffffffff)
goto out;

/* IPC message ? */
if (sdev->irq_status & HDA_DSP_ADSPIS_IPC) {
if (irq_status & HDA_DSP_ADSPIS_IPC) {
Comment thread
plbossart marked this conversation as resolved.
Outdated
/* disable IPC interrupt */
snd_sof_dsp_update_bits_unlocked(sdev, HDA_DSP_BAR,
HDA_DSP_REG_ADSPIC,
Expand Down
11 changes: 10 additions & 1 deletion sound/soc/sof/intel/hda-stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,8 @@ int hda_dsp_stream_hw_params(struct snd_sof_dev *sdev,
irqreturn_t hda_dsp_stream_interrupt(int irq, void *context)
{
struct hdac_bus *bus = context;
struct sof_intel_hda_dev *sof_hda = bus_to_sof_hda(bus);
u32 stream_mask;
u32 status;

if (!pm_runtime_active(bus->dev))
Expand All @@ -441,7 +443,10 @@ irqreturn_t hda_dsp_stream_interrupt(int irq, void *context)
spin_lock(&bus->reg_lock);

status = snd_hdac_chip_readl(bus, INTSTS);
if (status == 0 || status == 0xffffffff) {
stream_mask = GENMASK(sof_hda->stream_max - 1, 0) | AZX_INT_CTRL_EN;

/* Not stream interrupt or register inaccessible, ignore it.*/
if (!(status & stream_mask) || status == 0xffffffff) {
spin_unlock(&bus->reg_lock);
return IRQ_NONE;
}
Expand Down Expand Up @@ -500,6 +505,7 @@ int hda_dsp_stream_init(struct snd_sof_dev *sdev)
struct hdac_ext_stream *stream;
Comment thread
plbossart marked this conversation as resolved.
Outdated
struct hdac_stream *hstream;
struct pci_dev *pci = to_pci_dev(sdev->dev);
struct sof_intel_hda_dev *sof_hda = bus_to_sof_hda(bus);
int sd_offset;
int i, num_playback, num_capture, num_total, ret;
u32 gcap;
Expand Down Expand Up @@ -657,6 +663,9 @@ int hda_dsp_stream_init(struct snd_sof_dev *sdev)
list_add_tail(&hstream->list, &bus->stream_list);
}

/* store total stream count (playback + capture) from GCAP */
sof_hda->stream_max = num_total;

return 0;
}

Expand Down
3 changes: 3 additions & 0 deletions sound/soc/sof/intel/hda.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,9 @@ struct sof_intel_hda_dev {
/* if position update IPC needed */
u32 no_ipc_position;

/* the maximum number of streams (playback + capture) supported */
u32 stream_max;

int irq;

/* DMIC device */
Expand Down
1 change: 0 additions & 1 deletion sound/soc/sof/sof-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ struct snd_sof_dev {
struct snd_sof_mailbox host_box; /* Host initiated IPC */
struct snd_sof_mailbox stream_box; /* Stream position update */
struct snd_sof_ipc_msg *msg;
u64 irq_status;
int ipc_irq;
u32 next_comp_id; /* monotonic - reset during S3 */

Expand Down