-
Notifications
You must be signed in to change notification settings - Fork 349
[WIP][RFC] add enum control to topology and test multiple controls with iir #3396
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
3 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| dnl ENUM_CHANNEL(name, reg, shift) | ||
| define(`ENUM_CHANNEL', | ||
| `channel.STR($1) {' | ||
| ` reg STR($2)' | ||
| ` shift STR($3)' | ||
| ` }') | ||
|
|
||
|
|
||
| dnl CONTROLENUM_OPS(info, comment, get, put) | ||
| define(`CONTROLENUM_OPS', | ||
| `ops."ctl" {' | ||
| ` info STR($1)' | ||
| ` #$2' | ||
| ` get STR($3)' | ||
| ` put STR($4)' | ||
| ` }') | ||
|
|
||
| dnl CONTROLENUM_LIST(name, enums_list) | ||
| define(`CONTROLENUM_LIST', | ||
| `SectionText.STR($1) {' | ||
| ` values [' | ||
| ` $2' | ||
| ` ]' | ||
| `}') | ||
|
|
||
| dnl C_CONTROLENUM(name, index, ops, ops, enums) | ||
| define(`C_CONTROLENUM', | ||
| `SectionControlEnum.STR($1) {' | ||
| `' | ||
| ` # control belongs to this index group' | ||
| ` index STR($2)' | ||
| `' | ||
| ` # enum values as text' | ||
| ` texts STR($3)' | ||
| `' | ||
| ` # channel register and shift for Front Left/Right' | ||
| ` $4' | ||
| `' | ||
| ` # control uses bespoke driver get/put/info ID for io ops' | ||
| ` $5' | ||
| `}') |
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 |
|---|---|---|
|
|
@@ -60,6 +60,9 @@ define(`W_EQ_IIR', | |
| ` bytes [' | ||
| $6 | ||
| ` ]' | ||
| ` enum [' | ||
| $7 | ||
| ` ]' | ||
| `}') | ||
|
|
||
| divert(0)dnl | ||
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 |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ include(`dai.m4') | |
| include(`pipeline.m4') | ||
| include(`bytecontrol.m4') | ||
| include(`mixercontrol.m4') | ||
| include(`enumcontrol.m4') | ||
| include(`eq_iir.m4') | ||
|
|
||
| define(`PGA_NAME', Dmic0) | ||
|
|
@@ -61,6 +62,7 @@ W_DATA(DEF_PGA_CONF, DEF_PGA_TOKENS) | |
| define(DEF_EQIIR_COEF, concat(`eqiir_coef_', PIPELINE_ID)) | ||
| define(DEF_EQIIR_PRIV, concat(`eqiir_priv_', PIPELINE_ID)) | ||
|
|
||
| define(DEF_EQIIR_ENUM, concat(`eqiir_enum_', PIPELINE_ID)) | ||
| # By default, use 40 Hz highpass response with +0 dB gain for 48khz | ||
| # TODO: need to implement middle level macro handler per pipeline | ||
| ifdef(`DMICPROC_FILTER1', , `define(DMICPROC_FILTER1, eq_iir_coef_highpass_40hz_0db_48khz.m4)') | ||
|
|
@@ -79,6 +81,17 @@ C_CONTROLBYTES(DEF_EQIIR_COEF, PIPELINE_ID, | |
| , | ||
| DEF_EQIIR_PRIV) | ||
|
|
||
| # EQ enum list | ||
| CONTROLENUM_LIST(eq_preset, LIST(` ', `"preset1"', `"preset2"')) | ||
|
Collaborator
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. This would be better as DEF_EQ_PRESET with pipeline number appended to eq_preset_. The enum items count seems to grow with number of instances. |
||
|
|
||
| # EQ enum control | ||
| C_CONTROLENUM(DEF_EQIIR_ENUM, PIPELINE_ID, | ||
| eq_preset, | ||
| LIST(` ', ENUM_CHANNEL(FL, 3, 0), ENUM_CHANNEL(FR, 3, 1)), | ||
| CONTROLENUM_OPS(enum, | ||
| 257 binds the mixer control to enum get/put handlers, | ||
| 257, 257)) | ||
|
|
||
| # | ||
| # Components and Buffers | ||
| # | ||
|
|
@@ -94,7 +107,7 @@ W_PGA(0, PIPELINE_FORMAT, 2, 2, DEF_PGA_CONF, SCHEDULE_CORE, | |
|
|
||
| # "EQ 0" has 2 sink period and x source periods | ||
| W_EQ_IIR(0, PIPELINE_FORMAT, 2, DAI_PERIODS, SCHEDULE_CORE, | ||
| LIST(` ', "DEF_EQIIR_COEF")) | ||
| LIST(` ', "DEF_EQIIR_COEF"), LIST(` ', "DEF_EQIIR_ENUM")) | ||
|
|
||
| # Capture Buffers | ||
| W_BUFFER(0, COMP_BUFFER_SIZE(2, | ||
|
|
||
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.
Minor, this could be undefined in the end of macro.