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

AMD SOF based generic SoundWire machine driver #5068

Merged
merged 31 commits into from
Jul 5, 2024

Conversation

vijendarmukunda
Copy link

This patch series is rebase version of PR#5034

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 to me @vijendarmukunda

I only have minor comments, time for others to comment as well. @bardliao @charleskeepax on your mark, set, go!

sound/soc/sdw_utils/soc_sdw_rt712_sdca.c Outdated Show resolved Hide resolved
sound/soc/sof/amd/Kconfig Show resolved Hide resolved
sound/soc/amd/acp/soc_amd_sdw_common.h Outdated Show resolved Hide resolved
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.

The last patch needs a bit more work IMHO, still too much duplication of complicated code that we don't want to fork.

The rest looks ok, thanks!

sound/soc/amd/acp/acp-sdw-sof-mach.c Show resolved Hide resolved
sound/soc/amd/acp/soc_amd_sdw_common.h Outdated Show resolved Hide resolved
sound/soc/amd/acp/acp-sdw-sof-mach.c Outdated Show resolved Hide resolved
sound/soc/amd/acp/acp-sdw-sof-mach.c Show resolved Hide resolved
sound/soc/amd/acp/acp-sdw-sof-mach.c Show resolved Hide resolved
sound/soc/amd/acp/acp-sdw-sof-mach.c Show resolved Hide resolved
sound/soc/amd/acp/acp-sdw-sof-mach.c Outdated Show resolved Hide resolved
sound/soc/amd/acp/acp-sdw-sof-mach.c Outdated Show resolved Hide resolved
sound/soc/amd/acp/acp-sdw-sof-mach.c Show resolved Hide resolved
sound/soc/amd/acp/acp-sdw-sof-mach.c Show resolved Hide resolved
@plbossart
Copy link
Member

SOFCI TEST

@vijendarmukunda
Copy link
Author

vijendarmukunda commented Jun 25, 2024

The last patch needs a bit more work IMHO, still too much duplication of complicated code that we don't want to fork.

The rest looks ok, thanks!

Agreed. We are going to refactor the code . We need to add support for newer ACP variants. We are going to add support for legacy (NO DSP) machine driver support where we are going to refactor existing code.
We would like to implement as an incremental patch series.

To make it generic, rename structure 'sof_sdw_codec_info' as
'asoc_sdw_codec_info' and 'sof_sdw_dai_info' as 'asoc_sdw_dai_info'.
These structures will be moved to common header file so that it can
be used by other platform machine driver.

Signed-off-by: Vijendar Mukunda <[email protected]>
Rename sof quirk macros, dai type and dai link macros with "SOC_SDW" tag.

Signed-off-by: Vijendar Mukunda <[email protected]>
Rename Soundwire generic machine driver soc ops with tag "asoc".

Signed-off-by: Vijendar Mukunda <[email protected]>
Rename SoundWire codec helper functions with "asoc_sdw" tag.

Signed-off-by: Vijendar Mukunda <[email protected]>
Rename maxim codec part id macros.

Signed-off-by: Vijendar Mukunda <[email protected]>
Rename 'ignore_pch_dmic' variable name as 'ignore_internal_dmic'.
This variable will be moved to common header file and will be used by other
platform machine driver code.

Signed-off-by: Vijendar Mukunda <[email protected]>
Move Intel SoundWire generic machine driver soc ops to common place
so that it can be used by other platform machine driver.

Signed-off-by: Vijendar Mukunda <[email protected]>
Move intel generic SoundWire machine driver common structures to
soc_sdw_utils.h file. These structures will be used in other platform
SoundWire machine driver code.

Signed-off-by: Vijendar Mukunda <[email protected]>
Move below Intel SoundWire machine driver helper functions to
soc_sdw_utils.c file so that it can be used by other platform machine
driver.
- asoc_sdw_is_unique_device()
- asoc_sdw_get_codec_name()

Signed-off-by: Vijendar Mukunda <[email protected]>
Move generic dmic codec helper function implementation to
sdw_utils folder so that this function can be used by other platform
machine drivers.

Signed-off-by: Vijendar Mukunda <[email protected]>
Move rtk SoundWire dmic helper functions implementation to sdw_utils
folder to make it generic.

Signed-off-by: Vijendar Mukunda <[email protected]>
Move RT712 SDCA codec helper file to sdw_utils folder so that these
helper functions can be used by other platform machine drivers.

Signed-off-by: Vijendar Mukunda <[email protected]>
Move RT722 SDCA codec helper file to sdw_utils folder to make it generic.

Signed-off-by: Vijendar Mukunda <[email protected]>
Split intel generic SoundWire machine driver private data into two
structures. One structure is generic one which can be used by other
platform machine driver and the other one is intel specific one.
Move generic machine driver private data to soc_sdw_utils.h.
Define a void pointer in generic machine driver private data structure
and assign the vendor specific structure in mc_probe() call.

Signed-off-by: Vijendar Mukunda <[email protected]>
Move rt5682 sdw codec helper function to common place holder to make it
generic.

Signed-off-by: Vijendar Mukunda <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Rename Soundwire generic machine driver soc ops with tag "asoc".

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Rename SoundWire codec helper functions with "asoc_sdw" tag.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Rename maxim codec part id macros.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Rename 'ignore_pch_dmic' variable name as 'ignore_internal_dmic'.
This variable will be moved to common header file and will be used by other
platform machine driver code.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Move Intel SoundWire generic machine driver soc ops to common place
so that it can be used by other platform machine driver.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Move intel generic SoundWire machine driver common structures to
soc_sdw_utils.h file. These structures will be used in other platform
SoundWire machine driver code.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Move below Intel SoundWire machine driver helper functions to
soc_sdw_utils.c file so that it can be used by other platform machine
driver.
- asoc_sdw_is_unique_device()
- asoc_sdw_get_codec_name()

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Move generic dmic codec helper function implementation to
sdw_utils folder so that this function can be used by other platform
machine drivers.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Move rtk SoundWire dmic helper functions implementation to sdw_utils
folder to make it generic.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Move RT712 SDCA codec helper file to sdw_utils folder so that these
helper functions can be used by other platform machine drivers.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Move RT722 SDCA codec helper file to sdw_utils folder to make it generic.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Split intel generic SoundWire machine driver private data into two
structures. One structure is generic one which can be used by other
platform machine driver and the other one is intel specific one.
Move generic machine driver private data to soc_sdw_utils.h.
Define a void pointer in generic machine driver private data structure
and assign the vendor specific structure in mc_probe() call.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Move rt5682 sdw codec helper function to common place holder to make it
generic.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Move RTK codec jack common helper functions to common place holder
(sdw_utils folder) to make it generic so that it will be used by
other platform machine driver code.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Move RT700 and RT711 Soundwire codec helper functions to common
place holder so that it can be used by other platform machine driver.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Move RTK amp codec helper functions related implementation to common
place holder to make it generic so that these helper functions will be
used by other platform machine driver modules.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
To make it generic, move Cirrus Soundwire codec helper functions to
common place holder so that it can be used by other platform machine
driver.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Move maxim codec helper functions to common place holder so that
it can be used by other platform machine driver.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Move dai id common macros from intel SoundWire generic driver to
soc_sdw_utils.h file so that it can be used by other platform machine
driver.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Move SoundWire dai type macros to common header file(soc_sdw_util.h).
So that these macros will be used by other platform machine driver.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
SoundWire 'codec_info_list' structure is not a platform specific one.
Move codec_info_list structure to common file soc_sdw_utils.c.
Move codec helper functions which uses codec_info_list structure to common
place holder and rename the function by adding _sdw tag. This will allow
to use 'codec_info_list' structure and it's helper functions in other
platform machine driver.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Move machine driver dai link helper functions to common place holder,
So that it can be used by other platform machine driver.
Rename these functions with "asoc_sdw" tag as a prefix.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Refactor sof_sdw_card_late_probe() function and derive a generic
function soc_sdw_card_late_probe() function which can be used by
SoundWire generic machine driver.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
…ink()

To make it generic, refactor existing implementation for
init_dai_link() and init_simple_dai_link() as mentioned below.
- Move init_dai_link() and init_simple_dai_link() to common place holder
- Rename the functions with "asoc_sdw" as prefix.
- Pass the platform specific 'platform_component' structure and its size as
arguments for init_simple_dai_link() function and allocate one more
extra dlc for platform component.
- Pass the 'platform_component' and 'num_platforms' as arguments for
init_dai_link().

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Few IP's may have same PCI vendor id and device id and
different revision id. Add revision id field to the
'snd_soc_acpi_mach_params' so that using this field platform
specific implementation can be added in machine driver.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Add Soundwire machines for acp6.3 based platform.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Add SoundWire machines as alternate machines for acp6.3 based platform.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Add pci_rev variable in acp sof driver private data structure and assign
this value to mach_params structure subsystem_rev variable.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Add sof based Soundwire generic driver for amd platforms.
Currently support added for ACP6.3 based platforms.

Link: thesofproject#5068
Signed-off-by: Vijendar Mukunda <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
roxell pushed a commit to roxell/linux that referenced this pull request Aug 5, 2024
Merge series from Vijendar Mukunda <[email protected]>:

This patch series majorly consists of below changes.
- Rename structures, macros and codec helper names used in Intel
SoundWire generic driver to make it generic.
- Move Intel SoundWire driver common structures, macros and codec
helper functions to common placeholder so that it can be used by
other platform machine driver.
- Refactor few SoundWire common codec helper functions.
- AMD SOF based generic SoundWire machine driver for ACP 6.3 variant.

This work started a couple of months ago to avoid duplication of code
that wasn't really Intel-specific in the "sof_sdw" machine driver.
The code went through multiple iterations, was tested for multiple weeks
and a couple of build issues reported by the Intel kbuild bots were
corrected.

This is the initial version of SoundWire machine driver for AMD
platforms. Additional code refactoring will be done in the next step on
the AMD side.

Link: thesofproject#5068
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
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