forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 132
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
board_helper: support amp link #4666
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1eb9fed
ASoC: Intel: board_helpers: support amp link initialization
brentlu 0b316ea
ASoC: Intel: sof_cs42l42: use common module for amp link
brentlu d986d3a
ASoC: Intel: sof_nau8825: use common module for amp link
brentlu a0afb97
ASoC: Intel: sof_rt5682: use common module for amp link
brentlu 93cdab5
ASoC: Intel: sof_ssp_amp: use common module for amp link
brentlu 73e8cbe
ASoC: Intel: sof_ssp_amp: rename function parameter
brentlu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -248,6 +248,48 @@ int sof_intel_board_set_intel_hdmi_link(struct device *dev, | |
} | ||
EXPORT_SYMBOL_NS(sof_intel_board_set_intel_hdmi_link, SND_SOC_INTEL_SOF_BOARD_HELPERS); | ||
|
||
int sof_intel_board_set_ssp_amp_link(struct device *dev, | ||
struct snd_soc_dai_link *link, int be_id, | ||
enum sof_ssp_codec amp_type, int ssp_amp) | ||
{ | ||
struct snd_soc_dai_link_component *cpus; | ||
|
||
dev_dbg(dev, "link %d: ssp amp %s, ssp %d\n", be_id, | ||
sof_ssp_get_codec_name(amp_type), ssp_amp); | ||
|
||
/* link name */ | ||
link->name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-Codec", ssp_amp); | ||
if (!link->name) | ||
return -ENOMEM; | ||
|
||
/* cpus */ | ||
cpus = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link_component), | ||
GFP_KERNEL); | ||
if (!cpus) | ||
return -ENOMEM; | ||
|
||
cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d Pin", ssp_amp); | ||
if (!cpus->dai_name) | ||
return -ENOMEM; | ||
|
||
link->cpus = cpus; | ||
link->num_cpus = 1; | ||
|
||
/* codecs - caller to handle */ | ||
|
||
/* platforms */ | ||
link->platforms = platform_component; | ||
link->num_platforms = ARRAY_SIZE(platform_component); | ||
|
||
link->id = be_id; | ||
link->no_pcm = 1; | ||
link->dpcm_capture = 1; /* feedback stream or firmware-generated echo reference */ | ||
link->dpcm_playback = 1; | ||
|
||
return 0; | ||
} | ||
EXPORT_SYMBOL_NS(sof_intel_board_set_ssp_amp_link, SND_SOC_INTEL_SOF_BOARD_HELPERS); | ||
|
||
MODULE_DESCRIPTION("ASoC Intel SOF Machine Driver Board Helpers"); | ||
MODULE_AUTHOR("Brent Lu <[email protected]>"); | ||
MODULE_LICENSE("GPL"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Hmm, where will
ctx->ssp_amp
be used?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 planned to submit another PR later which implements a helper function to generate entire DAI link array according to the content of sof_card_private structure. You could check the code here:
brentlu@e259c8a