Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I195/split probe #4527

Closed
Closed
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
8 changes: 8 additions & 0 deletions sound/soc/sof/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,14 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)

sof_set_fw_state(sdev, SOF_FW_BOOT_NOT_STARTED);

/*
* first pass of probe which isn't allowed to run in a work-queue,
* typically to rely on -EPROBE_DEFER dependencies
*/
ret = snd_sof_probe_no_wq(sdev);
if (ret < 0)
return ret;

if (IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE)) {
INIT_WORK(&sdev->probe_work, sof_probe_work);
schedule_work(&sdev->probe_work);
Expand Down
1 change: 1 addition & 0 deletions sound/soc/sof/intel/hda-common-ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

struct snd_sof_dsp_ops sof_hda_common_ops = {
/* probe/remove/shutdown */
.probe_no_wq = hda_dsp_probe_no_wq,
.probe = hda_dsp_probe,
.remove = hda_dsp_remove,

Expand Down
16 changes: 13 additions & 3 deletions sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,11 +1118,10 @@ static irqreturn_t hda_dsp_interrupt_thread(int irq, void *context)
return IRQ_HANDLED;
}

int hda_dsp_probe(struct snd_sof_dev *sdev)
int hda_dsp_probe_no_wq(struct snd_sof_dev *sdev)
{
struct pci_dev *pci = to_pci_dev(sdev->dev);
struct sof_intel_hda_dev *hdev;
struct hdac_bus *bus;
const struct sof_intel_dsp_desc *chip;
int ret = 0;

Expand Down Expand Up @@ -1162,6 +1161,17 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
sdev->pdata->hw_pdata = hdev;
hdev->desc = chip;

err:
return ret;
}

int hda_dsp_probe(struct snd_sof_dev *sdev)
{
struct pci_dev *pci = to_pci_dev(sdev->dev);
struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata;
struct hdac_bus *bus;
int ret = 0;

hdev->dmic_dev = platform_device_register_data(sdev->dev, "dmic-codec",
PLATFORM_DEVID_NONE,
NULL, 0);
Expand Down Expand Up @@ -1299,7 +1309,7 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
platform_device_unregister(hdev->dmic_dev);
iounmap(bus->remap_addr);
hda_codec_i915_exit(sdev);
err:

return ret;
}

Expand Down
1 change: 1 addition & 0 deletions sound/soc/sof/intel/hda.h
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ struct sof_intel_hda_stream {
/*
* DSP Core services.
*/
int hda_dsp_probe_no_wq(struct snd_sof_dev *sdev);
int hda_dsp_probe(struct snd_sof_dev *sdev);
int hda_dsp_remove(struct snd_sof_dev *sdev);
int hda_dsp_core_power_up(struct snd_sof_dev *sdev, unsigned int core_mask);
Expand Down
8 changes: 8 additions & 0 deletions sound/soc/sof/ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ static inline void sof_ops_free(struct snd_sof_dev *sdev)
/* Mandatory operations are verified during probing */

/* init */
static inline int snd_sof_probe_no_wq(struct snd_sof_dev *sdev)
{
if (sof_ops(sdev)->probe_no_wq)
return sof_ops(sdev)->probe_no_wq(sdev);

return 0;
}

static inline int snd_sof_probe(struct snd_sof_dev *sdev)
{
return sof_ops(sdev)->probe(sdev);
Expand Down
1 change: 1 addition & 0 deletions sound/soc/sof/sof-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ struct sof_firmware {
struct snd_sof_dsp_ops {

/* probe/remove/shutdown */
int (*probe_no_wq)(struct snd_sof_dev *sof_dev); /* optional */
int (*probe)(struct snd_sof_dev *sof_dev); /* mandatory */
int (*remove)(struct snd_sof_dev *sof_dev); /* optional */
int (*shutdown)(struct snd_sof_dev *sof_dev); /* optional */
Expand Down