Discussion:
Issue 391046 in chromium: touch input devices (atmel, elan, cypress) : Propose a better and more widely applicable solution to lid-close power off case
c***@googlecode.com
2014-07-02 20:40:20 UTC
Permalink
Status: Assigned
Owner: ***@chromium.org
CC: ***@chromium.org, ***@chromium.org, ***@chromium.org,
***@chromium.org, ***@chromium.org, ***@chromium.org,
***@chromium.org, ***@chromium.org
Labels: Type-Feature Pri-2 OS-Chrome Cr-Internals-Input-Touch-Pad
Cr-Internals-Input-Touch-Screen Cr-OS-Kernel-Power Cr-OS-Kernel

New issue 391046 by ***@chromium.org: touch input devices (atmel, elan,
cypress) : Propose a better and more widely applicable solution to
lid-close power off case
http://code.google.com/p/chromium/issues/detail?id=391046

The cyapa driver, the atmel_mxt_ts driver and soon the elan_i2c driver in
the chromeos kernels today contain a hack to implement a bit of power
management policy.

For example, here are the ones for the Cypress and Atmel drivers
respectively:
https://chromium-review.googlesource.com/#/c/168700/
https://chromium-review.googlesource.com/#/c/167769/


The policy is that when the lid is closed, the touch devices (touchpad and
touchscreen) which may be subject to input noise from the laptop's B and C
panels touching must be immediately turned off.

We need to come up with a better way to do this that both meets our
requirements and is generic enough that it doesn't need to be hacked into
each driver like the lid filter.

For some background, read this thread and the subsequent messages :
http://www.spinics.net/lists/linux-input/msg31517.html

Dmitry (copied) mentions that there is no such generic interface for user
space to disable a device if we wanted to do the policy in user space.

Also, my comments regarding specific latency requirements and working
around some race conditions are here :
http://www.spinics.net/lists/linux-input/msg31534.html
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2014-09-08 20:01:51 UTC
Permalink
Updates:
Status: Started

Comment #4 on issue 391046 by ***@chromium.org: touch input devices
(atmel, elan, cypress) : Propose a better and more widely applicable
solution to lid-close power off case
https://code.google.com/p/chromium/issues/detail?id=391046

(No comment was entered for this change.)
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2014-09-17 01:44:13 UTC
Permalink
Comment #6 on issue 391046 by ***@chromium.org: touch input devices
(atmel, elan, cypress) : Propose a better and more widely applicable
solution to lid-close power off case
https://code.google.com/p/chromium/issues/detail?id=391046#c6

Project: chromiumos/third_party/kernel
Branch : chromeos-3.14
Author : Patrik Fimml <***@chromium.org>
Commit : c519206bb1796a3ee2404160af4260d06b8edc56

Code-Review 0 : Patrik Fimml, chrome-internal-fetch
Code-Review +2: Dmitry Torokhov
Commit-Queue 0 : Dmitry Torokhov, chrome-internal-fetch
Commit-Queue +1: Patrik Fimml
Verified 0 : Dmitry Torokhov, chrome-internal-fetch
Verified +1: Patrik Fimml
Change-Id : I6fbad775760c98c1eb2c655ad072faa5ce75765e
Reviewed-at : https://chromium-review.googlesource.com/218280

CHROMIUM: input: Revise inhibit interface

We might want to be able to return errors to userspace at some point in
the future.

BUG=chromium:391046
TEST=compiles

Signed-off-by: Patrik Fimml &lt;***@chromium.org&gt;

drivers/input/input.c
include/linux/input.h
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2014-09-17 06:18:42 UTC
Permalink
Comment #7 on issue 391046 by ***@chromium.org: touch input devices
(atmel, elan, cypress) : Propose a better and more widely applicable
solution to lid-close power off case
https://code.google.com/p/chromium/issues/detail?id=391046#c7

Project: chromiumos/third_party/kernel
Branch : chromeos-3.14
Author : Patrik Fimml <***@chromium.org>
Commit : f764c6a4088eb1f2f6b6d4a04b4e3c544a6fc5bd

Code-Review 0 : Benson Leung, Patrik Fimml, chrome-internal-fetch
Code-Review +1: Dudley Du
Code-Review +2: Dmitry Torokhov
Commit-Queue 0 : Benson Leung, Dmitry Torokhov, Dudley Du,
chrome-internal-fetch
Commit-Queue +1: Patrik Fimml
Verified 0 : Benson Leung, Dmitry Torokhov, Dudley Du,
chrome-internal-fetch
Verified +1: Patrik Fimml
Change-Id : Iae1f7863ed47f2ee05cfbae5b18280f071d11bf5
Reviewed-at : https://chromium-review.googlesource.com/216351

CHROMIUM: input: Migrate cyapa to inhibit

Remove the lid filtering code from the cyapa driver and use the new
inhibit infrastructure instead. We also clean up suspend/resume a bit.

BUG=chromium:391046
TEST=Tested on peppy.
1. evtest /dev/input/event7 &
2. check that touchpad works
3. echo 1 > /sys/class/input/input7/inhibited
4. check that touchpad doesn't work
5. echo 0 > /sys/class/input/input7/inhibited
6. check that touchpad works
7. echo mem > /sys/power/state
8. touch touchpad; should wake the system
9. echo 1 > /sys/class/input/input7/inhibited
10. echo mem > /sys/power/state
11. touch touchpad; should not wake the system
12. wake up system (press key on keyboard)
13. check that touchpad doesn't work
14. echo 0 > /sys/class/input/input7/inhibited
15. check that touchpad works

Signed-off-by: Patrik Fimml &lt;***@chromium.org&gt;

drivers/input/mouse/cyapa.c
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2014-09-17 06:19:42 UTC
Permalink
Comment #8 on issue 391046 by ***@chromium.org: touch input devices
(atmel, elan, cypress) : Propose a better and more widely applicable
solution to lid-close power off case
https://code.google.com/p/chromium/issues/detail?id=391046#c8

Project: chromiumos/third_party/kernel
Branch : chromeos-3.14
Author : Patrik Fimml <***@chromium.org>
Commit : 1c24270ffd7eca78ffa31b0a4f22ace553f44d8e

Code-Review 0 : Benson Leung, Patrik Fimml, Sameer Nanda,
chrome-internal-fetch
Code-Review +2: Dmitry Torokhov
Commit-Queue 0 : Benson Leung, Dmitry Torokhov, Sameer Nanda,
chrome-internal-fetch
Commit-Queue +1: Patrik Fimml
Verified 0 : Benson Leung, Dmitry Torokhov, Sameer Nanda,
chrome-internal-fetch
Verified +1: Patrik Fimml
Change-Id : Iecc072b9eeaa8cc2b22ebd38f642ae4b151dca76
Reviewed-at : https://chromium-review.googlesource.com/216849

CHROMIUM: input: Migrate atmel_mxt_ts to inhibit

Replace the custom lid filtering code with an implementation that uses
the new inhibit infrastructure.

BUG=chromium:391046
TEST=Tested on link. Run evtest, inhibit, uninhibit, suspend while
inhibited, check that touchscreen behaves as expected every time.

Signed-off-by: Patrik Fimml &lt;***@chromium.org&gt;

drivers/input/touchscreen/atmel_mxt_ts.c
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2014-09-18 04:11:01 UTC
Permalink
Comment #9 on issue 391046 by ***@chromium.org: touch input devices
(atmel, elan, cypress) : Propose a better and more widely applicable
solution to lid-close power off case
https://code.google.com/p/chromium/issues/detail?id=391046#c9

Project: chromiumos/platform2
Branch : master
Author : Patrik Fimml <***@chromium.org>
Commit : 87f526b2a5d54211074f5698a07398295d60114d

Code-Review 0 : Daniel Erat, Patrik Fimml, Yu-Ju Hong,
chrome-internal-fetch
Code-Review +2: Benson Leung
Commit-Queue 0 : Benson Leung, Daniel Erat, Yu-Ju Hong,
chrome-internal-fetch
Commit-Queue +1: Patrik Fimml
Verified 0 : Benson Leung, Daniel Erat, Yu-Ju Hong,
chrome-internal-fetch
Verified +1: Patrik Fimml
Change-Id : I39fb83ea45e70954d54d64f158fcd0a3d3716343
Reviewed-at : https://chromium-review.googlesource.com/217385

power_manager: Use inhibit when available

In our kernels, we introduce the "inhibit" feature to selectively
disable input devices that might provide bogus input. We make powerd
use this when it is available.

Also, we only set the "wakeup" and "inhibit" tags on the input* devices,
not on the event* devices.

BUG=chromium:391046
TEST=Tested on link (easy to reproduce bogus input due to metal case).
1. Deploy, udevadm trigger, restart powerd. Make sure that you are
running a kernel that doesn't have our kernel-level lid-filter hacks
applied and has inhibit support instead.
2. With powerd stopped and evtest, verify that bogus input is seen from
touchpad/touchscreen when lid is closed.
3. Start powerd. No bogus input when lid is closed, suspend works
correctly.

