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

ASoC: amd: yc: fix internal mic on Xiaomi Book Pro 14 2022 #450

Merged

Conversation

MingcongBai
Copy link
Contributor

Xiaomi Book Pro 14 2022 (MIA2210-AD) requires a quirk entry for its internal microphone to be enabled.

This is likely due to similar reasons as seen previously on Redmi Book 14/15 Pro 2022 models (since they likely came with similar firmware):

  • dcff8b7 (ASoC: amd: yc: Add Xiaomi Redmi Book Pro 15 2022 into DMI table)
  • c1dd6bf (ASoC: amd: yc: Add Xiaomi Redmi Book Pro 14 2022 into DMI table)

A quirk would likely be needed for Xiaomi Book Pro 15 2022 models, too. However, I do not have such device on hand so I will leave it for now.

Xiaomi Book Pro 14 2022 (MIA2210-AD) requires a quirk entry for its
internal microphone to be enabled.

This is likely due to similar reasons as seen previously on Redmi Book
14/15 Pro 2022 models (since they likely came with similar firmware):

- dcff8b7 (ASoC: amd: yc: Add Xiaomi
  Redmi Book Pro 15 2022 into DMI table)
- c1dd6bf (ASoC: amd: yc: Add Xiaomi
  Redmi Book Pro 14 2022 into DMI table)

A quirk would likely be needed for Xiaomi Book Pro 15 2022 models, too.
However, I do not have such device on hand so I will leave it for now.

Signed-off-by: Mingcong Bai <jeffbai@aosc.io>
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from mingcongbai. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@opsiff
Copy link
Member

opsiff commented Nov 1, 2024

/lgtm
/ok-to-test

@opsiff opsiff merged commit 14b0f4a into linux-6.6.y Nov 1, 2024
5 of 10 checks passed
@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. 代码重复:在yc_acp_quirk_table数组中,DMI_MATCH(DMI_PRODUCT_NAME, "Redmi Book Pro 15 2022")DMI_MATCH(DMI_PRODUCT_NAME, "Xiaomi Book Pro 14 2022")driver_data都指向acp6x_card,这可能意味着这两个设备使用相同的驱动数据。如果这两个设备确实需要不同的驱动数据,应该为它们分别定义不同的driver_data

  2. DMI匹配项的清晰性DMI_MATCH宏的使用使得代码易于阅读和理解。但是,如果yc_acp_quirk_table数组中的匹配项非常多,可以考虑使用更结构化的方式来组织这些匹配项,以提高代码的可维护性。

  3. 注释缺失:代码中没有添加注释来解释为什么需要添加新的匹配项,以及这些匹配项的具体用途。添加适当的注释可以帮助其他开发者更好地理解代码的目的和上下文。

  4. 代码风格一致性:虽然代码风格总体上保持了一致性,但是在新添加的匹配项中,DMI_MATCH宏的括号使用了不同的缩进方式。建议统一缩进风格,以提高代码的可读性。

  5. 潜在的性能问题:如果yc_acp_quirk_table数组中的匹配项非常多,每次系统启动时都需要遍历整个数组来查找匹配项,可能会影响系统启动的性能。如果可能,可以考虑使用更高效的数据结构或算法来优化匹配过程。

  6. 安全性:代码中没有明显的安全漏洞,但是应该确保yc_acp_quirk_table数组中的数据是可信的,并且不会被恶意修改。如果这些数据来自不可信的源,应该进行适当的验证和清洗。

综上所述,代码在逻辑和功能上没有明显的问题,但是可以通过上述建议来提高代码的可读性、可维护性和性能。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants