1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ThinkPad X1 でトラックパッドやトラックポイントを動かしたい

Posted at

これは何?

Lenovo ThinkPad X1 Carbon (Gen 6) - ArchWiki
上記の設定を試してみたが、トラックパッドやトラックパッドが動かない。
どうやら、以下のようなメッセージが表示され、RMI4_SMBを有効にしないとだめで、結構はまったので、その記録。

$ dmesg -H
...
[    4.005445] psmouse serio1: synaptics: The touchpad can support a better 
bus than the too old PS/2 protocol. Make sure MOUSE_PS2_SYNAPTICS_SMBUS and 
RMI4_SMB are enabled to get a better touchpad experience.
...

対象について

タッチパットについては、ThinkPadの製品で異なり自分の場合は LEN0091 というIDだった。
プラグアンドプレイのデバイスリスト調べることでわかる。

cat /sys/bus/pnp/devices/*/id                                                                                                                                                             
...
PNP0c02
LEN0071
PNP0303
LEN0091 # <ー これ
PNP0f13
...

Lenovo X1C6 (2018): TrackPoint/Touchpad issues, 20KG model / Laptop Issues / Arch Linux Forums

もしくは、dmesgにログが出てるかもしれない。

$ sudo dmesg | grep LEN0                                                                                                                                                                                              
[    0.703328] pnp 00:05: Plug and Play ACPI device, IDs LEN0071 PNP0303 (active)
[    0.703349] pnp 00:06: Plug and Play ACPI device, IDs LEN0091 PNP0f13 (active)

やり方

RMI4_SMBはデフォルトで有効にするため、カーネルの設定を変更し、対象のモジュールをビルドしてインストールする必要がある。

カーネルのソースコードをダウンロードし、開発用のディレクトリを整える。

$ apt install linux-source
$ ls /usr/src
$ mkdir ~/kernel; cd ~/kernel
$ tar -xaf /usr/src/linux-source-x.x.tar.xz

現在のコンフィグをコピーして、RMI4_SMBが設定されてない場合は編集して有効化する。


$ cp /boot/config-x.x.x ~/kernel/linux-source-x.x/.config
$ cd ~/kernel/linux-source-x.x
$ ack "MOUSE_PS2_SYNAPTICS_SMBUS|RMI4_SMB" .config # 設定を確認                                                                                                                                                              
3470:CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y
3656:# CONFIG_RMI4_SMB is not set
9 diff -u .config .config.old                                                                                                                                                                               (1m 24s 986ms) 
--- .config	2019-01-13 04:13:55.115883212 +0900
+++ .config.old	2019-01-13 04:13:26.515680877 +0900
@@ -3653,7 +3653,7 @@
 CONFIG_RMI4_CORE=m
 # CONFIG_RMI4_I2C is not set
 # CONFIG_RMI4_SPI is not set
 # CONFIG_RMI4_SMB is not set
+CONFIG_RMI4_SMB=m
 CONFIG_RMI4_F03=y
 CONFIG_RMI4_F03_SERIO=m
 CONFIG_RMI4_2D_SENSOR=y

自分のデバイスIDを加えて、モジュールをビルドする。

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index a246fc686bb7..ce1945630f40 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -172,6 +172,7 @@  static const char * const smbus_pnp_ids[] = {
 	"LEN0048", /* X1 Carbon 3 */
 	"LEN0046", /* X250 */
 	"LEN004a", /* W541 */
+	"LEN0091", /* X1 Carbon 6 */
 	"LEN200f", /* T450s */
 	NULL
 };

$ make prepare && make scritpts
$ make M=drivers/input/mouse
...
...
  Building modules, stage 2.
  MODPOST 9 modules
...
  CC      drivers/input/mouse/synaptics_i2c.mod.o
  LD [M]  drivers/input/mouse/synaptics_i2c.ko
  CC      drivers/input/mouse/synaptics_usb.mod.o
  LD [M]  drivers/input/mouse/synaptics_usb.ko
...
$ make M=drivers/rmi4
...
  Building modules, stage 2.
  MODPOST 2 modules
  CC      drivers/input/rmi4/rmi_core.mod.o
  LD [M]  drivers/input/rmi4/rmi_core.ko
  CC      drivers/input/rmi4/rmi_smbus.mod.o
  LD [M]  drivers/input/rmi4/rmi_smbus.ko
...

ビルドできたカーネルモジュールをインストールする。

$ sudo cp ./drivers/input/rmi4/*.ko /usr/lib/modules/(uname -r)/updates/
$ sudo cp ./drivers/input/mouse/synaptics*.ko /usr/lib/modules/(uname -r)/updates/
$ ls /usr/lib/modules/(uname -r)/updates/
rmi_core.ko  rmi_smbus.ko  synaptics_i2c.ko  synaptics_usb.ko
$ sudo depmod -a
$ sudo update-initramfs -u  
$ sudo reboot

これで動くはず。

開発マシンOSを Linux に変えてから間もないが、OSの仕組みやモジュールの仕組みの勉強になってよかった。

参考

Input: synaptics - Lenovo Thinkpad Carbon X1 6th Gen should use RMI - Patchwork
ubuntu - Lenovo X1 Carbon Gen.6 (2018) touchpad and trackpoint issues with linux - Unix & Linux Stack Exchange
Recompiling the Kali Linux Kernel | Kali Linux

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?