power_manager/powerd/policy/wakeup_controller.cc
power_manager/powerd/policy/wakeup_controller.h
power_manager/powerd/policy/wakeup_controller_unittest.cc
power_manager/udev/90-powerd-tags.rules
power_manager/udev/99-powerd-permissions.rules
power_manager/udev/99-powerd-wakeup-chown.rules
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2014-09-23 04:23:29 UTC
Permalink
Comment #12 on issue 391046 by ***@chromium.org: touch input devices
(atmel, elan, cypress) : Propose a better and more widely applicable
solution to lid-close power off case
https://code.google.com/p/chromium/issues/detail?id=391046#c12

Project: chromiumos/third_party/kernel-next
Branch : chromeos-3.10
Author : Patrik Fimml <***@chromium.org>
Commit : dc3dcaaa0f394136441b1276432337f627f2b83e

Code-Review 0 : Patrik Fimml, chrome-internal-fetch
Code-Review +2: Benson Leung
Commit-Queue 0 : Benson Leung, chrome-internal-fetch
Commit-Queue +1: Patrik Fimml
Verified 0 : Benson Leung, chrome-internal-fetch
Verified +1: Patrik Fimml
Change-Id : Iae1f7863ed47f2ee05cfbae5b18280f071d11bf5
Reviewed-at : https://chromium-review.googlesource.com/219398

CHROMIUM: input: Migrate cyapa to inhibit

Remove the lid filtering code from the cyapa driver and use the new
inhibit infrastructure instead. We also clean up suspend/resume a bit.

BUG=chromium:391046
TEST=Tested on peppy.
1. evtest /dev/input/event7 &
2. check that touchpad works
3. echo 1 > /sys/class/input/input7/inhibited
4. check that touchpad doesn't work
5. echo 0 > /sys/class/input/input7/inhibited
6. check that touchpad works
7. echo mem > /sys/power/state
8. touch touchpad; should wake the system
9. echo 1 > /sys/class/input/input7/inhibited
10. echo mem > /sys/power/state
11. touch touchpad; should not wake the system
12. wake up system (press key on keyboard)
13. check that touchpad doesn't work
14. echo 0 > /sys/class/input/input7/inhibited
15. check that touchpad works

Signed-off-by: Patrik Fimml &lt;***@chromium.org&gt;
(cherry picked from commit f764c6a4088eb1f2f6b6d4a04b4e3c544a6fc5bd)

drivers/input/mouse/cyapa.c
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2014-09-23 04:24:29 UTC
Permalink
Comment #11 on issue 391046 by ***@chromium.org: touch input devices
(atmel, elan, cypress) : Propose a better and more widely applicable
solution to lid-close power off case
https://code.google.com/p/chromium/issues/detail?id=391046#c11

Project: chromiumos/third_party/kernel-next
Branch : chromeos-3.10
Author : Patrik Fimml <***@chromium.org>
Commit : d2b171d4780fa756095821c0954b4b504ce0da6b

Code-Review 0 : Patrik Fimml, chrome-internal-fetch
Code-Review +2: Benson Leung
Commit-Queue 0 : Benson Leung, chrome-internal-fetch
Commit-Queue +1: Patrik Fimml
Verified 0 : Benson Leung, chrome-internal-fetch
Verified +1: Patrik Fimml
Change-Id : I87655fe6d120b6896830f59ae92b0179e9a789db
Reviewed-at : https://chromium-review.googlesource.com/219399

CHROMIUM: input: Migrate elan to inhibit

Remove "lid filter" code from the elan TP driver and use the inhibit
interface instead.

BUG=chromium:391046
TEST=Tested on rambi. Use evtest to verify that you can control the
touchpad through the "inhibited" property. Test interactions with
suspend.

Conflicts:
drivers/input/mouse/elan_i2c.c

Signed-off-by: Patrik Fimml &lt;***@chromium.org&gt;
(cherry picked from commit ef46b7172b997bcfac7155fb47dcf3b46ae7b21b)

drivers/input/mouse/elan_i2c.c
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2014-09-23 04:25:30 UTC
Permalink
Comment #14 on issue 391046 by ***@chromium.org: touch input devices
(atmel, elan, cypress) : Propose a better and more widely applicable
solution to lid-close power off case
https://code.google.com/p/chromium/issues/detail?id=391046#c14

Project: chromiumos/third_party/kernel-next
Branch : chromeos-3.10
Author : Patrik Fimml <***@chromium.org>
Commit : 01f4d2d8bbd000d4620fcb5e72f6c581cd72b1aa

