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 SoundWire SOF based generic machine driver #4967

Conversation

vijendarmukunda
Copy link

@vijendarmukunda vijendarmukunda commented May 2, 2024

This PR has been created after resolving merge conflicts and revised versions of below pull requests.
#4916
#4817
#4955
#4959

As mentioned earlier, We are going to work on legacy (NO DSP enabled) soundwire generic driver for AMD platforms.
We are going to address further simplifying DAI parsing logic as a separate PR.

This PR is targeted to provide initial version SoundWire machine driver for AMD platforms.

Changes from V3:

  • No user visible option for "SND_SOC_SDW_UTILS" Kconfig
  • Use naming consistency for all the export functions by adding tag "asoc_sdw" as a prefix
  • Drop NO_AGGREGATION quirk support in AMD SoundWire generic machine driver.
  • Fixed indentation issue for comment in AMD SoundWire generic machine driver.
  • Fixed typo error in commit message

Changes from v2:

  • code rebase

Changes from V1:

Moved all SoundWire codec helper functions to sdw_utils folder.
Updated copyright statement
Moved codec_info_list structure and its corresponding helper functions.
Moved common Soundwire codec helper functions.
Moved Machine driver dai link helper functions.
Refactored late probe() function
Add pci revision id field in mach_params structure and used it in amd sof driver stack.
Rename all common functions with _sdw tag.
Rename structure names and macros to make it generic.

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 <Vijendar.Mukunda@amd.com>
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.
Rename macro 'SOF_SDW_MAX_DAI_NUM' as 'SOC_SDW_MAX_DAI_NUM'.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Rename 'ignore_pch_dmic' variable name as 'ignore_internal_dmic' to make
it more generic across different platforms to represent internal dmic.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
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.
- is_unique_device()
- get_codec_name()
- get_codec_dai_by_name()
Rename the functions by adding 'asoc_sdw' tag as a prefix.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Move generic dmic codec helper functions implementation to
sdw_utils folder so that these functions can be used by other platform
machine drivers.
Rename the helper function 'sof_sdw_dmic_init' as 'asoc_sdw_dmic_init'
as this helper function will be used by SOF and legacy(No DSP) stacks.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Move rtk SoundWire dmic helper functions implementation to sdw_utils
folder to make it generic. Rename dmic helper functions by adding
'asoc_sdw' as prefix.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Move RT712 SDCA codec helper file to sdw_utils folder.
Rename 'rt712_spk_rtd_init' function as 'asoc_sdw_rt712_spk_rtd_init'.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Move RT722 SDCA codec helper file to sdw_utils folder to make it generic.
Rename helper function with 'asoc_sdw' tag.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
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 <Vijendar.Mukunda@amd.com>
Move rt5682 sdw codec helper functions to common place holder to make it
generic. Rename 'rt5682_rtd_init' function as 'asoc_sdw_rt5682_rtd_init'.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
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.
Rename codec helper functions by adding 'asoc_sdw' tag.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Move RT700 and RT711 Soundwire codec helper functions to common
place holder so that it can be used by other platform machine driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
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.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
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. Rename the codec helper functions.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Move maxim codec helper functions to common place holder so that
it can be used by other platform machine driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
To make it generic, rename structure 'sof_sdw_codec_info' as
'soc_sdw_codec_info' and 'sof_sdw_dai_info' as 'soc_sdw_dai_info'.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
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. Rename macros with 'ASOC' as prefix.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Move SoundWire dai type macros to common header file(soc_sdw_util.h) and
rename the macros to make it generic. It will be used by other platform
machine driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
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.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Move machine driver dai link helper functions to common place holder,
so that it can be used by other platform machine driver.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
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.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
To make it generic, rename amp codec quirk macros.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
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.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Add Soundwire machines for acp6.3 based platform.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Add SoundWire machines as alternate machines for acp6.3 based platform.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Add pci_rev variable in acp sof driver private data structure and assign
this value to mach_params structure subsystem_rev variable.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Add sof based Soundwire generic driver for amd platforms.
Currently support added for ACP6.3 based platforms.

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
@plbossart
Copy link
Member

@vijendarmukunda we need to give the priority to #4968 to real with RT712 configurations. Once it's merged we'll need to review this one in depth and submit in the next kernel cycle. We're at rc-6, so the next merge window tentatively opens in 4 weeks, that's a good time window to do all the changes.

@vijendarmukunda
Copy link
Author

@vijendarmukunda we need to give the priority to #4968 to real with RT712 configurations. Once it's merged we'll need to review this one in depth and submit in the next kernel cycle. We're at rc-6, so the next merge window tentatively opens in 4 weeks, that's a good time window to do all the changes.

Agreed.

intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this pull request May 10, 2024
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

This patchset should be the last batch for this kernel cycle!

Brent Lu continued his cleanups to refactor and use fewer machine
drivers on Chrmebooks.

Bard Liao updated the sof-sdw machine driver to deal with UCM support
of the RT712 configuration. Note that this sof-sdw driver will be
refactored in the next kernel cycle to allow AMD and others to reuse
common SoundWire parts that are not Intel-specific. Initial changes
are described here: thesofproject#4967
@vijendarmukunda
Copy link
Author

will close this PR and open new PR after rebase on top of #4968 changes

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.

None yet

2 participants