Re: How to disable the touchscreen so it does not draw power?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 11/13/23 13:08, Hans de Goede wrote:
> Hi,
> 
> On 11/13/23 09:39, Paul Menzel wrote:
>> Dear Linux folks,
>>
>>
>> On a Dell XPS 13 9360 with a touchscreen, when it’s connect to an external monitor, that is set up as the only display, the touchscreen – although the internal monitor is disabled (in GNOME) – is still active and draws power according to PowerTOP:
>>
>>     $ uname -a
>>     Linux abreu 6.5.0-4-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.5.10-1 (2023-11-03) x86_64 GNU/Linux
>>     $ lsusb  | grep Touchscreen
>>     Bus 001 Device 003: ID 04f3:2234 Elan Microelectronics Corp. Touchscreen
>>     $ sudo LANG= powertop
>>     Power est.              Usage       Events/s    Category Description
>>       9.39 W    100.0%                      Device         USB device: DELL DA300 (Bizlink)
>>       1.39 W    100.0%                      Device         USB device: Touchscreen (ELAN)
>>
>> Is there a way to disable the touchscreen, so it does not draw power?
>>
>> `sudo modprobe -r hid-multitouch` also affects the touchpad, which is not wanted.
> 
> Ideally userspace would close the /dev/input/event node belonging to the touchscreen when the internal panel is off. Please file an issue for that against libinput (to add the plumbing for this to libinput, ultimately the wayland-compositor, e.g. mutter, then needs to use that plumbing).
> 
> For now you can manually detach the driver by doing (as root):
> 
> cd /sys/bus/usb/drivers/usbhid/
> ls
> 
> The ls will show a bunch of usb devices, e.g. :
> 
> 1-5.1.1:1.0
> 1-5.1.1:1.1
> 1-5.4.1:1.0
> 1-5.4.1:1.1
> 
> You can then unbind the driver from a specific usb device by doing, e.g.:
> 
> echo '1-5.1.1:1.0' > unbind
> echo '1-5.1.1:1.1' > unbind
> 
> to find out which usb device is which look at:
> 
> lsusb
> 
> and
> 
> lsusb -t
> 
> 
> The first one gives you the bus + dev info, which you can then match up with the lsusb -t output to get the bus-port.port.port (in my example) address you need by following the tree.
> 
> E.g. for the 1-5.1.1 device (with 2 HID interfaces in my case):
> 
> lsusb:
> Bus 001 Device 007: ID 046d:c534 Logitech, Inc. Unifying Receiver
> 
> lsusb -t:
> /:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/10p, 480M
>     |__ Port 005: Dev 002, If 0, Class=Hub, Driver=hub/4p, 480M
>         |__ Port 001: Dev 004, If 0, Class=Hub, Driver=hub/2p, 480M
>             |__ Port 001: Dev 007, If 0, Class=Human Interface Device, Driver=usbhid, 12M
>             |__ Port 001: Dev 007, If 1, Class=Human Interface Device, Driver=usbhid, 12M
> 
> Notice Bus 001 and Dev(ice) 007 match up in both outputs and the ports going from the USB root hub to the unifying receiver are: 005 001 001 leading to: 1-5.1.1 as usb device address.
> 
> You also need to enable autosuspend on the USB device for it to suspend when no driver is attached:
> 
> cd /sys/bus/usb/devices/1-5.1.1
> echo auto > power/control

Actually I think just doing this last step is enough to put the USB connection to sleep (assuming the touchscreen supports USB remote wake) even if the driver is still loaded and the USB connection is what uses the most power. Note you will see the biggest energy usage win if you enable autosuspend on all USB devices, so that the controller itself can go to sleep.

This might not work if you are using a USB kbd/mouse on the same controller though, enabling autosuspend / remote wakeup on those does not always work well (e.g. big delay in key-presses or key-presses getting lost)

Regards,

Hans







[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux