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

drivers: wm8904: Fix audio input configuration #85736

Merged

Conversation

VitekST
Copy link
Contributor

@VitekST VitekST commented Feb 13, 2025

A few bugs in the wm8904 codec driver prevent correct audio input configuration, namely input volume and mute settings. Thus change erroneous mask in wm8904_volume_config, extend WM8904_REGVAL_INSEL and unflip register mask and value parameters.

Related to #77814, marking it as a prerequisite.

Change erroneous mask in wm8904_volume_config. Extend
WM8904_REGVAL_INSEL. Unflip register mask and value parameters.

Signed-off-by: Vit Stanicek <[email protected]>
@kartben kartben added the bug The issue is a bug, or the PR is fixing a bug label Feb 18, 2025
@kartben kartben added this to the v4.1.0 milestone Feb 18, 2025
@@ -102,7 +102,7 @@
* [1:0] - x_MODE: Input mode
*/
#define WM8904_REGVAL_INSEL(cm, nin, pin, mode) \
(((cm) & 0b1) << 6) | (((nin) & 0b11) << 4)
(((cm) & 0b1) << 6) | (((nin) & 0b11) << 4) | (((pin) & 0b11) << 2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly related to your change of course, but binary literals should be avoided in Zephyr
https://docs.zephyrproject.org/latest/contribute/style/code.html

Copy link
Contributor Author

@VitekST VitekST Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kartben Thanks, noted. I'm surprised that the PR introducing this driver went through, though: #75943

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the guideline is a SHOULD, not a MUST, but yeah...

@kartben kartben merged commit 5a31ac1 into zephyrproject-rtos:main Feb 18, 2025
30 checks passed
@VitekST VitekST deleted the bugfix/wm8904-input-config branch February 27, 2025 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Audio bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants