From 35e4c0d7503ab2f2d0e78114139b6406edda9916 Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Wed, 3 Nov 2021 15:09:53 +1000 Subject: [PATCH] linux: Add kernel config required for QCA6390 bluetooth (XPS 9310) This commit aims to upstream some kernel config patches from the [xps 9310 module in the nixos-hardware repo][1]. These patches have been in use by at least a few community members for around 10 months and seem to consistently and successfully enable bluetooth support for XPS 9310 models that come with the QCA6390 connectivity chip. Without these patches, bluetooth will not work on the Dell XPS 9310 laptop models that come with the QCA6390. *Note that this isn't all XPS 9310 devices, but seems to be all devices shipped with 32GB RAM.* The motivation for upstreaming is pretty simple: currently we have to build the entire kernel every time we want to update it, which takes a good half hour at least on this little laptop :) The `whenAtLeast` version params were determined via the entries for each parameter found at https://cateee.net/lkddb (linked for each below). Added config parameters: - `BT_QCA` - provides the `btqca` module. https://cateee.net/lkddb/web-lkddb/BT_QCA.html - `BT_HCIUART_QCA` - required for QCA6390 bluetooth support. Requires `BT_HCIUART`, `BT_HCIUART_SERDEV` https://cateee.net/lkddb/web-lkddb/BT_HCIUART_QCA.html - `BT_HCIUART_SERDEV` Requires `SERIAL_DEV_BUS`, `BT_HCIUART` https://cateee.net/lkddb/web-lkddb/BT_HCIUART_SERDEV.html - `BT_HCIUART` Requires `SERIAL_DEV_BUS`, `TTY` https://cateee.net/lkddb/web-lkddb/BT_HCIUART.html - `SERIAL_DEV_CTRL_TTYPORT` Requires `TTY`, `SERIAL_DEV_BUS` != module https://cateee.net/lkddb/web-lkddb/SERIAL_DEV_CTRL_TTYPORT.html - `SERIAL_DEV_BUS` https://cateee.net/lkddb/web-lkddb/SERIAL_DEV_BUS.html Fwiw, these parameters are also set in [the default Arch config][2]. [1]: https://github.com/NixOS/nixos-hardware/blob/master/dell/xps/13-9310/default.nix [2]: https://github.com/archlinux/svntogit-packages/blob/packages/linux/trunk/config --- pkgs/os-specific/linux/kernel/common-config.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix index f591910f560b..b1df3c6df3dd 100644 --- a/pkgs/os-specific/linux/kernel/common-config.nix +++ b/pkgs/os-specific/linux/kernel/common-config.nix @@ -747,10 +747,17 @@ let BSD_PROCESS_ACCT_V3 = yes; + SERIAL_DEV_BUS = whenAtLeast "4.11" yes; # enables support for serial devices + SERIAL_DEV_CTRL_TTYPORT = whenAtLeast "4.11" yes; # enables support for TTY serial devices + + BT_HCIUART_QCA = whenAtLeast "4.3" yes; # Qualcomm Atheros protocol support + BT_HCIUART_SERDEV = whenAtLeast "4.12" yes; # required by BT_HCIUART_QCA + BT_HCIUART = whenAtLeast "2.5.45" module; # required for BT devices with serial port interface (QCA6390) BT_HCIUART_BCSP = option yes; BT_HCIUART_H4 = option yes; # UART (H4) protocol support BT_HCIUART_LL = option yes; BT_RFCOMM_TTY = option yes; # RFCOMM TTY support + BT_QCA = whenAtLeast "4.3" module; # enables QCA6390 bluetooth CLEANCACHE = option yes; CRASH_DUMP = option no;