summaryrefslogtreecommitdiff
path: root/drivers/hid/i2c-hid/Kconfig
diff options
context:
space:
mode:
authorDouglas Anderson <dianders@chromium.org>2023-07-27 10:16:36 -0700
committerDouglas Anderson <dianders@chromium.org>2023-08-01 07:41:26 -0700
commit96a37bfd232ae912648c73cd2dc29c13f1c7776a (patch)
treed56e0a989030902c6945f515ce6cb8cba0d8696c /drivers/hid/i2c-hid/Kconfig
parent5f8838e9405d74522f075e20864cce1cda604bfe (diff)
HID: i2c-hid: Support being a panel follower
As talked about in the patch ("drm/panel: Add a way for other devices to follow panel state"), we really want to keep the power states of a touchscreen and the panel it's attached to in sync with each other. In that spirit, add support to i2c-hid to be a panel follower. This will let the i2c-hid driver get informed when the panel is powered on and off. From there we can match the i2c-hid device's power state to that of the panel. NOTE: this patch specifically _doesn't_ use pm_runtime to keep track of / manage the power state of the i2c-hid device, even though my first instinct said that would be the way to go. Specific problems with using pm_runtime(): * The initial power up couldn't happen in a runtime resume function since it create sub-devices and, apparently, that's not good to do in your resume function. * Managing our power state with pm_runtime meant fighting to make the right thing happen at system suspend to prevent the system from trying to resume us only to suspend us again. While this might be able to be solved, it added complexity. Overall the code without pm_runtime() ended up being smaller and easier to understand. Reviewed-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Benjamin Tissoires <bentiss@kernel.org> Acked-by: Benjamin Tissoires <bentiss@kernel.org> Signed-off-by: Douglas Anderson <dianders@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/20230727101636.v4.9.Ib1a98309c455cd7e26b931c69993d4fba33bbe15@changeid
Diffstat (limited to 'drivers/hid/i2c-hid/Kconfig')
-rw-r--r--drivers/hid/i2c-hid/Kconfig2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/hid/i2c-hid/Kconfig b/drivers/hid/i2c-hid/Kconfig
index 3be17109301a..2bdb55203104 100644
--- a/drivers/hid/i2c-hid/Kconfig
+++ b/drivers/hid/i2c-hid/Kconfig
@@ -70,5 +70,7 @@ config I2C_HID_OF_GOODIX
config I2C_HID_CORE
tristate
+ # We need to call into panel code so if DRM=m, this can't be 'y'
+ depends on DRM || !DRM
endif