Skip to content

Commit

Permalink
ASoC: SOF: Intel: Use consistent name for struct sof_intel_hda_dev va…
Browse files Browse the repository at this point in the history
…riable

The used name fro struct sof_intel_hda_dev varies between files and even
within files from hdev, hda and sof_hda.
hdev is usually used for hdac_device and majority of the code uses hda, so
change other names to hda to be consistent.

Signed-off-by: Peter Ujfalusi <[email protected]>
  • Loading branch information
ujfalusi authored and plbossart committed Oct 17, 2023
1 parent fc0320e commit 180286d
Show file tree
Hide file tree
Showing 9 changed files with 117 additions and 118 deletions.
18 changes: 9 additions & 9 deletions sound/soc/sof/intel/cnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ irqreturn_t cnl_ipc4_irq_thread(int irq, void *context)
dev_dbg_ratelimited(sdev->dev, "nothing to do in IPC IRQ thread\n");

if (ack_received) {
struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata;
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;

if (hdev->delayed_ipc_tx_msg)
cnl_ipc4_send_msg(sdev, hdev->delayed_ipc_tx_msg);
if (hda->delayed_ipc_tx_msg)
cnl_ipc4_send_msg(sdev, hda->delayed_ipc_tx_msg);
}

return IRQ_HANDLED;
Expand Down Expand Up @@ -261,15 +261,15 @@ static bool cnl_compact_ipc_compress(struct snd_sof_ipc_msg *msg,

int cnl_ipc4_send_msg(struct snd_sof_dev *sdev, struct snd_sof_ipc_msg *msg)
{
struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata;
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
struct sof_ipc4_msg *msg_data = msg->msg_data;

if (hda_ipc4_tx_is_busy(sdev)) {
hdev->delayed_ipc_tx_msg = msg;
hda->delayed_ipc_tx_msg = msg;
return 0;
}

hdev->delayed_ipc_tx_msg = NULL;
hda->delayed_ipc_tx_msg = NULL;

/* send the message via mailbox */
if (msg_data->data_size)
Expand All @@ -280,14 +280,14 @@ int cnl_ipc4_send_msg(struct snd_sof_dev *sdev, struct snd_sof_ipc_msg *msg)
snd_sof_dsp_write(sdev, HDA_DSP_BAR, CNL_DSP_REG_HIPCIDR,
msg_data->primary | CNL_DSP_REG_HIPCIDR_BUSY);

hda_dsp_ipc4_schedule_d0i3_work(hdev, msg);
hda_dsp_ipc4_schedule_d0i3_work(hda, msg);

return 0;
}

int cnl_ipc_send_msg(struct snd_sof_dev *sdev, struct snd_sof_ipc_msg *msg)
{
struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata;
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
struct sof_ipc_cmd_hdr *hdr;
u32 dr = 0;
u32 dd = 0;
Expand Down Expand Up @@ -326,7 +326,7 @@ int cnl_ipc_send_msg(struct snd_sof_dev *sdev, struct snd_sof_ipc_msg *msg)
* CTX_SAVE IPC, which is sent before the DSP enters D3.
*/
if (hdr->cmd != (SOF_IPC_GLB_PM_MSG | SOF_IPC_PM_CTX_SAVE))
mod_delayed_work(system_wq, &hdev->d0i3_work,
mod_delayed_work(system_wq, &hda->d0i3_work,
msecs_to_jiffies(SOF_HDA_D0I3_WORK_DELAY_MS));

return 0;
Expand Down
7 changes: 3 additions & 4 deletions sound/soc/sof/intel/hda-dsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1040,10 +1040,9 @@ int hda_dsp_set_hw_params_upon_resume(struct snd_sof_dev *sdev)

void hda_dsp_d0i3_work(struct work_struct *work)
{
struct sof_intel_hda_dev *hdev = container_of(work,
struct sof_intel_hda_dev,
d0i3_work.work);
struct hdac_bus *bus = &hdev->hbus.core;
struct sof_intel_hda_dev *hda = container_of(work, struct sof_intel_hda_dev,
d0i3_work.work);
struct hdac_bus *bus = &hda->hbus.core;
struct snd_sof_dev *sdev = dev_get_drvdata(bus->dev);
struct sof_dsp_power_state target_state = {
.state = SOF_DSP_PM_D0,
Expand Down
18 changes: 9 additions & 9 deletions sound/soc/sof/intel/hda-ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static inline bool hda_dsp_ipc4_pm_msg(u32 primary)
return false;
}

void hda_dsp_ipc4_schedule_d0i3_work(struct sof_intel_hda_dev *hdev,
void hda_dsp_ipc4_schedule_d0i3_work(struct sof_intel_hda_dev *hda,
struct snd_sof_ipc_msg *msg)
{
struct sof_ipc4_msg *msg_data = msg->msg_data;
Expand All @@ -89,21 +89,21 @@ void hda_dsp_ipc4_schedule_d0i3_work(struct sof_intel_hda_dev *hdev,
if (hda_dsp_ipc4_pm_msg(msg_data->primary))
return;

mod_delayed_work(system_wq, &hdev->d0i3_work,
mod_delayed_work(system_wq, &hda->d0i3_work,
msecs_to_jiffies(SOF_HDA_D0I3_WORK_DELAY_MS));
}

int hda_dsp_ipc4_send_msg(struct snd_sof_dev *sdev, struct snd_sof_ipc_msg *msg)
{
struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata;
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
struct sof_ipc4_msg *msg_data = msg->msg_data;

if (hda_ipc4_tx_is_busy(sdev)) {
hdev->delayed_ipc_tx_msg = msg;
hda->delayed_ipc_tx_msg = msg;
return 0;
}

hdev->delayed_ipc_tx_msg = NULL;
hda->delayed_ipc_tx_msg = NULL;

/* send the message via mailbox */
if (msg_data->data_size)
Expand All @@ -114,7 +114,7 @@ int hda_dsp_ipc4_send_msg(struct snd_sof_dev *sdev, struct snd_sof_ipc_msg *msg)
snd_sof_dsp_write(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCI,
msg_data->primary | HDA_DSP_REG_HIPCI_BUSY);

hda_dsp_ipc4_schedule_d0i3_work(hdev, msg);
hda_dsp_ipc4_schedule_d0i3_work(hda, msg);

return 0;
}
Expand Down Expand Up @@ -227,10 +227,10 @@ irqreturn_t hda_dsp_ipc4_irq_thread(int irq, void *context)
dev_dbg_ratelimited(sdev->dev, "nothing to do in IPC IRQ thread\n");

if (ack_received) {
struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata;
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;

if (hdev->delayed_ipc_tx_msg)
hda_dsp_ipc4_send_msg(sdev, hdev->delayed_ipc_tx_msg);
if (hda->delayed_ipc_tx_msg)
hda_dsp_ipc4_send_msg(sdev, hda->delayed_ipc_tx_msg);
}

return IRQ_HANDLED;
Expand Down
4 changes: 2 additions & 2 deletions sound/soc/sof/intel/hda-loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ int hda_dsp_post_fw_run(struct snd_sof_dev *sdev)
int ret;

if (sdev->first_boot) {
struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata;
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;

ret = hda_sdw_startup(sdev);
if (ret < 0) {
Expand All @@ -643,7 +643,7 @@ int hda_dsp_post_fw_run(struct snd_sof_dev *sdev)
if (!sof_debug_check_flag(SOF_DBG_IGNORE_D3_PERSISTENT) &&
(sdev->fw_ready.flags & SOF_IPC_INFO_D3_PERSISTENT ||
sdev->pdata->ipc_type == SOF_IPC_TYPE_4))
hdev->imrboot_supported = true;
hda->imrboot_supported = true;
}

hda_sdw_int_enable(sdev, true);
Expand Down
8 changes: 4 additions & 4 deletions sound/soc/sof/intel/hda-stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ hda_dsp_compr_bytes_transferred(struct hdac_stream *hstream, int direction)

static bool hda_dsp_stream_check(struct hdac_bus *bus, u32 status)
{
struct sof_intel_hda_dev *sof_hda = bus_to_sof_hda(bus);
struct sof_intel_hda_dev *hda = bus_to_sof_hda(bus);
struct hdac_stream *s;
bool active = false;
u32 sd_status;
Expand All @@ -770,7 +770,7 @@ static bool hda_dsp_stream_check(struct hdac_bus *bus, u32 status)
continue;

/* Inform ALSA only in case not do that with IPC */
if (s->substream && sof_hda->no_ipc_position) {
if (s->substream && hda->no_ipc_position) {
snd_sof_pcm_period_elapsed(s->substream);
} else if (s->cstream) {
hda_dsp_compr_bytes_transferred(s, s->cstream->direction);
Expand Down Expand Up @@ -818,7 +818,7 @@ int hda_dsp_stream_init(struct snd_sof_dev *sdev)
struct hdac_ext_stream *hext_stream;
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);
struct sof_intel_hda_dev *hda = bus_to_sof_hda(bus);
int sd_offset;
int i, num_playback, num_capture, num_total, ret;
u32 gcap;
Expand Down Expand Up @@ -935,7 +935,7 @@ int hda_dsp_stream_init(struct snd_sof_dev *sdev)
}

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

return 0;
}
Expand Down
Loading

0 comments on commit 180286d

Please sign in to comment.