From patchwork Wed Jun 7 21:49:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10452 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp503969vqr; Wed, 7 Jun 2023 14:54:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Xsp/0dGdqe/Z9l5AEIJcbf3jITKjtB8BAzTjt3EpIU5LFlycbby8NUUFFPxbN7ZiKUGP6 X-Received: by 2002:a05:6a20:104a:b0:105:27c3:1bfc with SMTP id gt10-20020a056a20104a00b0010527c31bfcmr2504656pzc.51.1686174870494; Wed, 07 Jun 2023 14:54:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686174870; cv=none; d=google.com; s=arc-20160816; b=jnagSkxIv5+zEjemoz5O7MYR/8YLcJsc0q9HGUwtgWDhL6zBFXKpV84ImaLpydHlVV lKqrYeKlUHsOaG6Qz6epQRWhi+tWTEhbSk++cD3eL5tm7vuYHdQd2rzh4o/j6FDCGnK9 dFxe3AD+heMGXQxf/3BubWJkSti9PXzGIAkc4WGVFcooS/0w/wioXbRhTN9YSaylholG 26FBSqwUZBjw5Yyicr8aPQtaRjKQh3PQ3ZjIjzzNuFhlCw9joYCZBoo7LWYBYG8Va/sO jBdxMogAAcySon6qkxLw5yZfl7fvzP3WRGo2s5ki5etNXYNyiRszjFCRMVqodzQ4uLW+ lHMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=zyvg8QoYW74O3dONADg7EXfdyKnd4yv7Gmv6YiJL6Jc=; b=Nb9c5YZxmARojeqkB5ovmBTxWCDlAONnvTULg6pjEgcNx0XO/3IVsLvqlYgXMhJ1LV vBkURZ4FdJLjwwqbpdoJc/WGJmpJimjEX/8TMsa4TD8SkfdSOdQrOHV5nlsGUBz2hCxJ 8YQiQQ9CcFvJJrMQ5A9xGEfbYKrEyocr6PsLafQ29R0qQT1An+qx0yvs1+W4WC6z0Xx4 aB9QtY8bvqEYRd/23r/gddg4TTzdVYzNs8Y7IM6lh73Edhy8EVSl8d5q64lalP2MrK84 zDx89cCPPnOBewwTqOIytx4+aUsW9BSS/ujE+44V1YJh/SHjnCCS24wPnieCR0Xphz37 LybQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=iePh4xT2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot15-20020a17090b3b4f00b00246bd5445d7si1682735pjb.104.2023.06.07.14.54.17; Wed, 07 Jun 2023 14:54:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=iePh4xT2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231895AbjFGVxK (ORCPT + 99 others); Wed, 7 Jun 2023 17:53:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229584AbjFGVxI (ORCPT ); Wed, 7 Jun 2023 17:53:08 -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 1FCD9184 for ; Wed, 7 Jun 2023 14:53:07 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-653fcd58880so3274710b3a.0 for ; Wed, 07 Jun 2023 14:53:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1686174786; x=1688766786; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zyvg8QoYW74O3dONADg7EXfdyKnd4yv7Gmv6YiJL6Jc=; b=iePh4xT2Yhrear5qpZ3eugazHSxMjjqSEgKmar+Ut8XG0gUXqV3+DPWIWO09stke09 0sr+XWhd8OagjvtCkuJCoF6Om04OkLWuToCO2Gt6TAD4ec0pmpgF/GmtqJihDHZ8KABU x8jE5yePkFVZ6kuRL45vOx05NhD4JAgE/H3Zk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686174786; x=1688766786; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zyvg8QoYW74O3dONADg7EXfdyKnd4yv7Gmv6YiJL6Jc=; b=XN7cxXjZJFMFC/3ymRIteSYrH00wbeuYM0R7rXTCn2VZcfhFGUf0AM/Uc0NM4wshPn fYXlI6tet26bnCB5EE7UDNVUmwGYMFjkV++OKrTr0CmoBP6OwZl6lp/DvBSyPW4E5M9V cgtteFibMcEImFL4JXQ/IoY1WZS5/DXN69zNE7ftG6dDbqhUOQoaqP+Gg1TWEtnSk1Qq VCq0ggwjAqMXu+HlpFT5ulEgGf1lAP46nfcn2/2p/NJZF04E/b9sr+FNGsk8JjL3Xf4D G9hqTiyhqFNV9Ns9Ee9YCZBqOQ9MAONREnr7Zwc7/Uyb67atnxe23q/nLo3UIXtxPPnb VYTw== X-Gm-Message-State: AC+VfDxDDYNqnuQk54b2XIqT266AWkFtJRHrSEQmXjKmwmXdEdTDL1Xc aoKiU3nbwP8k2Hnjr+rlZuSRPg== X-Received: by 2002:a05:6a20:9384:b0:10b:f590:5a26 with SMTP id x4-20020a056a20938400b0010bf5905a26mr2885518pzh.26.1686174786491; Wed, 07 Jun 2023 14:53:06 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:34b2:b638:6b53:f6c2]) by smtp.gmail.com with ESMTPSA id j25-20020aa78d19000000b0065dd1e7c2c1sm1376486pfe.63.2023.06.07.14.53.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 14:53:05 -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: dri-devel@lists.freedesktop.org, Dmitry Torokhov , linux-input@vger.kernel.org, Daniel Vetter , linux-kernel@vger.kernel.org, hsinyi@google.com, cros-qcom-dts-watchers@chromium.org, devicetree@vger.kernel.org, yangcong5@huaqin.corp-partner.google.com, linux-arm-msm@vger.kernel.org, Chris Morgan , Douglas Anderson Subject: [PATCH v2 00/10] drm/panel and i2c-hid: Allow panels and touchscreens to power sequence together Date: Wed, 7 Jun 2023 14:49:22 -0700 Message-ID: <20230607215224.2067679-1-dianders@chromium.org> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768082500631527383?= X-GMAIL-MSGID: =?utf-8?q?1768082500631527383?= The big motivation for this patch series is mostly described in the patch ("drm/panel: Add a way for other devices to follow panel state"), but to quickly summarize here: for touchscreens that are connected to a panel we need the ability to power sequence the two device together. This is not a new need, but so far we've managed to get by through a combination of inefficiency, added costs, or perhaps just a little bit of brokenness. It's time to do better. This patch series allows us to do better. Assuming that people think this patch series looks OK, we'll have to figure out the right way to land it. The panel patches and i2c-hid patches will go through very different trees and so either we'll need an Ack from one side or the other or someone to create a tag for the other tree to pull in. This will _probably_ require the true drm-misc maintainers to get involved, not a lowly committer. ;-) Version 2 of this patch series doesn't change too much. At a high level: * I added all the forgotten "static" to functions. * I've hopefully made the bindings better. * I've integrated into fw_devlink. * I cleaned up a few descriptions / comments. This still needs someone to say that the idea looks OK or to suggest an alternative that solves the problems. ;-) Changes in v2: - Move the description to the generic touchscreen.yaml. - Update the desc to make it clearer it's only for integrated devices. - Add even more text to the commit message. - A few comment cleanups. - ("Add a devlink for panel followers") new for v2. - i2c_hid_core_initial_power_up() is now static. - i2c_hid_core_panel_prepared() and ..._unpreparing() are now static. - ihid_core_panel_prepare_work() is now static. - Improve documentation for smp_wmb(). Douglas Anderson (10): dt-bindings: HID: i2c-hid: Add "panel" property to i2c-hid backed touchscreens drm/panel: Check for already prepared/enabled in drm_panel drm/panel: Add a way for other devices to follow panel state of: property: fw_devlink: Add a devlink for panel followers HID: i2c-hid: Switch to SYSTEM_SLEEP_PM_OPS() HID: i2c-hid: Rearrange probe() to power things up later HID: i2c-hid: Make suspend and resume into helper functions HID: i2c-hid: Support being a panel follower HID: i2c-hid: Do panel follower work on the system_wq arm64: dts: qcom: sc7180: Link trogdor touchscreens to the panels .../bindings/input/elan,ekth6915.yaml | 5 + .../bindings/input/goodix,gt7375p.yaml | 5 + .../bindings/input/hid-over-i2c.yaml | 2 + .../input/touchscreen/touchscreen.yaml | 7 + .../boot/dts/qcom/sc7180-trogdor-coachz.dtsi | 1 + .../dts/qcom/sc7180-trogdor-homestar.dtsi | 1 + .../boot/dts/qcom/sc7180-trogdor-lazor.dtsi | 1 + .../boot/dts/qcom/sc7180-trogdor-pompom.dtsi | 1 + .../qcom/sc7180-trogdor-quackingstick.dtsi | 1 + .../dts/qcom/sc7180-trogdor-wormdingler.dtsi | 1 + drivers/gpu/drm/drm_panel.c | 196 +++++++++- drivers/hid/i2c-hid/i2c-hid-core.c | 338 +++++++++++++----- drivers/of/property.c | 2 + include/drm/drm_panel.h | 89 +++++ 14 files changed, 555 insertions(+), 95 deletions(-)