-
Notifications
You must be signed in to change notification settings - Fork 140
Mt8186 pcm #3733
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
Mt8186 pcm #3733
Changes from all commits
2d6725f
b5f90df
86fef5b
fe92905
74ecbb6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -522,6 +522,15 @@ snd_sof_set_mach_params(struct snd_soc_acpi_mach *mach, | |
| sof_ops(sdev)->set_mach_params(mach, sdev); | ||
| } | ||
|
|
||
| static inline struct snd_sof_of_mach * | ||
| snd_sof_of_machine_select(struct snd_sof_dev *sdev) | ||
| { | ||
| if (sof_ops(sdev) && sof_ops(sdev)->of_machine_select) | ||
| return sof_ops(sdev)->of_machine_select(sdev); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand the definitions at all. In the DT world, the machine is already described with a device, which will be matched with a driver already. What does 'of_machine_select' mean in this context?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you mean 'a machine is already described with a device using device tree, right?'. Device tree describes the hardware, while we need information like machine driver name, tplg name, firmware name which according to Mark cannot be placed inside a DT node. |
||
|
|
||
| return NULL; | ||
| } | ||
|
|
||
| /** | ||
| * snd_sof_dsp_register_poll_timeout - Periodically poll an address | ||
| * until a condition is met or a timeout occurs | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |
| #include <sound/pcm_params.h> | ||
| #include <sound/sof.h> | ||
| #include <trace/events/sof.h> | ||
| #include "sof-of-dev.h" | ||
| #include "sof-priv.h" | ||
| #include "sof-audio.h" | ||
| #include "sof-utils.h" | ||
|
|
@@ -654,7 +655,12 @@ void snd_sof_new_platform_drv(struct snd_sof_dev *sdev) | |
| struct snd_sof_pdata *plat_data = sdev->pdata; | ||
| const char *drv_name; | ||
|
|
||
| drv_name = plat_data->machine->drv_name; | ||
| if (plat_data->machine) | ||
| drv_name = plat_data->machine->drv_name; | ||
| else if (plat_data->of_machine) | ||
| drv_name = plat_data->of_machine->drv_name; | ||
| else | ||
| drv_name = NULL; | ||
|
||
|
|
||
| pd->name = "sof-audio-component"; | ||
| pd->probe = sof_pcm_probe; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,8 +9,16 @@ | |
| #ifndef __SOUND_SOC_SOF_OF_H | ||
| #define __SOUND_SOC_SOF_OF_H | ||
|
|
||
| struct snd_sof_of_mach { | ||
| const char *board; | ||
| const char *drv_name; | ||
| const char *fw_filename; | ||
| const char *sof_tplg_filename; | ||
|
||
| }; | ||
|
|
||
| extern const struct dev_pm_ops sof_of_pm; | ||
|
|
||
| struct snd_sof_of_mach *sof_of_machine_select(struct snd_sof_dev *sdev); | ||
| int sof_of_probe(struct platform_device *pdev); | ||
| int sof_of_remove(struct platform_device *pdev); | ||
| void sof_of_shutdown(struct platform_device *pdev); | ||
|
|
||
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.
grammar in commit message
a chance for the machines which are not based on ACPI, this callback
is optional, each machine that is not based on ACPI can implement
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 do you think it makes better sense to make the machine field const void * in snd_sof_pdata and resolve it to either snd_soc_acpi_mach or and_sof_of_mach in the platform dependent code?
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.
possibly, but it's not clear to me by the DT/OF machines need something in the kernel when everything is already described in platform firmware. That's the big difference between DT/OF and ACPI, in ACPI we do not have a device entry for the machine driver, so we do all this machine driver selection. It's not needed for DT/OF, so it's really questionable why we would build on something that was a work-around ACPI limitations.
Uh oh!
There was an error while loading. Please reload this page.
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 @ranj063 , Sorry for confusion.
If we do not implement the machine_select callback the sof_machine_check will return -ENODEV. what we actually want is do not return error since we don't need machine_select with DT/OF machines. What's more the sof_machine_select not just checking ACPI machine, but also assign sof_tplg_filename at the same time. Do you have any ideal how to handle this?
Uh oh!
There was an error while loading. Please reload this page.
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 that is indeed a valid question. We need to find the ACPI machine and register it in sof_machine_register(). Without the need to explicitly register the machine driver, I cant explain what the need for change for OF devices would be for. @dbaluta any ideas?
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.
Hi @ranj063 @plbossart @dbaluta The 'ACPI machine' should be selected before register by
sof_machine_register, then it looks like themachine_selectandmachine_registershould use at the same time when using ACPI machine.How about
machine_select?or
1.check whether the machine_register is implement or not, if the
machine_registeris implemented then the machine must be checked before register.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,
From devicetree people comment, it's not ok we put fw/tplg filenames in DT. I think ACPI and DT are different specifications and it's not a work-around.
We need find a way for sof_machine_check func.
Please let me know if you have any comments. thanks.