Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 825294

Summary: sys-kernel/gentoo-kernel-bin: adjust default config to add MediaTek bluetooth support for Lenovo Legion (5 pro/7) notebooks
Product: Gentoo Linux Reporter: Georgi <jorodrbr>
Component: Current packagesAssignee: Distribution Kernel Project <dist-kernel>
Status: RESOLVED WORKSFORME    
Severity: enhancement CC: jorodrbr, jstein, mgorny, sam
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch to enable mtk bluetooth in kernel config

Description Georgi 2021-11-20 12:33:21 UTC
Please enable Mediatek bluetooth protocol in the distribution kernel to support newer Lenovo Legion 5 Pro (and most probably 7) laptops. This is the only hardware in that laptop not supported with current kernels.

Reproducible: Always

Steps to Reproduce:
1. Emerge nstall gentoo-kernel or gentoo-kernel-bin and boot it.
2. Inspect dmesg to see if bluetooth is initaliazed or use hciconfig -a command
3.
Actual Results:  
Bluetooth is not initialized:
1. It's missing from dmesg log
2. hciconfig -a doesn't show an actual device

Expected Results:  
Bluetooth is initialized:
1. You can see it in the dmesg logs, usually at the very end of boot process
2. hciconfig shows an actual device

It may be a good idea to enable bluetooth high speed features as well.

[*] Networking support --->
      <M>   Bluetooth subsystem support --->
                    ....
              [*]     Bluetooth High Speed (HS) features
                    ....
                    Bluetooth device drivers --->
                            <M> HCI USB driver 
                                ...
                                [*]   MediaTek protocol support
Comment 1 Jonas Stein gentoo-dev 2021-11-20 12:46:37 UTC
Please provide a link to the sources. Are they already part of the kernel?
Which exact module will work? (see lspci -k)
So far I just found this link: https://wireless.wiki.kernel.org/en/users/drivers/mediatek
Comment 2 Georgi 2021-11-20 13:18:31 UTC
Created attachment 753922 [details, diff]
patch to enable mtk bluetooth in kernel config

I apologize for not providing enough details.

It's about the current testing distribution kernels:

sys-kernel/gentoo-kernel
sys-kernel/gentoo-kernel-bin

version 5.15.1.

Sources are in the kernel already, the drivers just need to be enabled.

I'm attaching a patch for the kernel config file.

Regards,
Georgi
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-11-20 13:46:36 UTC
Are you sure that CONFIG_BT_HS is required?  Fedora seems to enable the other two only:

commit 2edca076e88a261fe0a1a152549dbc51c7f071a6
Author: Justin M. Forbes <jforbes@fedoraproject.org>
Date:   2021-11-15 17:00:15 +0100

    kernel-5.16-0.rc0.20211113git66f4beaa6c1d.12
    
    * Sat Nov 13 2021 Fedora Kernel Team <kernel-team@fedoraproject.org> [5.16-0.rc0.20211113git66f4beaa6c1d.12]
    - Turn on CONFIG_HID_NINTENDO for controller support (Dave Olsthoorn)
    - Fedora: Enable MediaTek bluetooth pieces (Peter Robinson)
    Resolves: rhbz#
    
    Signed-off-by: Justin M. Forbes <jforbes@fedoraproject.org>

diff --git a/kernel-x86_64-fedora.config b/kernel-x86_64-fedora.config
index 26ad823f5..6b770bb4f 100644
--- a/kernel-x86_64-fedora.config
+++ b/kernel-x86_64-fedora.config
@@ -696,7 +696,7 @@ CONFIG_BT_HCIBTSDIO=m
 CONFIG_BT_HCIBTUSB_AUTOSUSPEND=y
 CONFIG_BT_HCIBTUSB_BCM=y
 CONFIG_BT_HCIBTUSB=m
-# CONFIG_BT_HCIBTUSB_MTK is not set
+CONFIG_BT_HCIBTUSB_MTK=y
 CONFIG_BT_HCIBTUSB_RTL=y
 CONFIG_BT_HCIDTL1=m
 CONFIG_BT_HCIUART_3WIRE=y
@@ -723,7 +723,7 @@ CONFIG_BT_MRVL=m
 CONFIG_BT_MRVL_SDIO=m
 CONFIG_BT_MSFTEXT=y
 CONFIG_BT_MTKSDIO=m
-# CONFIG_BT_MTKUART is not set
+CONFIG_BT_MTKUART=m
 CONFIG_BT_QCA=m
 CONFIG_BT_RFCOMM=m
 CONFIG_BT_RFCOMM_TTY=y
[...]
Comment 4 Georgi 2021-11-20 14:34:25 UTC
Tested on 5.15.1 with HS features disabled, bluetooth headset and Android devices connect and work without problems.

Regards,
Georgi
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-12-19 18:06:21 UTC
Thanks!