Skip to content

Conversation

@ranj063
Copy link
Collaborator

@ranj063 ranj063 commented Nov 13, 2019

This PR includes the set of patches that prepare the SOF driver for the addition of multiple clients by partitioning the audio-specific code out of the top-level device core and also in the process perform some random cleanups that are otherwise necessary.

@ranj063
Copy link
Collaborator Author

ranj063 commented Nov 13, 2019

@dbaluta FYI this PR includes your changes from #1448

@ranj063 ranj063 force-pushed the topic/multi-client-prep branch 2 times, most recently from ef33314 to e4bbc40 Compare November 13, 2019 18:29
@ranj063
Copy link
Collaborator Author

ranj063 commented Nov 13, 2019

@plbossart @dbaluta please hold off on reviewing this series. I see some failure on some devices that I need to fix. I will notify when ive fixed the errors

@ranj063 ranj063 force-pushed the topic/multi-client-prep branch 2 times, most recently from 4fa835e to 483039f Compare November 13, 2019 19:55
@ranj063
Copy link
Collaborator Author

ranj063 commented Nov 13, 2019

@dbaluta @plbossart ready for review now!

Copy link
Member

@plbossart plbossart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good, I have a couple of comments that would need to be addressed.
Also we'd need to verify how this impacts the SoundWire machine driver stuff, clearly we are going to see a set of conflicts, so wondering if this should go first.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commit message: typo on interating.

interact or iterate, pick one :-)

@plbossart plbossart mentioned this pull request Nov 13, 2019
@ranj063 ranj063 force-pushed the topic/multi-client-prep branch from 483039f to 551682b Compare November 15, 2019 00:15
@ranj063
Copy link
Collaborator Author

ranj063 commented Nov 15, 2019

@plbossart @dbaluta I've updated this PR now based on comments Thanks!

Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First part of review, some comments but mostly to the commit messages. Will continue review later.

@ranj063 ranj063 force-pushed the topic/multi-client-prep branch from 551682b to 330a400 Compare November 18, 2019 17:48
Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ranj063 Looks good, only a few minor nits left (see inline)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ranj063 Again a nit with the commit message: "Set the drv_name and tplg_filename.... in the sof_machine_check op" However this patch does not touch sof_machine_check, making this confusing.

Did you mean that "As the drv_name and tplg_filename for nocodec machine driver is set in the sof_machine_check, sof_nocodec_setup() does not need..." ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kv2019i I changed the commit message slightly but the patch does modify sof_machine_check() to set the drv_name for the nocodec case no?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ranj063 Ah, you are right, I misread. Having rationale why the change is done would be good as well. So I guess here the idea is to decouple sof_nocodec_setup() from acpi mach structure, right? But yeah, this is apparent from the series, so good enough for me.

@dbaluta
Copy link
Collaborator

dbaluta commented Nov 19, 2019

@ranj063 one more thing: For patch "ASoC: SOF: Make creation of machine device from SOF core optional" we need to also update sof-of-dev.c file.

I have sent you a patch via email takes care of this. We just need you to apply it on your tree and then squash it under the patch "ASoC: SOF: Make creation of machine device from SOF core optional"

Remove snd_sof_init_topology() as it is never used.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Modify the signature for snd_sof_create_page_table to
take struct device pointer as an argument instead of
struct snd_sof_dev as this will be used by both the SOF
core device and its clients. Also, move the definition
out of core.c to utils.c.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
For some platforms, the refcount is explicitly incremented
to prevent it from entering runtime suspend. This
should be be done during probe in the core instead
of being done in the PCM driver.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Currently the FW filename is obtained from the ACPI matching
table when determining which machine driver to use. In
preparation for making the machine driver ACPI match optional
for Device Tree platforms and moving the machine driver selection
out of the SOF core, this patch introduces the default_fw_filename
member in struct sof_dev_desc.

Once the machine driver selection is moved out of SOF core,
the nocodec_fw_filename will become obsolete and will be removed.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Move all the audio-specific code in the core,
audio-specific logic in the top-level PM callbacks
and the core header files into a separate file
(sof-audio.*) in preparation for adding an
audio client device.

In the process of moving all structure definitions
for widget, routes, pcm's etc, the snd_sof_dev
member in all these structs is replaced with
the snd_soc_component member. Also, use the component
device instead of the snd_sof_dev device wherever
possible in the PCM component driver,
control IO functions and the topology parser as the
component device will be moved over to the client
device later on.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
The machine driver selection for HDA platforms will be
consolidated and moved out of the SOF DSP
probe callback. In preparation for that, modify the
signature for hda_codec_probe_bus() to pass the
hda_codec_use_common_hdmi as a variable while probing the
HDA codecs.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
@ranj063 ranj063 force-pushed the topic/multi-client-prep branch from 330a400 to 6e08397 Compare November 19, 2019 17:26
@ranj063
Copy link
Collaborator Author

ranj063 commented Nov 19, 2019

@ranj063 one more thing: For patch "ASoC: SOF: Make creation of machine device from SOF core optional" we need to also update sof-of-dev.c file.

I have sent you a patch via email takes care of this. We just need you to apply it on your tree and then squash it under the patch "ASoC: SOF: Make creation of machine device from SOF core optional"

@dbaluta done!

@dbaluta
Copy link
Collaborator

dbaluta commented Nov 19, 2019

@ranj063 thanks! Care to also have a look at checkpatch.pl warnings. At least this one can be fixed

CHECK: Please don't use multiple blank lines
#898: FILE: sound/soc/sof/sof-priv.h:523:
 
+

@ranj063 ranj063 force-pushed the topic/multi-client-prep branch from 6e08397 to 82ec854 Compare November 19, 2019 21:30
@ranj063
Copy link
Collaborator Author

ranj063 commented Nov 19, 2019

@ranj063 thanks! Care to also have a look at checkpatch.pl warnings. At least this one can be fixed

CHECK: Please don't use multiple blank lines
#898: FILE: sound/soc/sof/sof-priv.h:523:
 
+

@dbaluta thanks for pointing out. fixed now.

@ranj063 ranj063 force-pushed the topic/multi-client-prep branch from 82ec854 to 150de37 Compare November 19, 2019 22:35
plbossart
plbossart previously approved these changes Nov 19, 2019
Copy link
Member

@plbossart plbossart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@plbossart
Copy link
Member

@ranj063 can you look into build errors?

dbaluta and others added 4 commits November 19, 2019 15:42
Currently, SOF probes machine drivers by creating a platform device
and passing the machine description as private data.

This is driven by the ACPI restrictions. Ideally, ACPI tables
should contain the description for the machine driver. This is
not possible because ACPI tables are frozen and used on multiple
OS-es (e.g Windows).

In the case of Device Tree we don't have this restriction, so we
choose to probe the machine drivers by creating a DT node as is
the standard ALSA way.

This patch makes the probing of machine drivers from SOF
core optional allowing for Device Tree platforms to decouple
the SOF core from machine driver probing.

Along with this, it also consolidates the machine driver selection
for Intel platforms by defining optional ops for selecting the machine
driver based on the ACPI match for HDA and non-HDA platforms and
setting the mach params.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Remove nocodec_fw_filename from struct sof_dev_desc
as it is not longer needed.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
This field is only set but never used. Let's remove
it to make code cleaner.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Set the drv_name and tplg_filename for nocodec
machine driver in sof_machine_check().
This means the sof_nocodec_setup() does not
need the mach, plat_data or desc arguments any longer.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
@ranj063 ranj063 force-pushed the topic/multi-client-prep branch from 497d0da to b585b24 Compare November 19, 2019 23:43
@ranj063
Copy link
Collaborator Author

ranj063 commented Nov 20, 2019

@ranj063 can you look into build errors?

@plbossart yes fixed now

Copy link
Member

@plbossart plbossart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to merge this, @dbaluta @kv2019i @bardliao can you double-check and approve if you like this PR?

@dbaluta
Copy link
Collaborator

dbaluta commented Nov 20, 2019

@plbossart looks good to me! @ranj063 thanks for the patches!

Copy link
Collaborator

@bardliao bardliao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks @ranj063

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ranj063 Ah, you are right, I misread. Having rationale why the change is done would be good as well. So I guess here the idea is to decouple sof_nocodec_setup() from acpi mach structure, right? But yeah, this is apparent from the series, so good enough for me.

@dbaluta
Copy link
Collaborator

dbaluta commented Nov 20, 2019

@kv2019i yes, the idea is to decouple sof_nocodec_setup() from ACPI.

@plbossart
Copy link
Member

wow, a ton of reviewers this time, thanks everyone, merging.

@plbossart plbossart merged commit 2824abb into thesofproject:topic/sof-dev Nov 20, 2019
.chip_info = &jsl_chip_info,
.default_fw_path = "intel/sof",
.default_tplg_path = "intel/sof-tplg",
.nocodec_fw_filename = "sof-jsl.ri",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missed .default_fw_filename = "sof-jsl.ri", here.

@ranj063 ranj063 deleted the topic/multi-client-prep branch February 13, 2022 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants