-
Notifications
You must be signed in to change notification settings - Fork 105
[Deepin-Kernel-SIG] [linux 6.12-y] [Upstream] ALSA: hda: cs35l41: Support Lenovo Thinkbook 13x Gen 5 #1396
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
[Deepin-Kernel-SIG] [linux 6.12-y] [Upstream] ALSA: hda: cs35l41: Support Lenovo Thinkbook 13x Gen 5 #1396
Conversation
This laptop does not contain _DSD so needs to be supported using the configuration table. Signed-off-by: Bou-Saan Che <yungmeat@inboxia.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> (cherry picked from commit f205ed2) Signed-off-by: Cryolitia <cryolitia@deepin.org>
The laptop does not contain valid _DSD for these amps, so requires entries into the CS35L41 configuration table to function correctly. Signed-off-by: Bou-Saan Che <yungmeat@inboxia.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> (cherry picked from commit c1d3189) Signed-off-by: Cryolitia <cryolitia@deepin.org>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds Lenovo Thinkbook 13x Gen 5 support to the CS35L41 HDA configuration and Realtek ALC287 quirk handling so that the correct amplifier and codec fixups are applied for this hardware. Flow diagram for CS35L41 HDA configuration lookup for Thinkbook13xGen5flowchart TD
Start[Codec probe for CS35L41] --> ReadIDs[Read ACPI HID and subsystem ID]
ReadIDs --> CheckHID{ACPI HID CSC3551?}
CheckHID -->|No| EndNoMatch[No CS35L41 property model applied]
CheckHID -->|Yes| LookupPropModel[Lookup in cs35l41_prop_model_table]
LookupPropModel --> CheckSubsys{Subsystem ID 17AA3929 or 17AA392B?}
CheckSubsys -->|No| EndNoMatch
CheckSubsys -->|Yes| ApplyGenericDSD[Apply generic_dsd_config]
ApplyGenericDSD --> LookupConfig[Lookup in cs35l41_config_table]
LookupConfig --> MatchConfig[Find entry with 17AA3929 or 17AA392B]
MatchConfig --> ApplyRouting[Configure 4 INTERNAL amps
with RIGHT LEFT RIGHT LEFT
and timing 1000 4500 24]
ApplyRouting --> End[CS35L41 configured for Thinkbook13xGen5]
Flow diagram for Realtek ALC287 quirk selection for Thinkbook13xGen5flowchart TD
Start[HDA codec probe] --> DetectCodec[Detect Realtek codec]
DetectCodec --> CheckCodec{Codec is ALC287?}
CheckCodec -->|No| EndOther[Use generic handling]
CheckCodec -->|Yes| ReadPCI[Read PCI vendor and device IDs]
ReadPCI --> CheckVendor{Vendor ID 0x17aa?}
CheckVendor -->|No| EndOther
CheckVendor -->|Yes| LookupQuirk[Search alc269_fixup_tbl]
LookupQuirk --> CheckDevice{Device ID 0x3929 or 0x392b?}
CheckDevice -->|No| EndOther
CheckDevice -->|Yes| ApplyFixup[Apply ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD]
ApplyFixup --> End[ALC287 configured for
Thinkbook13xGen5 with CS35L41 amp]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review我来对这个diff进行审查:
改进建议:
#define THINKPAD_4SPK_CONFIG INTERNAL, { CS35L41_RIGHT, CS35L41_LEFT, CS35L41_RIGHT, CS35L41_LEFT }, 0, 2, -1, 1000, 4500, 24总的来说,这是一个合理的补丁,添加了新的ThinkBook型号支持,代码质量良好,没有明显问题。 |
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.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `sound/pci/hda/patch_realtek.c:11291-11292` </location>
<code_context>
SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC),
SND_PCI_QUIRK(0x17aa, 0x391f, "Yoga S990-16 pro Quad YC Quad", ALC287_FIXUP_TAS2781_I2C),
SND_PCI_QUIRK(0x17aa, 0x3920, "Yoga S990-16 pro Quad VECO Quad", ALC287_FIXUP_TAS2781_I2C),
+ SND_PCI_QUIRK(0x17aa, 0x3929, "Thinkbook 13x Gen 5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
+ SND_PCI_QUIRK(0x17aa, 0x392b, "Thinkbook 13x Gen 5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
</code_context>
<issue_to_address>
**nitpick (typo):** Consider aligning product name capitalization with Lenovo's "ThinkBook" branding.
Lenovo’s official branding uses “ThinkBook” with a capital B. It may be worth updating these strings for consistency and easier grepping, unless DMI/marketing sources for this exact model intentionally use “Thinkbook” as shown.
```suggestion
SND_PCI_QUIRK(0x17aa, 0x3929, "ThinkBook 13x Gen 5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
SND_PCI_QUIRK(0x17aa, 0x392b, "ThinkBook 13x Gen 5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: opsiff The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Pull request overview
This PR adds hardware support for CS35L41 HDA audio amplifiers on Lenovo ThinkBook 13x Gen 5 systems by registering device-specific configuration entries and quirks.
- Adds quirk entries to wire ThinkBook 13x Gen 5 models (device IDs 0x3929 and 0x392b) with CS35L41 I2C audio path
- Registers CS35L41 codec configuration for 4-amp internal setup with appropriate boost parameters
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| sound/pci/hda/patch_realtek.c | Adds two ALC287 quirk entries for ThinkBook 13x Gen 5 device IDs to enable CS35L41 I2C amplifier support |
| sound/pci/hda/cs35l41_hda_property.c | Registers configuration and property model entries for the new device IDs with 4-amp internal configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC), | ||
| SND_PCI_QUIRK(0x17aa, 0x391f, "Yoga S990-16 pro Quad YC Quad", ALC287_FIXUP_TAS2781_I2C), | ||
| SND_PCI_QUIRK(0x17aa, 0x3920, "Yoga S990-16 pro Quad VECO Quad", ALC287_FIXUP_TAS2781_I2C), | ||
| SND_PCI_QUIRK(0x17aa, 0x3929, "Thinkbook 13x Gen 5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), |
Copilot
AI
Dec 26, 2025
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.
The product name should be "ThinkBook" with a capital 'B' to match Lenovo's official branding. While the codebase has inconsistent capitalization (both "Thinkbook" and "ThinkBook" are used), line 11285 in this file uses "ThinkBook" for a similar product. For consistency within proximity and adherence to official branding, "ThinkBook" should be used here.
| SND_PCI_QUIRK(0x17aa, 0x3929, "Thinkbook 13x Gen 5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), | ||
| SND_PCI_QUIRK(0x17aa, 0x392b, "Thinkbook 13x Gen 5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), |
Copilot
AI
Dec 26, 2025
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.
The product name should be "ThinkBook" with a capital 'B' to match Lenovo's official branding. While the codebase has inconsistent capitalization (both "Thinkbook" and "ThinkBook" are used), line 11285 in this file uses "ThinkBook" for a similar product. For consistency within proximity and adherence to official branding, "ThinkBook" should be used here.
| SND_PCI_QUIRK(0x17aa, 0x3929, "Thinkbook 13x Gen 5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), | |
| SND_PCI_QUIRK(0x17aa, 0x392b, "Thinkbook 13x Gen 5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), | |
| SND_PCI_QUIRK(0x17aa, 0x3929, "ThinkBook 13x Gen 5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), | |
| SND_PCI_QUIRK(0x17aa, 0x392b, "ThinkBook 13x Gen 5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), |
Summary by Sourcery
Add codec configuration and quirks to support CS35L41 audio on new Lenovo ThinkBook 13x Gen 5 models.
New Features: