All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Paul Menzel <pmenzel@molgen.mpg.de>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Subject: Re: How to disable the touchscreen so it does not draw power?
Date: Mon, 13 Nov 2023 13:08:52 +0100	[thread overview]
Message-ID: <99dcbb8d-06a8-4c32-ab03-94bc3bf5658f@redhat.com> (raw)
In-Reply-To: <978f5891-5167-4a07-884a-4ba464af30f3@molgen.mpg.de>

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

Regards,

Hans


  reply	other threads:[~2023-11-13 12:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-13  8:39 How to disable the touchscreen so it does not draw power? Paul Menzel
2023-11-13 12:08 ` Hans de Goede [this message]
2023-11-13 12:12   ` Hans de Goede
2023-12-03 17:41   ` Paul Menzel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=99dcbb8d-06a8-4c32-ab03-94bc3bf5658f@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=pmenzel@molgen.mpg.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.