-
Notifications
You must be signed in to change notification settings - Fork 140
Prep for adding multiple clients in the SOF driver #1478
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
Prep for adding multiple clients in the SOF driver #1478
Conversation
ef33314 to
e4bbc40
Compare
|
@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 |
4fa835e to
483039f
Compare
|
@dbaluta @plbossart ready for review now! |
plbossart
left a comment
There was a problem hiding this 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.
sound/soc/sof/core.c
Outdated
There was a problem hiding this comment.
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 :-)
483039f to
551682b
Compare
|
@plbossart @dbaluta I've updated this PR now based on comments Thanks! |
kv2019i
left a comment
There was a problem hiding this 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.
551682b to
330a400
Compare
kv2019i
left a comment
There was a problem hiding this 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)
include/sound/sof.h
Outdated
There was a problem hiding this comment.
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..." ?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
|
@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>
330a400 to
6e08397
Compare
@dbaluta done! |
|
@ranj063 thanks! Care to also have a look at checkpatch.pl warnings. At least this one can be fixed |
6e08397 to
82ec854
Compare
82ec854 to
150de37
Compare
plbossart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@ranj063 can you look into build errors? |
150de37 to
497d0da
Compare
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>
497d0da to
b585b24
Compare
@plbossart yes fixed now |
plbossart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
@plbossart looks good to me! @ranj063 thanks for the patches! |
bardliao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Thanks @ranj063
include/sound/sof.h
Outdated
There was a problem hiding this comment.
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.
|
@kv2019i yes, the idea is to decouple sof_nocodec_setup() from ACPI. |
|
wow, a ton of reviewers this time, thanks everyone, merging. |
| .chip_info = &jsl_chip_info, | ||
| .default_fw_path = "intel/sof", | ||
| .default_tplg_path = "intel/sof-tplg", | ||
| .nocodec_fw_filename = "sof-jsl.ri", |
There was a problem hiding this comment.
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.
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.