forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 140
ASoC/SoundWire: parse SDCA functions to filter the RT712-VB configuration #4995
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
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
28417a7
ASoC/soundwire: remove sdw_slave_extended_id
plbossart ec18579
ASoC: sdca: add initial module
plbossart 591b2de
soundwire: slave: parse SDCA function mask and revision
plbossart 00ac11f
ASoC: SDCA: add quirk function for RT712_VB match
plbossart a343d0e
ASoC: soc-acpi: introduce new 'machine check' callback
plbossart e997059
ASoC: Intel: soc-acpi: add is_device_rt712_vb() helper
plbossart b4e8dda
ASoC: SOF: Intel: hda: use machine_quirk() for SoundWire
plbossart a037045
ASoC: Intel: sof_sdw: add SmartMic DAI for RT712 VB
plbossart 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ | ||
| /* | ||
| * The MIPI SDCA specification is available for public downloads at | ||
| * https://www.mipi.org/mipi-sdca-v1-0-download | ||
| * | ||
| * Copyright(c) 2024 Intel Corporation | ||
| */ | ||
|
|
||
| #ifndef __SDCA_H__ | ||
| #define __SDCA_H__ | ||
|
|
||
| struct sdw_slave; | ||
|
|
||
| /** | ||
| * sdca_device_data - structure containing all SDCA related information | ||
| * @sdca_interface_revision: value read from _DSD property, mainly to check | ||
| * for changes between silicon versions | ||
| * @sdca_function_mask: shortcut to list all SDCA functions with a bitmask | ||
| */ | ||
| struct sdca_device_data { | ||
| u32 interface_revision; | ||
| u32 function_mask; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note to self: this function_mask assumed that there is only ONE type of function type per codec. The spec says otherwise, it's permitted to have multiple instances of the same function type, except for HID. That means we need an array of (ADR, function_type) pairs. |
||
| }; | ||
|
|
||
| enum sdca_quirk { | ||
| SDCA_QUIRKS_RT712_VB, | ||
| }; | ||
|
|
||
| #if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_SND_SOC_SDCA) | ||
|
|
||
| void sdca_lookup_function_mask(struct sdw_slave *slave); | ||
| void sdca_lookup_interface_revision(struct sdw_slave *slave); | ||
| bool sdca_device_quirk_match(struct sdw_slave *slave, enum sdca_quirk quirk); | ||
|
|
||
| #else | ||
|
|
||
| static inline void sdca_lookup_function_mask(struct sdw_slave *slave) {} | ||
| static inline void sdca_lookup_interface_revision(struct sdw_slave *slave) {} | ||
| static inline bool sdca_device_quirk_match(struct sdw_slave *slave, enum sdca_quirk quirk) | ||
| { | ||
| return false; | ||
| } | ||
| #endif | ||
|
|
||
| #endif | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ | ||
| /* | ||
| * The MIPI SDCA specification is available for public downloads at | ||
| * https://www.mipi.org/mipi-sdca-v1-0-download | ||
| * | ||
| * Copyright(c) 2024 Intel Corporation | ||
| */ | ||
|
|
||
| #ifndef __SDCA_FUNCTION_H__ | ||
| #define __SDCA_FUNCTION_H__ | ||
|
|
||
| #define SDCA_MAX_FUNCTION_COUNT 8 | ||
|
|
||
| /* | ||
| * SDCA Function Types from SDCA specification v1.0a Section 5.1.2 | ||
| * all Function types not described are reserved | ||
| * Note that SIMPLE_AMP, SIMPLE_MIC and SIMPLE_JACK Function Types | ||
| * are NOT defined in SDCA 1.0a, but they were defined in earlier | ||
| * drafts and are planned for 1.1. | ||
| */ | ||
|
|
||
| enum sdca_function_type { | ||
| SDCA_FUNCTION_TYPE_SMART_AMP = 0x01, /* Amplifier with protection features */ | ||
| SDCA_FUNCTION_TYPE_SIMPLE_AMP = 0x02, /* subset of SmartAmp */ | ||
| SDCA_FUNCTION_TYPE_SMART_MIC = 0x03, /* Smart microphone with acoustic triggers */ | ||
| SDCA_FUNCTION_TYPE_SIMPLE_MIC = 0x04, /* subset of SmartMic */ | ||
| SDCA_FUNCTION_TYPE_SPEAKER_MIC = 0x05, /* Combination of SmartMic and SmartAmp */ | ||
| SDCA_FUNCTION_TYPE_UAJ = 0x06, /* 3.5mm Universal Audio jack */ | ||
| SDCA_FUNCTION_TYPE_RJ = 0x07, /* Retaskable jack */ | ||
| SDCA_FUNCTION_TYPE_SIMPLE_JACK = 0x08, /* Subset of UAJ */ | ||
| SDCA_FUNCTION_TYPE_HID = 0x0A, /* Human Interface Device, for e.g. buttons */ | ||
| SDCA_FUNCTION_TYPE_IMP_DEF = 0x1F, /* Implementation-defined function */ | ||
| }; | ||
|
|
||
| enum sdca_entity0_controls { | ||
| SDCA_CONTROL_ENTITY_0_COMMIT_GROUP_MASK = 0x01, | ||
| SDCA_CONTROL_ENTITY_0_INTSTAT_CLEAR = 0x02, | ||
| SDCA_CONTROL_ENTITY_0_INT_ENABLE = 0x03, | ||
| SDCA_CONTROL_ENTITY_0_FUNCTION_SDCA_VERSION = 0x04, | ||
| SDCA_CONTROL_ENTITY_0_FUNCTION_TOPOLOGY = 0x05, | ||
| SDCA_CONTROL_ENTITY_0_FUNCTION_MANUFACTURER_ID = 0x06, | ||
| SDCA_CONTROL_ENTITY_0_FUNCTION_ID = 0x07, | ||
| SDCA_CONTROL_ENTITY_0_FUNCTION_VERSION = 0x08 | ||
| }; | ||
|
|
||
| #endif |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.