-
Notifications
You must be signed in to change notification settings - Fork 134
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
ASoC: SOF: mediatek: Add machine driver dsp ops for mt8195 platform #3239
ASoC: SOF: mediatek: Add machine driver dsp ops for mt8195 platform #3239
Conversation
{ | ||
struct snd_sof_pdata *sof_pdata = sdev->pdata; | ||
struct snd_soc_acpi_mach *mach; | ||
|
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.
My only concern here is that we aren't really using ACPI right?
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.
yes, I don't use acpi and don't provide id for it.
/* machine driver */ | ||
.machine_select = mt8195_machine_select, | ||
.machine_register = sof_machine_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.
same comment as @dbaluta, in theory you should have a device tree device for the machine driver?
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.
machine driver name "mt8195_mt6359_rt1019_rt5682" is defined in
(1). https://patchwork.kernel.org/project/linux-mediatek/patch/20210819084144.18483-9-trevor.wu@mediatek.com/
(2). for non-sof device tree binding :
https://patchwork.kernel.org/project/linux-mediatek/patch/20210818103215.9186-12-trevor.wu@mediatek.com/
(3). for sof dsp device tree binding :
https://patchwork.kernel.org/project/linux-mediatek/patch/20211025105635.30625-3-yc.hung@mediatek.com/
Thanks.
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.
if you specify a driver for the machine, the SOF core will create a platform device.
But if you also have a DT binding for the machine driver, then you will create a second platform device, no?
Something seems wrong here?
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 Sorry for confusion, currently we only use SOF core to create platform device for machine (dts binding is item (3) above.). We use mt8195_machine_select to get driver name then create it. We don't use device tree binding for "mt8195_mt6359_rt1019_rt5682" for SOF,
item(3)
adsp: adsp@10803000 {
compatible = "mediatek,mt8195-dsp";
...
sound {
mediatek,dptx-codec = <&dp_tx>;
mediatek,hdmi-codec = <&hdmi0>;
mediatek,platform = <&afe>;
};
The non-sof device tree binding(item (2) above) is used without SOF support and it will create platform device via device tree. Thanks.
item(2)
sound: mt8195-sound {
compatible = "mediatek,mt8195_mt6359_rt1019_rt5682";
mediatek,platform = <&afe>;
pinctrl-names = "default";
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.
Sorry @yaochunhung I am really confused. In previous PRs you described how the same card can include SOF and non-SOF managed streams. But above you seem to describe a case where the card is created in two different ways.
I don't get how this might work.
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.
@ujfalusi Thanks for your detail descriptions. I will base on your suggestion to modify the DSP node as property of sound card node as below,
&sound {
pinctrl-names = "default";
pinctrl-0 = <&aud_pins_default>;
mediatek,adsp = <&adsp>;
mediatek,platform =<&afe>;
status = "okay";
}
where adsp is DSP node for dsp driver and afe is regular(non-sof) node for regular platform driver. Therefore, machine register won't be needed in this patch. But I still keep the machine_select to get sof_tplg_filename. Please feel free to tell me if I am misunderstanding. The machine driver code is in the link https://patchwork.kernel.org/project/linux-mediatek/patch/20211129141057.12422-4-trevor.wu@mediatek.com . Thanks.
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.
@ujfalusi @plbossart Thanks for review. The machine driver is applied to mark/for-next branch as the link https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/?id=3d00d2c07f04f47aa4228700b440ac47abf13853. Please help to check if you have any concern or suggestions about this PR. Thanks.
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.
I agree with @dbaluta and @plbossart that the machine_select
should not be used, but you should be using the of match data in a similar way iMX is doing.
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.
@dbaluta I check this function sof_machine_check and snd_sof_machine_select should return mach to avoid fail. Could you please advice how to avoid it without providing machine_select callback on iMX? Otherwise, I think sof_tplg_filename is also needed, but I don't know how to assign it without call machine_select . Thanks.
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.
@yaochunhung I think this might be useful. https://www.spinics.net/lists/devicetree/msg433908.html
But I hit a roadblock and didn't get a chance to find a better solution.
I think for now at least we can have a default_tplg_filename in sof_dev_desc and select it based on probed platform.
f36194f
to
803ee10
Compare
struct snd_soc_acpi_mach *mach; | ||
|
||
mach = &sof_mt8195_mach; | ||
if (!mach) { |
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.
this is impossible - as long as sof_mt8195_mach
is a "normal real" object
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.
@lyakh Thanks. I will remove it.
Add dsp ops callback to machine select to get sof topolgy file name Signed-off-by: YC Hung <yc.hung@mediatek.com>
803ee10
to
e5c7d59
Compare
@plbossart @ujfalusi @lyakh Thanks for review, please help to check if there are any suggestions or concerns about this PR. Thanks a lot. |
@plbossart @ujfalusi @lyakh @dbaluta Friendly reminders. Do you have a chance to look at this patch and give comments if any? Thanks a lot. |
/* machine driver */ | ||
.machine_select = mt8195_machine_select, | ||
.machine_register = sof_machine_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.
I agree with @dbaluta and @plbossart that the machine_select
should not be used, but you should be using the of match data in a similar way iMX is doing.
@yaochunhung is this still relevant? Last update was in January 2022. |
@plbossart |
@chunxu-li, but how iMX is working? Is it using nocodec? @dbaluta, can you clarify this? |
@ujfalusi I think @dbaluta provide IMX's solution like #3239 (comment). Thanks. |
@yaochunhung this PR has been marked as 'Unclear' for several weeks. Unless there's an update and/or a need for comments, we should close this PR. You can always resubmit a new one later, it's just not efficient to leave such PRs dangling without any progress. |
@plbossart I will close this PR. Thanks |
Hi,
This patch is to support dsp ops callback to select and register machine driver.