Code-Review 0 : Patrik Fimml, chrome-internal-fetch
Code-Review +2: Benson Leung
Commit-Queue 0 : Benson Leung, chrome-internal-fetch
Commit-Queue +1: Patrik Fimml
Verified 0 : Benson Leung, chrome-internal-fetch
Verified +1: Patrik Fimml
Change-Id : I6fbad775760c98c1eb2c655ad072faa5ce75765e
Reviewed-at : https://chromium-review.googlesource.com/219396

CHROMIUM: input: Revise inhibit interface

We might want to be able to return errors to userspace at some point in
the future.

BUG=chromium:391046
TEST=compiles

Signed-off-by: Patrik Fimml &lt;***@chromium.org&gt;
(cherry picked from commit c519206bb1796a3ee2404160af4260d06b8edc56)

drivers/input/input.c
include/linux/input.h
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2014-09-23 04:26:30 UTC
Permalink
Comment #13 on issue 391046 by ***@chromium.org: touch input devices
(atmel, elan, cypress) : Propose a better and more widely applicable
solution to lid-close power off case
https://code.google.com/p/chromium/issues/detail?id=391046#c13

Project: chromiumos/third_party/kernel-next
Branch : chromeos-3.10
Author : Patrik Fimml <***@chromium.org>
Commit : e7cfb7977c13c17a96c9d136fa9fa5770d11e84d

Code-Review 0 : Patrik Fimml, chrome-internal-fetch
Code-Review +2: Benson Leung
Commit-Queue 0 : Benson Leung, chrome-internal-fetch
Commit-Queue +1: Patrik Fimml
Verified 0 : Benson Leung, chrome-internal-fetch
Verified +1: Patrik Fimml
Change-Id : Iecc072b9eeaa8cc2b22ebd38f642ae4b151dca76
Reviewed-at : https://chromium-review.googlesource.com/219397

CHROMIUM: input: Migrate atmel_mxt_ts to inhibit

Replace the custom lid filtering code with an implementation that uses
the new inhibit infrastructure.

BUG=chromium:391046
TEST=Tested on link. Run evtest, inhibit, uninhibit, suspend while
inhibited, check that touchscreen behaves as expected every time.

Conflicts:
drivers/input/touchscreen/atmel_mxt_ts.c

Signed-off-by: Patrik Fimml &lt;***@chromium.org&gt;
(cherry picked from commit 1c24270ffd7eca78ffa31b0a4f22ace553f44d8e)

drivers/input/touchscreen/atmel_mxt_ts.c
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2014-09-23 04:28:30 UTC
Permalink
Comment #15 on issue 391046 by ***@chromium.org: touch input devices
(atmel, elan, cypress) : Propose a better and more widely applicable
solution to lid-close power off case
https://code.google.com/p/chromium/issues/detail?id=391046#c15

Project: chromiumos/third_party/kernel-next
Branch : chromeos-3.10
Author : Patrik Fimml <***@chromium.org>
Commit : eff2094f7ac439049f773df6535e33798ffe2c67

Code-Review 0 : Patrik Fimml, chrome-internal-fetch
Code-Review +2: Benson Leung
Commit-Queue 0 : Benson Leung, chrome-internal-fetch
Commit-Queue +1: Patrik Fimml
Verified 0 : Benson Leung, chrome-internal-fetch
Verified +1: Patrik Fimml
Change-Id : I43a87cb5b52a3a83b375d7fbcf20f792554adb6a
Reviewed-at : https://chromium-review.googlesource.com/219395

CHROMIUM: input: Add "inhibited" property for input devices

Under certain circumstances, we want to disable some input devices from
userspace. In particular, when we detect that the lid of a laptop is
closed, we want to be able to disable touchpad and touchscreen to avoid
bogus input.

To facilitate this, we introduce the "inhibited" sysfs property for
input devices. Using this property, userspace can tell a driver that the
events it can provide are not currently of interest and should be
ignored. We provide hooks so that the driver can take additional
actions, such as powering down the device.

We deliberately keep this limited to input devices for now to keep the
implementation as straightforward as possible.

BUG=chromium:391046
TEST=Tested on peppy.
1. evtest /dev/input/input7 &
2. verify that touchpad works
3. echo 1 > /sys/bus/i2c/drivers/cyapa/8-0067/input/input7/inhibited
4. touchpad stops working
5. echo 0 > /sys/bus/i2c/drivers/cyapa/8-0067/input/input7/inhibited
6. touchpad works again

(cherry-picked from chromeos-3.14 branch)
Conflicts:
drivers/input/input.c

Signed-off-by: Patrik Fimml &lt;***@chromium.org&gt;
(cherry picked from commit a1a19e4af2491f9ebc4aad3cd52e498a7db80457)

drivers/input/input