-
Notifications
You must be signed in to change notification settings - Fork 133
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
AMD SOF based generic SoundWire machine driver #5068
Conversation
cf9e1a3
to
d897ebf
Compare
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 to me @vijendarmukunda
I only have minor comments, time for others to comment as well. @bardliao @charleskeepax on your mark, set, go!
d897ebf
to
8fcde28
Compare
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.
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!
SOFCI TEST |
8fcde28
to
96ccec8
Compare
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. |
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
…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]>
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]>
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]>
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]>
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]>
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]>
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]>
This patch series is rebase version of PR#5034