From patchwork Thu Jul 27 17:16:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 707186 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89522C0015E for ; Thu, 27 Jul 2023 17:18:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232317AbjG0RSf (ORCPT ); Thu, 27 Jul 2023 13:18:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231749AbjG0RSe (ORCPT ); Thu, 27 Jul 2023 13:18:34 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33885116 for ; Thu, 27 Jul 2023 10:18:33 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-686f94328a4so490972b3a.0 for ; Thu, 27 Jul 2023 10:18:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1690478312; x=1691083112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wk2vuhX6NA1oRdFPUtDZvRSgubu1bvTtFKVaGPcS2eM=; b=cg23VoOJGUGKrYEb12dX6zcgIY/F/f1vmlutdzAepj+MUdIH8138FBf7Hzmm2z2tb6 vm2/wze8DKygbvfJRaONjbVEYQjeTLvmR+L1bom4s+YOFLVkmARkgdRrpOb0oGuX4t7Y jRRSrrHjH5DoZJpu6PYAWUBvrfP9p2ojzxQUs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690478312; x=1691083112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wk2vuhX6NA1oRdFPUtDZvRSgubu1bvTtFKVaGPcS2eM=; b=RfoBknQuqj+FKEtxBBVy/41x8dxkScCgb7Zk7kBz925auY45kTciym6uKf3k8X2aYC vG2rQesSVjmwdmiTVDsARYsUGowKr4McX89zoxIVjlmYdctN07zmzaWbtLUTZWq+aegf WX6u0eQvwadOpJldKvNgHHKkrswtdjOjjZR4KipqEC0DLRRk7Ro9HhiiVyu1s/gAr/+t 9cCAkJmxS7vr3Wa0K+O+TNWbnm+TjFxbtVA4UO3WZ0zSjzcApTanke3YofByDxAZxqec AZGVmY/nWQNhXsyotid3aPIK6xr0aZ0wrG9Q0jq32sCCPUb9dY5Aw73R8zyQDnxvia+4 phbA== X-Gm-Message-State: ABy/qLY28aOhrbRhTKwMo0/M+558fMO9q0Fm9NGcm8/CCs0FlCYN6lDX kyBOQiWCRUno4iSad+alCSAJgprPeOKlcYMJ32I= X-Google-Smtp-Source: APBJJlFGzINd+KHGdbpkLIsXy545tFo/TL/61IX1RAOVuTfN9pnaWw8Ruc6GFSu3fCSKKgGeQWarGQ== X-Received: by 2002:a05:6a20:1603:b0:133:17f1:6436 with SMTP id l3-20020a056a20160300b0013317f16436mr4169051pzj.19.1690478312683; Thu, 27 Jul 2023 10:18:32 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:2339:954b:b98f:611a]) by smtp.gmail.com with ESMTPSA id 17-20020aa79111000000b0064f76992905sm1702524pfh.202.2023.07.27.10.18.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 10:18:32 -0700 (PDT) From: Douglas Anderson To: Jiri Kosina , Benjamin Tissoires , Bjorn Andersson , Konrad Dybcio , Rob Herring , Frank Rowand , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: linux-arm-msm@vger.kernel.org, yangcong5@huaqin.corp-partner.google.com, devicetree@vger.kernel.org, Daniel Vetter , hsinyi@google.com, Chris Morgan , linux-input@vger.kernel.org, cros-qcom-dts-watchers@chromium.org, Dmitry Torokhov , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Douglas Anderson , Krzysztof Kozlowski Subject: [PATCH v4 01/11] dt-bindings: HID: i2c-hid: Add "panel" property to i2c-hid backed touchscreens Date: Thu, 27 Jul 2023 10:16:28 -0700 Message-ID: <20230727101636.v4.1.Id68e30343bb1e11470582a9078b086176cfec46b@changeid> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230727171750.633410-1-dianders@chromium.org> References: <20230727171750.633410-1-dianders@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org As talked about in the patch ("drm/panel: Add a way for other devices to follow panel state"), touchscreens that are connected to panels are generally expected to be power sequenced together with the panel they're attached to. Today, nothing provides information allowing you to find out that a touchscreen is connected to a panel. Let's add a phandle for this. The proerty is added to the generic touchscreen bindings and then enabled in the bindings for the i2c-hid backed devices. This can and should be added for other touchscreens in the future, but for now let's start small. Reviewed-by: Krzysztof Kozlowski Reviewed-by: Maxime Ripard Signed-off-by: Douglas Anderson --- (no changes since v2) Changes in v2: - Move the description to the generic touchscreen.yaml. - Update the desc to make it clearer it's only for integrated devices. Documentation/devicetree/bindings/input/elan,ekth6915.yaml | 5 +++++ .../devicetree/bindings/input/goodix,gt7375p.yaml | 5 +++++ Documentation/devicetree/bindings/input/hid-over-i2c.yaml | 2 ++ .../devicetree/bindings/input/touchscreen/touchscreen.yaml | 7 +++++++ 4 files changed, 19 insertions(+) diff --git a/Documentation/devicetree/bindings/input/elan,ekth6915.yaml b/Documentation/devicetree/bindings/input/elan,ekth6915.yaml index 05e6f2df604c..3e2d216c6432 100644 --- a/Documentation/devicetree/bindings/input/elan,ekth6915.yaml +++ b/Documentation/devicetree/bindings/input/elan,ekth6915.yaml @@ -13,6 +13,9 @@ description: Supports the Elan eKTH6915 touchscreen controller. This touchscreen controller uses the i2c-hid protocol with a reset GPIO. +allOf: + - $ref: /schemas/input/touchscreen/touchscreen.yaml# + properties: compatible: items: @@ -24,6 +27,8 @@ properties: interrupts: maxItems: 1 + panel: true + reset-gpios: description: Reset GPIO; not all touchscreens using eKTH6915 hook this up. diff --git a/Documentation/devicetree/bindings/input/goodix,gt7375p.yaml b/Documentation/devicetree/bindings/input/goodix,gt7375p.yaml index 1edad1da1196..358cb8275bf1 100644 --- a/Documentation/devicetree/bindings/input/goodix,gt7375p.yaml +++ b/Documentation/devicetree/bindings/input/goodix,gt7375p.yaml @@ -14,6 +14,9 @@ description: This touchscreen uses the i2c-hid protocol but has some non-standard power sequencing required. +allOf: + - $ref: /schemas/input/touchscreen/touchscreen.yaml# + properties: compatible: oneOf: @@ -30,6 +33,8 @@ properties: interrupts: maxItems: 1 + panel: true + reset-gpios: true diff --git a/Documentation/devicetree/bindings/input/hid-over-i2c.yaml b/Documentation/devicetree/bindings/input/hid-over-i2c.yaml index 7156b08f7645..138caad96a29 100644 --- a/Documentation/devicetree/bindings/input/hid-over-i2c.yaml +++ b/Documentation/devicetree/bindings/input/hid-over-i2c.yaml @@ -44,6 +44,8 @@ properties: description: HID descriptor address $ref: /schemas/types.yaml#/definitions/uint32 + panel: true + post-power-on-delay-ms: description: Time required by the device after enabling its regulators or powering it on, before it is ready for communication. diff --git a/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml b/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml index 895592da9626..431c13335c40 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml +++ b/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml @@ -10,6 +10,13 @@ maintainers: - Dmitry Torokhov properties: + panel: + description: If this touchscreen is integrally connected to a panel, this + is a reference to that panel. The presence of this reference indicates + that the touchscreen should be power sequenced together with the panel + and that they may share power and/or reset signals. + $ref: /schemas/types.yaml#/definitions/phandle + touchscreen-min-x: description: minimum x coordinate reported $ref: /schemas/types.yaml#/definitions/uint32 From patchwork Thu Jul 27 17:16:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 707185 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E14AC04FDF for ; Thu, 27 Jul 2023 17:18:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230105AbjG0RSt (ORCPT ); Thu, 27 Jul 2023 13:18:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232197AbjG0RSp (ORCPT ); Thu, 27 Jul 2023 13:18:45 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E719E2D75 for ; Thu, 27 Jul 2023 10:18:37 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-686efdeabaeso834796b3a.3 for ; Thu, 27 Jul 2023 10:18:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1690478317; x=1691083117; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sKObnOxhKS6BrIWcxa9f6gRD8GnowD5weOErK132RE4=; b=TGCEpmBdAiDZzUbKZ1yiuQQF3dg+jtHjEEvyqd5MbrCMqlscwgIoNuqTPWPH2D7y5t FULmn5cmb/O9VRm32jjyuq6BpqzsZTk7aVczoiPY2YzCCT9dyPzCCGtlsqRkJGAdgsTU 2Wsk1Llolg7ggNSfQzMOmLfQxcPq500Jo7ua8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690478317; x=1691083117; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sKObnOxhKS6BrIWcxa9f6gRD8GnowD5weOErK132RE4=; b=HhDV88em4ei3YokNTnAVE02Qf/Mkksr4tUhcMY1yC2QeYaJQnAcFO4UxvdXxaKITzO /Rhnqbk2fyQnSqg+3gmp7++pp6DJpOJvFTNdBhvwJDgIyO2/n/ypIh3nmsNLGnsd8C6X Gtarf1gqMzw7wjLU88qiDJlSomXXRk2/+xigqAC6hCUWM9x4U2ew4HxGVvzy4afO/MmS v4o5dD19C+BlG84Eclt5zjCemj3fj+3SelPKK7XUtzbao17nSUn7WY5B6wXdHhHorBqc xxYwxZOlVVumVnBSW60W2Of5NFF6+CrGwI9CmJuGPLbc3yaeghCLnYVaGZ4ZT39m/bKJ NZUw== X-Gm-Message-State: ABy/qLao7JsfrkxOeoDsmh0bC4ksNnYfdkLmsB1R8gSTh04c0t/a6+QP /aupgTLEiEfTvMbaMgx2hDx3Yg== X-Google-Smtp-Source: APBJJlFQol3YftBaC92yIC9CeLfOGhYg3TqHZzs92Jluyld+thUY/3PW8bGu+UCxnkp5uTQktkEK1A== X-Received: by 2002:a05:6a20:7d89:b0:133:712e:f700 with SMTP id v9-20020a056a207d8900b00133712ef700mr6187237pzj.51.1690478317166; Thu, 27 Jul 2023 10:18:37 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:2339:954b:b98f:611a]) by smtp.gmail.com with ESMTPSA id 17-20020aa79111000000b0064f76992905sm1702524pfh.202.2023.07.27.10.18.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 10:18:36 -0700 (PDT) From: Douglas Anderson To: Jiri Kosina , Benjamin Tissoires , Bjorn Andersson , Konrad Dybcio , Rob Herring , Frank Rowand , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: linux-arm-msm@vger.kernel.org, yangcong5@huaqin.corp-partner.google.com, devicetree@vger.kernel.org, Daniel Vetter , hsinyi@google.com, Chris Morgan , linux-input@vger.kernel.org, cros-qcom-dts-watchers@chromium.org, Dmitry Torokhov , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Douglas Anderson Subject: [PATCH v4 03/11] drm/panel: Add a way for other devices to follow panel state Date: Thu, 27 Jul 2023 10:16:30 -0700 Message-ID: <20230727101636.v4.3.Icd5f96342d2242051c754364f4bee13ef2b986d4@changeid> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230727171750.633410-1-dianders@chromium.org> References: <20230727171750.633410-1-dianders@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org These days, it's fairly common to see panels that have touchscreens attached to them. The panel and the touchscreen can somewhat be thought of as totally separate devices and, historically, this is how Linux has treated them. However, treating them as separate isn't necessarily the best way to model the two devices, it was just that there was no better way. Specifically, there is little practical reason to have the touchscreen powered on when the panel is turned off, but if we model the devices separately we have no way to keep the two devices' power states in sync with each other. The issue described above makes it sound as if the problem here is just about efficiency. We're wasting power keeping the touchscreen powered up when the screen is off. While that's true, the problem can go deeper. Specifically, hardware designers see that there's no reason to have the touchscreen on while the screen is off and then build hardware assuming that software would never turn the touchscreen on while the screen is off. In the very simplest case of hardware designs like this, the touchscreen and the panel share some power rails. In most cases, this turns out not to be terrible and is, again, just a little less efficient. Specifically if we tell Linux that the touchscreen and the panel are using the same rails then Linux will keep the rails on when _either_ device is turned on. That ends to work OK-ish, but now if you turn the panel off not only will the touchscreen remain powered, but the power rails for the panel itself won't be switched off, burning extra power. The above two inefficiencies are _extra_ minor when you consider the fact that laptops rarely spend much time with the screen off. The main use case would be when an external screen (and presumably a power supply) is attached. Unfortunately, it gets worse from here. On sc7180-trogdor-homestar, for instance, the display's TCON (timing controller) sometimes crashes if you don't power cycle it whenever you stop and restart the video stream (like during a modeset). The touchscreen keeping the power rails on causes real problems. One proposal in the homestar timeframe was to move the touchscreen to an always-on rail, dedicating the main power rail to the panel. That caused _different_ problems as talked about in commit 557e05fa9fdd ("HID: i2c-hid: goodix: Stop tying the reset line to the regulator"). The end result of all of this was to add an extra regulator to the board, increasing cost. Recently, Cong Yang posted a patch [1] where things are even worse. The panel and touch controller on that system seem even more intimately tied together and really can't be thought of separately. To address this issue, let's start allowing devices to register themselves as "panel followers". These devices will get called after a panel has been powered on and before a panel is powered off. This makes the panel the primary device in charge of the power state, which matches how userspace uses it. The panel follower API should be fairly straightforward to use. The current code assumes that panel followers are using device tree and have a "panel" property pointing to the panel to follow. More flexibility and non-DT implementations could be added as needed. Right now, panel followers can follow the prepare/unprepare functions. There could be arguments made that, instead, they should follow enable/disable. I've chosen prepare/unprepare for now since those functions are guaranteed to power up/power down the panel and it seems better to start the process earlier. A bit of explaining about why this is a roll-your-own API instead of using something more standard: 1. In standard APIs in Linux, parent devices are automatically powered on when a child needs power. Applying that here, it would mean that we'd force the panel on any time someone was listening to the touchscreen. That, unfortunately, would have broken homestar's need (if we hadn't changed the hardware, as per above) where the panel absolutely needs to be able to power cycle itself. While one could argue that homestar is broken hardware and we shouldn't have the API do backflips for it, _officially_ the eDP timing guidelines agree with homestar's needs and the panel power sequencing diagrams show power going off. It's nice to be able to support this. 2. We could, conceibably, try to add a new flag to device_link causing the parent to be in charge of power. Then we could at least use normal pm_runtime APIs. This sounds great, except that we run into problems with initial probe. As talked about in the later patch ("HID: i2c-hid: Support being a panel follower") the initial power on of a panel follower might need to do things (like add sub-devices) that aren't allowed in a runtime_resume function. The above complexities explain why this API isn't using common functions. That being said, this patch is very small and self-contained, so if someone was later able to adapt it to using more common APIs while solving the above issues then that could happen in the future. [1] https://lore.kernel.org/r/20230519032316.3464732-1-yangcong5@huaqin.corp-partner.google.com Reviewed-by: Maxime Ripard Signed-off-by: Douglas Anderson --- (no changes since v3) Changes in v3: - Add is_panel_follower() as a convenience for clients. Changes in v2: - Add even more text to the commit message. - A few comment cleanups. drivers/gpu/drm/drm_panel.c | 173 +++++++++++++++++++++++++++++++++++- include/drm/drm_panel.h | 80 +++++++++++++++++ 2 files changed, 249 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index 4e1c4e42575b..e814020bbcd3 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -58,6 +58,8 @@ void drm_panel_init(struct drm_panel *panel, struct device *dev, const struct drm_panel_funcs *funcs, int connector_type) { INIT_LIST_HEAD(&panel->list); + INIT_LIST_HEAD(&panel->followers); + mutex_init(&panel->follower_lock); panel->dev = dev; panel->funcs = funcs; panel->connector_type = connector_type; @@ -105,6 +107,7 @@ EXPORT_SYMBOL(drm_panel_remove); */ int drm_panel_prepare(struct drm_panel *panel) { + struct drm_panel_follower *follower; int ret; if (!panel) @@ -115,14 +118,27 @@ int drm_panel_prepare(struct drm_panel *panel) return 0; } + mutex_lock(&panel->follower_lock); + if (panel->funcs && panel->funcs->prepare) { ret = panel->funcs->prepare(panel); if (ret < 0) - return ret; + goto exit; } panel->prepared = true; - return 0; + list_for_each_entry(follower, &panel->followers, list) { + ret = follower->funcs->panel_prepared(follower); + if (ret < 0) + dev_info(panel->dev, "%ps failed: %d\n", + follower->funcs->panel_prepared, ret); + } + + ret = 0; +exit: + mutex_unlock(&panel->follower_lock); + + return ret; } EXPORT_SYMBOL(drm_panel_prepare); @@ -139,6 +155,7 @@ EXPORT_SYMBOL(drm_panel_prepare); */ int drm_panel_unprepare(struct drm_panel *panel) { + struct drm_panel_follower *follower; int ret; if (!panel) @@ -149,14 +166,27 @@ int drm_panel_unprepare(struct drm_panel *panel) return 0; } + mutex_lock(&panel->follower_lock); + + list_for_each_entry(follower, &panel->followers, list) { + ret = follower->funcs->panel_unpreparing(follower); + if (ret < 0) + dev_info(panel->dev, "%ps failed: %d\n", + follower->funcs->panel_unpreparing, ret); + } + if (panel->funcs && panel->funcs->unprepare) { ret = panel->funcs->unprepare(panel); if (ret < 0) - return ret; + goto exit; } panel->prepared = false; - return 0; + ret = 0; +exit: + mutex_unlock(&panel->follower_lock); + + return ret; } EXPORT_SYMBOL(drm_panel_unprepare); @@ -342,6 +372,141 @@ int of_drm_get_panel_orientation(const struct device_node *np, EXPORT_SYMBOL(of_drm_get_panel_orientation); #endif +/** + * drm_is_panel_follower() - Check if the device is a panel follower + * @dev: The 'struct device' to check + * + * This checks to see if a device needs to be power sequenced together with + * a panel using the panel follower API. + * At the moment panels can only be followed on device tree enabled systems. + * The "panel" property of the follower points to the panel to be followed. + * + * Return: true if we should be power sequenced with a panel; false otherwise. + */ +bool drm_is_panel_follower(struct device *dev) +{ + /* + * The "panel" property is actually a phandle, but for simplicity we + * don't bother trying to parse it here. We just need to know if the + * property is there. + */ + return of_property_read_bool(dev->of_node, "panel"); +} +EXPORT_SYMBOL(drm_is_panel_follower); + +/** + * drm_panel_add_follower() - Register something to follow panel state. + * @follower_dev: The 'struct device' for the follower. + * @follower: The panel follower descriptor for the follower. + * + * A panel follower is called right after preparing the panel and right before + * unpreparing the panel. It's primary intention is to power on an associated + * touchscreen, though it could be used for any similar devices. Multiple + * devices are allowed the follow the same panel. + * + * If a follower is added to a panel that's already been turned on, the + * follower's prepare callback is called right away. + * + * At the moment panels can only be followed on device tree enabled systems. + * The "panel" property of the follower points to the panel to be followed. + * + * Return: 0 or an error code. Note that -ENODEV means that we detected that + * follower_dev is not actually following a panel. The caller may + * choose to ignore this return value if following a panel is optional. + */ +int drm_panel_add_follower(struct device *follower_dev, + struct drm_panel_follower *follower) +{ + struct device_node *panel_np; + struct drm_panel *panel; + int ret; + + panel_np = of_parse_phandle(follower_dev->of_node, "panel", 0); + if (!panel_np) + return -ENODEV; + + panel = of_drm_find_panel(panel_np); + of_node_put(panel_np); + if (IS_ERR(panel)) + return PTR_ERR(panel); + + get_device(panel->dev); + follower->panel = panel; + + mutex_lock(&panel->follower_lock); + + list_add_tail(&follower->list, &panel->followers); + if (panel->prepared) { + ret = follower->funcs->panel_prepared(follower); + if (ret < 0) + dev_info(panel->dev, "%ps failed: %d\n", + follower->funcs->panel_prepared, ret); + } + + mutex_unlock(&panel->follower_lock); + + return 0; +} +EXPORT_SYMBOL(drm_panel_add_follower); + +/** + * drm_panel_remove_follower() - Reverse drm_panel_add_follower(). + * @follower: The panel follower descriptor for the follower. + * + * Undo drm_panel_add_follower(). This includes calling the follower's + * unprepare function if we're removed from a panel that's currently prepared. + * + * Return: 0 or an error code. + */ +void drm_panel_remove_follower(struct drm_panel_follower *follower) +{ + struct drm_panel *panel = follower->panel; + int ret; + + mutex_lock(&panel->follower_lock); + + if (panel->prepared) { + ret = follower->funcs->panel_unpreparing(follower); + if (ret < 0) + dev_info(panel->dev, "%ps failed: %d\n", + follower->funcs->panel_unpreparing, ret); + } + list_del_init(&follower->list); + + mutex_unlock(&panel->follower_lock); + + put_device(panel->dev); +} +EXPORT_SYMBOL(drm_panel_remove_follower); + +static void drm_panel_remove_follower_void(void *follower) +{ + drm_panel_remove_follower(follower); +} + +/** + * devm_drm_panel_add_follower() - devm version of drm_panel_add_follower() + * @follower_dev: The 'struct device' for the follower. + * @follower: The panel follower descriptor for the follower. + * + * Handles calling drm_panel_remove_follower() using devm on the follower_dev. + * + * Return: 0 or an error code. + */ +int devm_drm_panel_add_follower(struct device *follower_dev, + struct drm_panel_follower *follower) +{ + int ret; + + ret = drm_panel_add_follower(follower_dev, follower); + if (ret) + return ret; + + return devm_add_action_or_reset(follower_dev, + drm_panel_remove_follower_void, follower); +} +EXPORT_SYMBOL(devm_drm_panel_add_follower); + #if IS_REACHABLE(CONFIG_BACKLIGHT_CLASS_DEVICE) /** * drm_panel_of_backlight - use backlight device node for backlight diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index c6cf75909389..5ac67eeb0860 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -27,12 +27,14 @@ #include #include #include +#include struct backlight_device; struct dentry; struct device_node; struct drm_connector; struct drm_device; +struct drm_panel_follower; struct drm_panel; struct display_timing; @@ -144,6 +146,45 @@ struct drm_panel_funcs { void (*debugfs_init)(struct drm_panel *panel, struct dentry *root); }; +struct drm_panel_follower_funcs { + /** + * @panel_prepared: + * + * Called after the panel has been powered on. + */ + int (*panel_prepared)(struct drm_panel_follower *follower); + + /** + * @panel_unpreparing: + * + * Called before the panel is powered off. + */ + int (*panel_unpreparing)(struct drm_panel_follower *follower); +}; + +struct drm_panel_follower { + /** + * @funcs: + * + * Dependent device callbacks; should be initted by the caller. + */ + const struct drm_panel_follower_funcs *funcs; + + /** + * @list + * + * Used for linking into panel's list; set by drm_panel_add_follower(). + */ + struct list_head list; + + /** + * @panel + * + * The panel we're dependent on; set by drm_panel_add_follower(). + */ + struct drm_panel *panel; +}; + /** * struct drm_panel - DRM panel object */ @@ -189,6 +230,20 @@ struct drm_panel { */ struct list_head list; + /** + * @followers: + * + * A list of struct drm_panel_follower dependent on this panel. + */ + struct list_head followers; + + /** + * @followers_lock: + * + * Lock for followers list. + */ + struct mutex follower_lock; + /** * @prepare_prev_first: * @@ -246,6 +301,31 @@ static inline int of_drm_get_panel_orientation(const struct device_node *np, } #endif +#if defined(CONFIG_DRM_PANEL) +bool drm_is_panel_follower(struct device *dev); +int drm_panel_add_follower(struct device *follower_dev, + struct drm_panel_follower *follower); +void drm_panel_remove_follower(struct drm_panel_follower *follower); +int devm_drm_panel_add_follower(struct device *follower_dev, + struct drm_panel_follower *follower); +#else +static inline bool drm_is_panel_follower(struct device *dev) +{ + return false; +} +static inline int drm_panel_add_follower(struct device *follower_dev, + struct drm_panel_follower *follower) +{ + return -ENODEV; +} +static inline void drm_panel_remove_follower(struct drm_panel_follower *follower) { } +static inline int devm_drm_panel_add_follower(struct device *follower_dev, + struct drm_panel_follower *follower) +{ + return -ENODEV; +} +#endif + #if IS_ENABLED(CONFIG_DRM_PANEL) && (IS_BUILTIN(CONFIG_BACKLIGHT_CLASS_DEVICE) || \ (IS_MODULE(CONFIG_DRM) && IS_MODULE(CONFIG_BACKLIGHT_CLASS_DEVICE))) int drm_panel_of_backlight(struct drm_panel *panel); From patchwork Thu Jul 27 17:16:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 707184 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB0C4C04A94 for ; Thu, 27 Jul 2023 17:19:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232810AbjG0RTO (ORCPT ); Thu, 27 Jul 2023 13:19:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232851AbjG0RTA (ORCPT ); Thu, 27 Jul 2023 13:19:00 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 121973595 for ; Thu, 27 Jul 2023 10:18:42 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6862842a028so949321b3a.0 for ; Thu, 27 Jul 2023 10:18:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1690478322; x=1691083122; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZukR9CSekCYtKTsN6DxagPJbUeR97eyTc3MZVOC6Wus=; b=LehozSB0PkZqslyfeU+81VdLb4xGnBIE9Q91g2SB5mCOztpPoV+jzWyeJ3K7cQ3TXL 2NeRYQzg+J1oJlSjDSDkbLzzQnsFrlOGlm3rILR8Ze2X14LBOa3eZxq0zu4F64wbkVFX yH2Xb4Cezq3WnmRWxZ9n0P2ESlXBy8TiW2D0w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690478322; x=1691083122; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZukR9CSekCYtKTsN6DxagPJbUeR97eyTc3MZVOC6Wus=; b=CnvLrsRil7r2WJbLKfvg+nYVCTgSlRQqq8GabYfFwrJckRGQxd5ZI0C3Ngw+UJ1QM6 EKkpcNyDSVD+h3qBKOi/SC0yci07dEZOxUh4rqwouYp8ZMzHVrgecR8RwpsQR10CQ2Ot 0FWsZcr5AMJyhWvpXfER9oh+z4KVeK+vyZn3/MEkz46OFG+DHnRx3m9pPTmxuQXGcAwS Geg42kt8cyuZw7YIoB8tymj7JLmc4eyEV9y1gPXJ45pCqr+p/B8SHrq2l/mpZRXknjyp w94THm4bMwbtjL6FwM19mE30rTG3Y0J56hQS+PaXwWpkb3VCwKtqV4r1TrjzDbO7LwVI BL6A== X-Gm-Message-State: ABy/qLaSAje+xrp6NtJ6hnr1Y8WoYIAwCd2eTwAPWu5807fNxaeYBvjM by4Am/JdfU3FsfuWxBOJod4Jpg== X-Google-Smtp-Source: APBJJlFU5IsivI5lKrmtYzK327WL6rQ+XVbv/LZPTH5t4heMSRWyV0pSqGzifMaP7GSZQORTiy8paw== X-Received: by 2002:a05:6a20:1442:b0:134:6aff:ee6c with SMTP id a2-20020a056a20144200b001346affee6cmr6130826pzi.41.1690478322382; Thu, 27 Jul 2023 10:18:42 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:2339:954b:b98f:611a]) by smtp.gmail.com with ESMTPSA id 17-20020aa79111000000b0064f76992905sm1702524pfh.202.2023.07.27.10.18.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 10:18:41 -0700 (PDT) From: Douglas Anderson To: Jiri Kosina , Benjamin Tissoires , Bjorn Andersson , Konrad Dybcio , Rob Herring , Frank Rowand , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: linux-arm-msm@vger.kernel.org, yangcong5@huaqin.corp-partner.google.com, devicetree@vger.kernel.org, Daniel Vetter , hsinyi@google.com, Chris Morgan , linux-input@vger.kernel.org, cros-qcom-dts-watchers@chromium.org, Dmitry Torokhov , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Douglas Anderson Subject: [PATCH v4 05/11] HID: i2c-hid: Switch to SYSTEM_SLEEP_PM_OPS() Date: Thu, 27 Jul 2023 10:16:32 -0700 Message-ID: <20230727101636.v4.5.Ib2a2865bd3c0b068432259dfc7d76cebcbb512be@changeid> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230727171750.633410-1-dianders@chromium.org> References: <20230727171750.633410-1-dianders@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The SYSTEM_SLEEP_PM_OPS() allows us to get rid of '#ifdef CONFIG_PM_SLEEP', as talked about in commit 1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros, deprecate old ones"). This change is expected to have no functional effect. Reviewed-by: Maxime Ripard Signed-off-by: Douglas Anderson --- (no changes since v1) drivers/hid/i2c-hid/i2c-hid-core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c index efbba0465eef..19d985c20a5c 100644 --- a/drivers/hid/i2c-hid/i2c-hid-core.c +++ b/drivers/hid/i2c-hid/i2c-hid-core.c @@ -1085,7 +1085,6 @@ void i2c_hid_core_shutdown(struct i2c_client *client) } EXPORT_SYMBOL_GPL(i2c_hid_core_shutdown); -#ifdef CONFIG_PM_SLEEP static int i2c_hid_core_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); @@ -1138,10 +1137,9 @@ static int i2c_hid_core_resume(struct device *dev) return hid_driver_reset_resume(hid); } -#endif const struct dev_pm_ops i2c_hid_core_pm = { - SET_SYSTEM_SLEEP_PM_OPS(i2c_hid_core_suspend, i2c_hid_core_resume) + SYSTEM_SLEEP_PM_OPS(i2c_hid_core_suspend, i2c_hid_core_resume) }; EXPORT_SYMBOL_GPL(i2c_hid_core_pm); From patchwork Thu Jul 27 17:16:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 707183 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C182BC04A6A for ; Thu, 27 Jul 2023 17:19:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233080AbjG0RTY (ORCPT ); Thu, 27 Jul 2023 13:19:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233088AbjG0RTR (ORCPT ); Thu, 27 Jul 2023 13:19:17 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B59FC3A94 for ; Thu, 27 Jul 2023 10:18:47 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-686f38692b3so869499b3a.2 for ; Thu, 27 Jul 2023 10:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1690478327; x=1691083127; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8ons1xxta0swGIAnIwdRLlCbALo+n6y3A/0xk7/m1SU=; b=SfokiBwgQnt8UhhbFv5I1shWcGM9J5SI1rMbCj0QJ2N2vqxr7Tuu5yR7oE6v9wwfuN kwvYkGnN6vSgNPVrTQay3TAFNLA7ADB8mEpmllzNsG0WBMqyL7x99KmN7i5/aymLM6JJ MLsBMjLADes2LL7Erjs0MpyU/roI0hC714rrs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690478327; x=1691083127; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8ons1xxta0swGIAnIwdRLlCbALo+n6y3A/0xk7/m1SU=; b=Jm7zwhCOFqubmY0/sMou/4JpaQ2AmU7rLVwaF8puOgufhpmZhllDD/zee118InbuBE Odk+seaGR7XHuavmYdST/enrK3IPeqXspYxI0/G8RXXn32jAWENFdnaJPKhVHn/E2Auf xSzYRyGHNKmm0cCYkVFpKsPrhp9mGtgT9aBwNqxUxNpQlAZDD/NwKLJpiBi6eQHrLOId L1Iu/cpjlCOkZrCuYJRmVi5vOWjNfUr69DVpRErqLygsEmhAiejUszziZHezeK3gxLIw Ey7TST9jJXrcH433eIHwYXER3mpmw5+sh6UUz0aBG0AJaAJuhJYreze0EsBI+IVA1G19 Gbfw== X-Gm-Message-State: ABy/qLbLq4RJPPp6PZ3O+C4zqHKAOU7ZwS/PjQdQbe84+0FQMq/+h/RX BCH1bkpT/DOAEKVJiEaIbrlHdg== X-Google-Smtp-Source: APBJJlHHAckGoYXUBhl1ZEzMAmGRJ4AfIdxiVA8Y5wTk4SQjjqdn/7SMOjcbUUpyB2//G6nG0U78BA== X-Received: by 2002:a05:6300:8082:b0:120:1baf:e56e with SMTP id ap2-20020a056300808200b001201bafe56emr6349964pzc.19.1690478326828; Thu, 27 Jul 2023 10:18:46 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:2339:954b:b98f:611a]) by smtp.gmail.com with ESMTPSA id 17-20020aa79111000000b0064f76992905sm1702524pfh.202.2023.07.27.10.18.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 10:18:46 -0700 (PDT) From: Douglas Anderson To: Jiri Kosina , Benjamin Tissoires , Bjorn Andersson , Konrad Dybcio , Rob Herring , Frank Rowand , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: linux-arm-msm@vger.kernel.org, yangcong5@huaqin.corp-partner.google.com, devicetree@vger.kernel.org, Daniel Vetter , hsinyi@google.com, Chris Morgan , linux-input@vger.kernel.org, cros-qcom-dts-watchers@chromium.org, Dmitry Torokhov , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Douglas Anderson Subject: [PATCH v4 07/11] HID: i2c-hid: Make suspend and resume into helper functions Date: Thu, 27 Jul 2023 10:16:34 -0700 Message-ID: <20230727101636.v4.7.I5c9894789b8b02f029bf266ae9b4f43c7907a173@changeid> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230727171750.633410-1-dianders@chromium.org> References: <20230727171750.633410-1-dianders@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org In a future patch we'd like to be able to call the current i2c-hid suspend and resume functions from times other than system suspend. Move the functions higher up in the file and have them take a "struct i2c_hid" to make this simpler. We'll then add tiny wrappers of the functions for use with system suspend. This change is expected to have no functional effect. Reviewed-by: Maxime Ripard Signed-off-by: Douglas Anderson --- (no changes since v1) drivers/hid/i2c-hid/i2c-hid-core.c | 98 +++++++++++++++++------------- 1 file changed, 56 insertions(+), 42 deletions(-) diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c index d29e6421ecba..fa8a1ca43d7f 100644 --- a/drivers/hid/i2c-hid/i2c-hid-core.c +++ b/drivers/hid/i2c-hid/i2c-hid-core.c @@ -941,6 +941,57 @@ static void i2c_hid_core_shutdown_tail(struct i2c_hid *ihid) ihid->ops->shutdown_tail(ihid->ops); } +static int i2c_hid_core_suspend(struct i2c_hid *ihid) +{ + struct i2c_client *client = ihid->client; + struct hid_device *hid = ihid->hid; + int ret; + + ret = hid_driver_suspend(hid, PMSG_SUSPEND); + if (ret < 0) + return ret; + + /* Save some power */ + i2c_hid_set_power(ihid, I2C_HID_PWR_SLEEP); + + disable_irq(client->irq); + + if (!device_may_wakeup(&client->dev)) + i2c_hid_core_power_down(ihid); + + return 0; +} + +static int i2c_hid_core_resume(struct i2c_hid *ihid) +{ + struct i2c_client *client = ihid->client; + struct hid_device *hid = ihid->hid; + int ret; + + if (!device_may_wakeup(&client->dev)) + i2c_hid_core_power_up(ihid); + + enable_irq(client->irq); + + /* Instead of resetting device, simply powers the device on. This + * solves "incomplete reports" on Raydium devices 2386:3118 and + * 2386:4B33 and fixes various SIS touchscreens no longer sending + * data after a suspend/resume. + * + * However some ALPS touchpads generate IRQ storm without reset, so + * let's still reset them here. + */ + if (ihid->quirks & I2C_HID_QUIRK_RESET_ON_RESUME) + ret = i2c_hid_hwreset(ihid); + else + ret = i2c_hid_set_power(ihid, I2C_HID_PWR_ON); + + if (ret) + return ret; + + return hid_driver_reset_resume(hid); +} + /** * i2c_hid_core_initial_power_up() - First time power up of the i2c-hid device. * @ihid: The ihid object created during probe. @@ -1115,61 +1166,24 @@ void i2c_hid_core_shutdown(struct i2c_client *client) } EXPORT_SYMBOL_GPL(i2c_hid_core_shutdown); -static int i2c_hid_core_suspend(struct device *dev) +static int i2c_hid_core_pm_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct i2c_hid *ihid = i2c_get_clientdata(client); - struct hid_device *hid = ihid->hid; - int ret; - - ret = hid_driver_suspend(hid, PMSG_SUSPEND); - if (ret < 0) - return ret; - /* Save some power */ - i2c_hid_set_power(ihid, I2C_HID_PWR_SLEEP); - - disable_irq(client->irq); - - if (!device_may_wakeup(&client->dev)) - i2c_hid_core_power_down(ihid); - - return 0; + return i2c_hid_core_suspend(ihid); } -static int i2c_hid_core_resume(struct device *dev) +static int i2c_hid_core_pm_resume(struct device *dev) { - int ret; struct i2c_client *client = to_i2c_client(dev); struct i2c_hid *ihid = i2c_get_clientdata(client); - struct hid_device *hid = ihid->hid; - if (!device_may_wakeup(&client->dev)) - i2c_hid_core_power_up(ihid); - - enable_irq(client->irq); - - /* Instead of resetting device, simply powers the device on. This - * solves "incomplete reports" on Raydium devices 2386:3118 and - * 2386:4B33 and fixes various SIS touchscreens no longer sending - * data after a suspend/resume. - * - * However some ALPS touchpads generate IRQ storm without reset, so - * let's still reset them here. - */ - if (ihid->quirks & I2C_HID_QUIRK_RESET_ON_RESUME) - ret = i2c_hid_hwreset(ihid); - else - ret = i2c_hid_set_power(ihid, I2C_HID_PWR_ON); - - if (ret) - return ret; - - return hid_driver_reset_resume(hid); + return i2c_hid_core_resume(ihid); } const struct dev_pm_ops i2c_hid_core_pm = { - SYSTEM_SLEEP_PM_OPS(i2c_hid_core_suspend, i2c_hid_core_resume) + SYSTEM_SLEEP_PM_OPS(i2c_hid_core_pm_suspend, i2c_hid_core_pm_resume) }; EXPORT_SYMBOL_GPL(i2c_hid_core_pm); From patchwork Thu Jul 27 17:16:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 707182 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAC2CC0015E for ; Thu, 27 Jul 2023 17:19:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233193AbjG0RTi (ORCPT ); Thu, 27 Jul 2023 13:19:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232963AbjG0RTU (ORCPT ); Thu, 27 Jul 2023 13:19:20 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FA0F3C21 for ; Thu, 27 Jul 2023 10:18:52 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-686b91c2744so985001b3a.0 for ; Thu, 27 Jul 2023 10:18:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1690478331; x=1691083131; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qTjLKvAJKRYARtxEGmXcmS+50e9KsZIDbmBVT+yTLd4=; b=cgjtau07EB0L6iScTKTIih4sOJB9Qgk5TRR4QAZD/n6xFBTa6Q/I1/Kp8GsZwqJaCR j2AG93azPjA0+fI3WkkkKmR28V0z1yAfhfmGrDP66ebj/n0ORbWtzf19QnPY7cWcR8Sw H4z9yKbtbuyblDD5QpYqt8tjkhs2xkseOZWZE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690478331; x=1691083131; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qTjLKvAJKRYARtxEGmXcmS+50e9KsZIDbmBVT+yTLd4=; b=FMp+vLVvojppyyEo683CZjvPBYKnmj+AiX3kaLaa0mT1EMwGV6LKJwmbjplald/iMP Nl7JR03l2QeIzKCxvKgqIrTyF2mVXtYCuixJVzyWcddGQozvBlbQUiz86OvqphTeXJXm 3KTomM+saVXHd+YrmLFExeXfxByUeIDmEqVESxzE6vmppNFvSDOg6FNhLVLNpHXml0Xj xl3bs3q2ALsvG9sSj7qWz8oqE1hVzd6ShWdRBimrdT5dUsA3OQxNHaAvpbnBHgeuceOI 7f1Vk5jOhpgnimb6EEZe+IzYYD9BbzHmeBuuc+ZH50c3Gz5qCh1lK9IzcakMkSIMYK7j ZbnA== X-Gm-Message-State: ABy/qLYPdkRbTdBPM0Mck+RogZNZIEgmP31+7V7qSffWhNSN6XAKz0KO WrKx4j+5bVuMINQAgCaJAG2xkA== X-Google-Smtp-Source: APBJJlF5O5qMkAetDXxY84TEieeBDDuvvsjnnVkfJZ7tsdf256XvH96+hofEBj9f9uqEiOSkUEc7gA== X-Received: by 2002:a05:6a00:a1b:b0:684:b886:e392 with SMTP id p27-20020a056a000a1b00b00684b886e392mr6173282pfh.25.1690478331424; Thu, 27 Jul 2023 10:18:51 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:2339:954b:b98f:611a]) by smtp.gmail.com with ESMTPSA id 17-20020aa79111000000b0064f76992905sm1702524pfh.202.2023.07.27.10.18.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 10:18:50 -0700 (PDT) From: Douglas Anderson To: Jiri Kosina , Benjamin Tissoires , Bjorn Andersson , Konrad Dybcio , Rob Herring , Frank Rowand , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: linux-arm-msm@vger.kernel.org, yangcong5@huaqin.corp-partner.google.com, devicetree@vger.kernel.org, Daniel Vetter , hsinyi@google.com, Chris Morgan , linux-input@vger.kernel.org, cros-qcom-dts-watchers@chromium.org, Dmitry Torokhov , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Douglas Anderson Subject: [PATCH v4 09/11] HID: i2c-hid: Support being a panel follower Date: Thu, 27 Jul 2023 10:16:36 -0700 Message-ID: <20230727101636.v4.9.Ib1a98309c455cd7e26b931c69993d4fba33bbe15@changeid> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230727171750.633410-1-dianders@chromium.org> References: <20230727171750.633410-1-dianders@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 Signed-off-by: Douglas Anderson --- Changes in v4: - Move panel follower alternative checks to wrapper functions. - Rebase atop ("Suspend i2c-hid devices in remove"). Changes in v3: - Add "depends on DRM || !DRM" to Kconfig to avoid randconfig error. - Split more of the panel follower code out of the core. Changes in v2: - i2c_hid_core_panel_prepared() and ..._unpreparing() are now static. drivers/hid/i2c-hid/Kconfig | 2 + drivers/hid/i2c-hid/i2c-hid-core.c | 93 +++++++++++++++++++++++++++++- 2 files changed, 92 insertions(+), 3 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 diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c index 46658ed6380f..fc3087a983f5 100644 --- a/drivers/hid/i2c-hid/i2c-hid-core.c +++ b/drivers/hid/i2c-hid/i2c-hid-core.c @@ -38,6 +38,8 @@ #include #include +#include + #include "../hid-ids.h" #include "i2c-hid.h" @@ -107,6 +109,8 @@ struct i2c_hid { struct mutex reset_lock; struct i2chid_ops *ops; + struct drm_panel_follower panel_follower; + bool is_panel_follower; }; static const struct i2c_hid_quirks { @@ -993,7 +997,7 @@ static int i2c_hid_core_resume(struct i2c_hid *ihid) } /** - * i2c_hid_core_initial_power_up() - First time power up of the i2c-hid device. + * __do_i2c_hid_core_initial_power_up() - First time power up of the i2c-hid device. * @ihid: The ihid object created during probe. * * This function is called at probe time. @@ -1004,7 +1008,7 @@ static int i2c_hid_core_resume(struct i2c_hid *ihid) * * Return: 0 or error code. */ -static int i2c_hid_core_initial_power_up(struct i2c_hid *ihid) +static int __do_i2c_hid_core_initial_power_up(struct i2c_hid *ihid) { struct i2c_client *client = ihid->client; struct hid_device *hid = ihid->hid; @@ -1058,6 +1062,83 @@ static int i2c_hid_core_initial_power_up(struct i2c_hid *ihid) return ret; } +static int i2c_hid_core_panel_prepared(struct drm_panel_follower *follower) +{ + struct i2c_hid *ihid = container_of(follower, struct i2c_hid, panel_follower); + struct hid_device *hid = ihid->hid; + + /* + * hid->version is set on the first power up. If it's still zero then + * this is the first power on so we should perform initial power up + * steps. + */ + if (!hid->version) + return __do_i2c_hid_core_initial_power_up(ihid); + + return i2c_hid_core_resume(ihid); +} + +static int i2c_hid_core_panel_unpreparing(struct drm_panel_follower *follower) +{ + struct i2c_hid *ihid = container_of(follower, struct i2c_hid, panel_follower); + + return i2c_hid_core_suspend(ihid, true); +} + +static const struct drm_panel_follower_funcs i2c_hid_core_panel_follower_funcs = { + .panel_prepared = i2c_hid_core_panel_prepared, + .panel_unpreparing = i2c_hid_core_panel_unpreparing, +}; + +static int i2c_hid_core_register_panel_follower(struct i2c_hid *ihid) +{ + struct device *dev = &ihid->client->dev; + int ret; + + ihid->is_panel_follower = true; + ihid->panel_follower.funcs = &i2c_hid_core_panel_follower_funcs; + + /* + * If we're not in control of our own power up/power down then we can't + * do the logic to manage wakeups. Give a warning if a user thought + * that was possible then force the capability off. + */ + if (device_can_wakeup(dev)) { + dev_warn(dev, "Can't wakeup if following panel\n"); + device_set_wakeup_capable(dev, false); + } + + ret = drm_panel_add_follower(dev, &ihid->panel_follower); + if (ret) + return ret; + + return 0; +} + +static int i2c_hid_core_initial_power_up(struct i2c_hid *ihid) +{ + /* + * If we're a panel follower, we'll register and do our initial power + * up when the panel turns on; otherwise we do it right away. + */ + if (drm_is_panel_follower(&ihid->client->dev)) + return i2c_hid_core_register_panel_follower(ihid); + else + return __do_i2c_hid_core_initial_power_up(ihid); +} + +static void i2c_hid_core_final_power_down(struct i2c_hid *ihid) +{ + /* + * If we're a follower, the act of unfollowing will cause us to be + * powered down. Otherwise we need to manually do it. + */ + if (ihid->is_panel_follower) + drm_panel_remove_follower(&ihid->panel_follower); + else + i2c_hid_core_suspend(ihid, true); +} + int i2c_hid_core_probe(struct i2c_client *client, struct i2chid_ops *ops, u16 hid_descriptor_address, u32 quirks) { @@ -1143,7 +1224,7 @@ void i2c_hid_core_remove(struct i2c_client *client) struct i2c_hid *ihid = i2c_get_clientdata(client); struct hid_device *hid; - i2c_hid_core_suspend(ihid, true); + i2c_hid_core_final_power_down(ihid); hid = ihid->hid; hid_destroy_device(hid); @@ -1171,6 +1252,9 @@ static int i2c_hid_core_pm_suspend(struct device *dev) struct i2c_client *client = to_i2c_client(dev); struct i2c_hid *ihid = i2c_get_clientdata(client); + if (ihid->is_panel_follower) + return 0; + return i2c_hid_core_suspend(ihid, false); } @@ -1179,6 +1263,9 @@ static int i2c_hid_core_pm_resume(struct device *dev) struct i2c_client *client = to_i2c_client(dev); struct i2c_hid *ihid = i2c_get_clientdata(client); + if (ihid->is_panel_follower) + return 0; + return i2c_hid_core_resume(ihid); } From patchwork Thu Jul 27 17:16:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 707181 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B40DC0015E for ; Thu, 27 Jul 2023 17:19:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233339AbjG0RT4 (ORCPT ); Thu, 27 Jul 2023 13:19:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233321AbjG0RTX (ORCPT ); Thu, 27 Jul 2023 13:19:23 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D95E14208 for ; Thu, 27 Jul 2023 10:18:56 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-686ba29ccb1so756324b3a.1 for ; Thu, 27 Jul 2023 10:18:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1690478336; x=1691083136; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CaruT2MVnDt5o7TOPEFxtNglDYQfaqWPyFiMR9pTN4g=; b=hgdda686kZFO1vLHm1NDDQgKMGxF5OW+sQo6xsjQ7tAlKRQ7WakT0MGXqu4LMABAIP ou6Q8z90ihSUOsfDh/jx80PQcNvRNylZJxOtIK6Sqil7kXLPW/zQIpv3RwKpyXVUi0K/ 6ycwk7L+TIw7978Zphy4DbuOi2q9CE8msmui8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690478336; x=1691083136; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CaruT2MVnDt5o7TOPEFxtNglDYQfaqWPyFiMR9pTN4g=; b=QQnzAxbfZSwZ0MqOZCCDiJp2rwY9rIobPb8efVQPi+vsSdTG9g/hqA5OcnKIftsBjr LzVwrC+D8o1mEI0TRqrdetSPp1mXkr2HDythgBx3zFfsEDhgcb89JYt/own8bMQjeQb5 kAI0cYD67yyF+BCtOlWHtc51O7C8yzI889BdlQnvdDBVptB8p/9JpYJ3wJ6afbpUyBlN eTLlBpGAkzKK0iSuKHHazWp5B60/nScF64mPJ+yG3Y+tMS9m+gafYpyQTumqPNJYxDmf yGChSWtJTxoXCHMqi5eCX4+VIz6AxH0hOiFLNfx/5pGEWcguhBiCCN78LJp517CL+Mdh TKVA== X-Gm-Message-State: ABy/qLbQ4dyAwIb74AKP3imcMHm+K6m9A4lamXZ2GLRChxQGIsDdh25b lScV2BfYFVzrJLpo8HRyokpN+A== X-Google-Smtp-Source: APBJJlFsnm2DtG3enU/g8ilsDzl+1tCZj5F1uaYXmvXRTu62nGbTjnuOz1OJlDQDmUcWf3ay9wkdUQ== X-Received: by 2002:a05:6a00:3907:b0:668:7292:b2bc with SMTP id fh7-20020a056a00390700b006687292b2bcmr3313546pfb.10.1690478335986; Thu, 27 Jul 2023 10:18:55 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:2339:954b:b98f:611a]) by smtp.gmail.com with ESMTPSA id 17-20020aa79111000000b0064f76992905sm1702524pfh.202.2023.07.27.10.18.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 10:18:55 -0700 (PDT) From: Douglas Anderson To: Jiri Kosina , Benjamin Tissoires , Bjorn Andersson , Konrad Dybcio , Rob Herring , Frank Rowand , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: linux-arm-msm@vger.kernel.org, yangcong5@huaqin.corp-partner.google.com, devicetree@vger.kernel.org, Daniel Vetter , hsinyi@google.com, Chris Morgan , linux-input@vger.kernel.org, cros-qcom-dts-watchers@chromium.org, Dmitry Torokhov , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Douglas Anderson Subject: [PATCH v4 11/11] arm64: dts: qcom: sc7180: Link trogdor touchscreens to the panels Date: Thu, 27 Jul 2023 10:16:38 -0700 Message-ID: <20230727101636.v4.11.Ia06c340e3482563e6bfd3106ecd0d3139f173ca4@changeid> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230727171750.633410-1-dianders@chromium.org> References: <20230727171750.633410-1-dianders@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Let's provide the proper link from the touchscreen to the panel on trogdor devices where the touchscreen support it. This allows the OS to power sequence the touchscreen more properly. For the most part, this is just expected to marginally improve power consumption while the screen is off. However, in at least one trogdor model (wormdingler) it's suspected that this will fix some behavorial corner cases when the panel power cycles (like for a modeset) without the touchscreen power cycling. NOTE: some trogdor variants use touchscreens that don't (yet) support linking the touchscreen and the panel. Those variants are left alone. Reviewed-by: Maxime Ripard Signed-off-by: Douglas Anderson --- (no changes since v1) arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi | 1 + arch/arm64/boot/dts/qcom/sc7180-trogdor-homestar.dtsi | 1 + arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor.dtsi | 1 + arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom.dtsi | 1 + arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick.dtsi | 1 + arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler.dtsi | 1 + 6 files changed, 6 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi index 8b8ea8af165d..b4f328d3e1f6 100644 --- a/arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi @@ -104,6 +104,7 @@ ap_ts: touchscreen@5d { interrupt-parent = <&tlmm>; interrupts = <9 IRQ_TYPE_LEVEL_LOW>; + panel = <&panel>; reset-gpios = <&tlmm 8 GPIO_ACTIVE_LOW>; vdd-supply = <&pp3300_ts>; diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-homestar.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor-homestar.dtsi index b3ba23a88a0b..88aeb415bd5b 100644 --- a/arch/arm64/boot/dts/qcom/sc7180-trogdor-homestar.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor-homestar.dtsi @@ -116,6 +116,7 @@ ap_ts: touchscreen@14 { interrupt-parent = <&tlmm>; interrupts = <9 IRQ_TYPE_LEVEL_LOW>; + panel = <&panel>; reset-gpios = <&tlmm 8 GPIO_ACTIVE_LOW>; vdd-supply = <&pp3300_touch>; diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor.dtsi index 269007d73162..c65f18ea3e5c 100644 --- a/arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor.dtsi @@ -43,6 +43,7 @@ ap_ts: touchscreen@10 { interrupt-parent = <&tlmm>; interrupts = <9 IRQ_TYPE_LEVEL_LOW>; + panel = <&panel>; post-power-on-delay-ms = <20>; hid-descr-addr = <0x0001>; diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom.dtsi index 6c5287bd27d6..d2aafd1ea672 100644 --- a/arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom.dtsi @@ -102,6 +102,7 @@ ap_ts: touchscreen@10 { interrupt-parent = <&tlmm>; interrupts = <9 IRQ_TYPE_LEVEL_LOW>; + panel = <&panel>; post-power-on-delay-ms = <20>; hid-descr-addr = <0x0001>; diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick.dtsi index 62ab6427dd65..e5d6a7898f8c 100644 --- a/arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick.dtsi @@ -69,6 +69,7 @@ ap_ts: touchscreen@10 { interrupt-parent = <&tlmm>; interrupts = <9 IRQ_TYPE_LEVEL_LOW>; + panel = <&panel>; post-power-on-delay-ms = <20>; hid-descr-addr = <0x0001>; diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler.dtsi index 2efa8a4bcda6..0e2b4d06b490 100644 --- a/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler.dtsi @@ -123,6 +123,7 @@ ap_ts: touchscreen@1 { interrupt-parent = <&tlmm>; interrupts = <9 IRQ_TYPE_EDGE_FALLING>; + panel = <&panel>; post-power-on-delay-ms = <70>; hid-descr-addr = <0x0001>;