From patchwork Tue Nov 28 08:42:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 170629 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3769747vqx; Tue, 28 Nov 2023 00:46:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJvgvKzP+jm05H9kg28i/uTMLzyZlp+mDB7njVgvsaiN3JS+K5ijd/yqSZP3jr4xIZELqn X-Received: by 2002:a05:6a00:3922:b0:6cb:4c84:43ce with SMTP id fh34-20020a056a00392200b006cb4c8443cemr18261273pfb.34.1701161192496; Tue, 28 Nov 2023 00:46:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701161192; cv=none; d=google.com; s=arc-20160816; b=nKPad9kdmvrO2N5eN4bDEkUnSIQRQ1Jd2iG6rd6up4lf21RKy9l0IJnPq1b8skMpzB gwJoaQmyZC7aK6/koRL/VYgh8RFYQky9vtj8dLZerkrw0XMfFMqlXA+idQjOYPw5ZALt mfGU9nHXcybHK1zXucGkXsTzxXqjezkArc0FT0Kgr4yAdFsZDSYBGakHgFSCd5uveXHw fg2ZfVz3nmAYFk8sAnxa2SdvK+TxHqDTiYd+Dol+ajS/ulytD6DCMFXDnwbhBjocCgGo n/jfEodXdKmAqvPOiCrNmL3Np1YCdGUxJJjUV84OjC0fqLoBEOTULbRze1pbzqANkGQw hxVg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kHxxwveZDRAPnfOWumxXktb5k7NbUjKgtDpJO55ZaA8=; fh=8QP7fVOWLSDOp8hxtrSQbFKqGDfCbAKvH6yY7D4IGkc=; b=yoytk/xb36Ek5/Prtq9d13x4YeOp4UHJZ2cdBN38vlJ2zjXqCIo9m8/FEtL+WF+UC7 SIGiptBDEJEehfet5UZuUGwcquhlvg2Uo/fOIBpUDSUijfISsn/S8kOr201PDqGhaRkf IAucpoYq7r302fEU8WtGIeevJ8wUoHlbtiZGuj8H2HO+xBpZFFmpv1byYTFqXxwqrwl0 PoCyLvLF/SyifD7YMoDpXbb4QIZdmxp2qkC6FHsvA7n+kCh4uQyPonjPb7QAzBiE3Dfb Z++IafC/4R0CzXVyi3EwdJGpCML8pu0uQbUmjDdwYYqvnTCeWNqYgSxZQKLXev2NZYuo xeFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PVg+vAbG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id bd33-20020a056a0027a100b006cbee3a0c06si10741693pfb.6.2023.11.28.00.46.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 00:46:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PVg+vAbG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id B4A9F808D681; Tue, 28 Nov 2023 00:45:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344237AbjK1IpJ (ORCPT + 99 others); Tue, 28 Nov 2023 03:45:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344225AbjK1IpB (ORCPT ); Tue, 28 Nov 2023 03:45:01 -0500 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A51411AD for ; Tue, 28 Nov 2023 00:45:06 -0800 (PST) Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1cf80a7be0aso44338115ad.1 for ; Tue, 28 Nov 2023 00:45:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1701161106; x=1701765906; darn=vger.kernel.org; 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=kHxxwveZDRAPnfOWumxXktb5k7NbUjKgtDpJO55ZaA8=; b=PVg+vAbG5Eli/fKzjnqSzq3QEwBSoaN9bOYtemv4oCkYgNDbXV7U2P5Sz7GwuxRSwY cAWt8nh6n4Jqufzl4cYLtzzmNGOkzTHSGqJkWIWElJlOwJPUV59MYPgi9Qy0+oqrYyZb EBV/JQsIk7XOGsrA7Mavoiqn8zqa1sW9x2hnk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701161106; x=1701765906; 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=kHxxwveZDRAPnfOWumxXktb5k7NbUjKgtDpJO55ZaA8=; b=ukaq3rAONqQmiJWBELbdIpktbYzc+pTj8D/aiJvd267uzFiZz2ZsSHyvTISLtxt3Ob U1ztTP/xXEtcyD+e5Gt35ic5QmSyp1MZkxPSUVo01YwXa0t5iDz6Tegs0jy2d6qu/0Gz Bb6DwS15+U8uxVQH7K1cZ7y7tSxswgmE30bgKFREYCeZh1xavYjqYXKEG1r/oeb5ndTX xmuTcL/7qVZA1TR5ogPOtn/8aRxVEkw+STa1YCc8aKV5duUxqY5I2obE2vXA0PeIdPgX ldhwQ6LHi5DLR1UVSo6766AxXuwElO2AcfkjiV2xTZuAagVXFpX6WhM8huBaWz8Kmn5P Jn0A== X-Gm-Message-State: AOJu0YzN1hixZu1SzZh+HxUR6P/FmhMQdU3t19Th8nptLtAoqSaltaMq ZCU62IIOvp1OujGDGe9zXaJfxw== X-Received: by 2002:a17:902:d2c1:b0:1cf:ccc3:c9d7 with SMTP id n1-20020a170902d2c100b001cfccc3c9d7mr7924520plc.3.1701161106024; Tue, 28 Nov 2023 00:45:06 -0800 (PST) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:a990:1e95:a915:9c70]) by smtp.gmail.com with ESMTPSA id j1-20020a170902c08100b001ab39cd875csm8358074pld.133.2023.11.28.00.45.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 00:45:05 -0800 (PST) From: Chen-Yu Tsai To: Rob Herring , Frank Rowand , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Wolfram Sang , Benson Leung , Tzung-Bi Shih Cc: Chen-Yu Tsai , chrome-platform@lists.linux.dev, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Douglas Anderson , Johan Hovold , Hsin-Yi Wang , Dmitry Torokhov , andriy.shevchenko@linux.intel.com, Jiri Kosina , linus.walleij@linaro.org, broonie@kernel.org, gregkh@linuxfoundation.org, hdegoede@redhat.com, james.clark@arm.com, james@equiv.tech, keescook@chromium.org, rafael@kernel.org, tglx@linutronix.de, Jeff LaBundy , linux-input@vger.kernel.org, linux-i2c@vger.kernel.org Subject: [RFC PATCH v3 1/5] of: dynamic: Add of_changeset_update_prop_string Date: Tue, 28 Nov 2023 16:42:30 +0800 Message-ID: <20231128084236.157152-2-wenst@chromium.org> X-Mailer: git-send-email 2.43.0.rc1.413.gea7ed67945-goog In-Reply-To: <20231128084236.157152-1-wenst@chromium.org> References: <20231128084236.157152-1-wenst@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 28 Nov 2023 00:45:20 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783796799058818588 X-GMAIL-MSGID: 1783796799058818588 Add a helper function to add string property updates to an OF changeset. This is similar to of_changeset_add_prop_string(), but instead of adding the property (and failing if it exists), it will update the property. This shall be used later in the DT hardware prober. Signed-off-by: Chen-Yu Tsai --- New patch added in v3. --- drivers/of/dynamic.c | 47 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/of.h | 3 +++ 2 files changed, 50 insertions(+) diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c index f63250c650ca..d22aad938667 100644 --- a/drivers/of/dynamic.c +++ b/drivers/of/dynamic.c @@ -1039,3 +1039,50 @@ int of_changeset_add_prop_u32_array(struct of_changeset *ocs, return ret; } EXPORT_SYMBOL_GPL(of_changeset_add_prop_u32_array); + +static int of_changeset_update_prop_helper(struct of_changeset *ocs, + struct device_node *np, + const struct property *pp) +{ + struct property *new_pp; + int ret; + + new_pp = __of_prop_dup(pp, GFP_KERNEL); + if (!new_pp) + return -ENOMEM; + + ret = of_changeset_update_property(ocs, np, new_pp); + if (ret) { + kfree(new_pp->name); + kfree(new_pp->value); + kfree(new_pp); + } + + return ret; +} + +/** + * of_changeset_update_prop_string - Add a string property update to a changeset + * + * @ocs: changeset pointer + * @np: device node pointer + * @prop_name: name of the property to be updated + * @str: pointer to null terminated string + * + * Create a string property to be updated and add it to a changeset. + * + * Return: 0 on success, a negative error value in case of an error. + */ +int of_changeset_update_prop_string(struct of_changeset *ocs, + struct device_node *np, + const char *prop_name, const char *str) +{ + struct property prop; + + prop.name = (char *)prop_name; + prop.length = strlen(str) + 1; + prop.value = (void *)str; + + return of_changeset_update_prop_helper(ocs, np, &prop); +} +EXPORT_SYMBOL_GPL(of_changeset_update_prop_string); diff --git a/include/linux/of.h b/include/linux/of.h index 6a9ddf20e79a..c69bc7da380e 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -1601,6 +1601,9 @@ static inline int of_changeset_add_prop_u32(struct of_changeset *ocs, { return of_changeset_add_prop_u32_array(ocs, np, prop_name, &val, 1); } +int of_changeset_update_prop_string(struct of_changeset *ocs, + struct device_node *np, + const char *prop_name, const char *str); #else /* CONFIG_OF_DYNAMIC */ static inline int of_reconfig_notifier_register(struct notifier_block *nb) From patchwork Tue Nov 28 08:42:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 170626 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3769486vqx; Tue, 28 Nov 2023 00:45:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IHr1uSoLOlNgXHDej24yUW1J1kCoYmGpovwwhUQ1hzPY2Qr5O2ZstSZVyoolISrcBylyc1G X-Received: by 2002:a05:6a00:1797:b0:6be:334c:6fd1 with SMTP id s23-20020a056a00179700b006be334c6fd1mr18121669pfg.26.1701161155293; Tue, 28 Nov 2023 00:45:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701161155; cv=none; d=google.com; s=arc-20160816; b=jD8RNRW3itIwtlciF/eq8hEsjY1S+X7t/3answ/uj4+cqnucYLN6fyjGCqwdOXOl7C 9+Wo3yTg6olOHYCCw9w4my6czUV3JSA/TvxL2WGmWUERCCf+2wl3TvUc2X8UzBsjzrEM XKfIqjOH+FgrkafxI9/qFkKOMnNj4lHSid3B2TT07vkrhP1l+w1wNPiUpwYQGjz1qg7V 0t2/q3ZdPzQwx9OMUdbzHVxvP/OpRN4ZtbquPCBxh+93LhQJHkD0fBIjFz4jZ2dpBGFJ 9fW1fIFX1S6LK3Wj1QnQaaMN2z2PyMQCuOO6Ra5mFGX/hnkt6QYDDr8RWFXCv6XBvxhQ LnXA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rrIzkF3BPgnSgOC4+jRg+GY/s6tE7F98s9pAwcg2bLw=; fh=8QP7fVOWLSDOp8hxtrSQbFKqGDfCbAKvH6yY7D4IGkc=; b=iiqrfqU2yAvJeFQyhkzeNkVq4JjhAVGkN0gFj9IbJ25DG3Y6Y6UmuCNfdKzc5mfL0d AYLyQdmfC7jGqDgpOtNgWF1nECHN/qP3GK0zL2cx1A1T+b/jBCkglq0xyw3NVXoRnIXG orVrZxrhbvMWHUYpnCQKIj97Wa8oG3Dr6z7lEyWn9bPLn8TBf9qiMz+N0K+wUMI9vmek HMJ2iJeSZ+sREIzQLD+n7/7k9ATjI2QM9dfQ1ue+VzcHPZtkLb6rEJ7m5kx3wBRsEIdx /6VrRUNVLoTFOgXo67HGJAGFO3Omm6uSiabncSx8xUKxI3E7/Eo7wqBaLD+fXjSo+Bp3 m62g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gmHJQWie; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id o16-20020a056a0015d000b006cb83204cffsi12052068pfu.256.2023.11.28.00.45.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 00:45:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gmHJQWie; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id DD6D3809B751; Tue, 28 Nov 2023 00:45:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344289AbjK1IpV (ORCPT + 99 others); Tue, 28 Nov 2023 03:45:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344247AbjK1IpG (ORCPT ); Tue, 28 Nov 2023 03:45:06 -0500 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D50FBD5B for ; Tue, 28 Nov 2023 00:45:11 -0800 (PST) Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1ce3084c2d1so43288635ad.3 for ; Tue, 28 Nov 2023 00:45:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1701161111; x=1701765911; darn=vger.kernel.org; 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=rrIzkF3BPgnSgOC4+jRg+GY/s6tE7F98s9pAwcg2bLw=; b=gmHJQWieuKvv+lZayWffijw/IQ+TkyU2V+mDe5qluwQihRNeS0D4D/H9HEOvqYZWNi tzgSxYTj75/rmyctOyeQEf3EHZnqmB0BX7RiYVAdZohgqHUn+9yMdxMFkl2skvL9GUdT euFhX+aMC+2R66t6wban6eLSmjopA0XgKWiCE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701161111; x=1701765911; 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=rrIzkF3BPgnSgOC4+jRg+GY/s6tE7F98s9pAwcg2bLw=; b=qCfWrwFP+EloIBrw/VVkEXdyMMLMHzxmKhwPZwW8tFZp7astNVB8Lm8ZyQMg2+qgjl qjV4n80mvQmo4WI4J9wSJ40Rdr5LN88XFR5XntSW3Lha0ca1Z1On+rI7axprDvr87U50 LLFMOzMueZzdx+MSydtt97lBtjrfO0jOSkTOpF+lRrjU6ctvBP7ETd0O4c/kYAzMMMra cw4Tuyv3YhjBelY0KCdldXDeqNLaEVhT9At5birORzvCWoC28Yg+WPDc64VFK7P/QViK mJIq7fOrmKTFNDcmCk3+xy7zOY7Qsummtj5pAmOgyPOw7JkyjMeZjAP4UOcBzTUv/cFX hoAg== X-Gm-Message-State: AOJu0Yzo6coLp24TMdZPlwpPpxqOUtvXSNqXEcWPHjITXBpVxWj/bmCa 1IBaPIb8M1wCFdCj4Bg+qpAvIg== X-Received: by 2002:a17:903:1ce:b0:1cf:c518:fa39 with SMTP id e14-20020a17090301ce00b001cfc518fa39mr7406158plh.19.1701161111196; Tue, 28 Nov 2023 00:45:11 -0800 (PST) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:a990:1e95:a915:9c70]) by smtp.gmail.com with ESMTPSA id j1-20020a170902c08100b001ab39cd875csm8358074pld.133.2023.11.28.00.45.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 00:45:10 -0800 (PST) From: Chen-Yu Tsai To: Rob Herring , Frank Rowand , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Wolfram Sang , Benson Leung , Tzung-Bi Shih Cc: Chen-Yu Tsai , chrome-platform@lists.linux.dev, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Douglas Anderson , Johan Hovold , Hsin-Yi Wang , Dmitry Torokhov , andriy.shevchenko@linux.intel.com, Jiri Kosina , linus.walleij@linaro.org, broonie@kernel.org, gregkh@linuxfoundation.org, hdegoede@redhat.com, james.clark@arm.com, james@equiv.tech, keescook@chromium.org, rafael@kernel.org, tglx@linutronix.de, Jeff LaBundy , linux-input@vger.kernel.org, linux-i2c@vger.kernel.org Subject: [RFC PATCH v3 2/5] i2c: of: Introduce component probe function Date: Tue, 28 Nov 2023 16:42:31 +0800 Message-ID: <20231128084236.157152-3-wenst@chromium.org> X-Mailer: git-send-email 2.43.0.rc1.413.gea7ed67945-goog In-Reply-To: <20231128084236.157152-1-wenst@chromium.org> References: <20231128084236.157152-1-wenst@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 28 Nov 2023 00:45:35 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783796759854912563 X-GMAIL-MSGID: 1783796759854912563 Some devices are designed and manufactured with some components having multiple drop-in replacement options. These components are often connected to the mainboard via ribbon cables, having the same signals and pin assignments across all options. These may include the display panel and touchscreen on laptops and tablets, and the trackpad on laptops. Sometimes which component option is used in a particular device can be detected by some firmware provided identifier, other times that information is not available, and the kernel has to try to probe each device. This change attempts to make the "probe each device" case cleaner. The current approach is to have all options added and enabled in the device tree. The kernel would then bind each device and run each driver's probe function. This works, but has been broken before due to the introduction of asynchronous probing, causing multiple instances requesting "shared" resources, such as pinmuxes, GPIO pins, interrupt lines, at the same time, with only one instance succeeding. Work arounds for these include moving the pinmux to the parent I2C controller, using GPIO hogs or pinmux settings to keep the GPIO pins in some fixed configuration, and requesting the interrupt line very late. Such configurations can be seen on the MT8183 Krane Chromebook tablets, and the Qualcomm sc8280xp-based Lenovo Thinkpad 13S. Instead of this delicate dance between drivers and device tree quirks, this change introduces a simple I2C component probe. function For a given class of devices on the same I2C bus, it will go through all of them, doing a simple I2C read transfer and see which one of them responds. It will then enable the device that responds. This requires some minor modifications in the existing device tree. The status for all the device nodes for the component options must be set to "failed-needs-probe". This makes it clear that some mechanism is needed to enable one of them, and also prevents the prober and device drivers running at the same time. Signed-off-by: Chen-Yu Tsai --- Changes since v2: - New patch split out from "of: Introduce hardware prober driver" - Addressed Rob's comments - Move i2c prober to i2c subsystem - Use of_node_is_available() to check if node is enabled. - Use OF changeset API to update status property - Addressed Andy's comments - Probe function now accepts "struct device *dev" instead to reduce line length and dereferences - Move "ret = 0" to just before for_each_child_of_node(i2c_node, node) --- drivers/i2c/i2c-core-of.c | 110 ++++++++++++++++++++++++++++++++++++++ include/linux/i2c.h | 4 ++ 2 files changed, 114 insertions(+) diff --git a/drivers/i2c/i2c-core-of.c b/drivers/i2c/i2c-core-of.c index a6c407d36800..3a0b4986c585 100644 --- a/drivers/i2c/i2c-core-of.c +++ b/drivers/i2c/i2c-core-of.c @@ -217,4 +217,114 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action, struct notifier_block i2c_of_notifier = { .notifier_call = of_i2c_notify, }; + +/* + * Some devices, such as Google Hana Chromebooks, are produced by multiple + * vendors each using their preferred components. Such components are all + * in the device tree. Instead of having all of them enabled and having each + * driver separately try and probe its device while fighting over shared + * resources, they can be marked as "fail-needs-probe" and have a prober + * figure out which one is actually used beforehand. + * + * This prober assumes such drop-in parts are on the same I2C bus, have + * non-conflicting addresses, and can be directly probed by seeing which + * address responds. + * + * TODO: + * - Support handling common regulators and GPIOs. + * - Support I2C muxes + */ + +/** + * i2c_of_probe_component() - probe for devices of "type" on the same i2c bus + * @dev: &struct device of the caller, only used for dev_* printk messages + * @type: a string to match the device node name prefix to probe for + * + * Probe for possible I2C components of the same "type" on the same I2C bus + * that have their status marked as "fail". + */ +int i2c_of_probe_component(struct device *dev, const char *type) +{ + struct device_node *node, *i2c_node; + struct i2c_adapter *i2c; + struct of_changeset *ocs = NULL; + int ret; + + node = of_find_node_by_name(NULL, type); + if (!node) + return dev_err_probe(dev, -ENODEV, "Could not find %s device node\n", type); + + i2c_node = of_get_next_parent(node); + if (!of_node_name_eq(i2c_node, "i2c")) { + of_node_put(i2c_node); + return dev_err_probe(dev, -EINVAL, "%s device isn't on I2C bus\n", type); + } + + for_each_child_of_node(i2c_node, node) { + if (!of_node_name_prefix(node, type)) + continue; + if (of_device_is_available(node)) { + /* + * Device tree has component already enabled. Either the + * device tree isn't supported or we already probed once. + */ + of_node_put(node); + of_node_put(i2c_node); + return 0; + } + } + + i2c = of_get_i2c_adapter_by_node(i2c_node); + if (!i2c) { + of_node_put(i2c_node); + return dev_err_probe(dev, -EPROBE_DEFER, "Couldn't get I2C adapter\n"); + } + + ret = 0; + for_each_child_of_node(i2c_node, node) { + union i2c_smbus_data data; + u32 addr; + + if (!of_node_name_prefix(node, type)) + continue; + if (of_property_read_u32(node, "reg", &addr)) + continue; + if (i2c_smbus_xfer(i2c, addr, 0, I2C_SMBUS_READ, 0, I2C_SMBUS_BYTE, &data) < 0) + continue; + + dev_info(dev, "Enabling %pOF\n", node); + + ocs = kzalloc(sizeof(*ocs), GFP_KERNEL); + if (!ocs) { + ret = -ENOMEM; + goto err_put_node; + } + + /* Found a device that is responding */ + of_changeset_init(ocs); + ret = of_changeset_update_prop_string(ocs, node, "status", "okay"); + if (ret) + goto err_free_ocs; + ret = of_changeset_apply(ocs); + if (ret) + goto err_destroy_ocs; + + of_node_put(node); + break; + } + + i2c_put_adapter(i2c); + of_node_put(i2c_node); + + return 0; + +err_destroy_ocs: + of_changeset_destroy(ocs); +err_free_ocs: + kfree(ocs); +err_put_node: + of_node_put(node); + return ret; +} +EXPORT_SYMBOL_GPL(i2c_of_probe_component); #endif /* CONFIG_OF_DYNAMIC */ diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 0dae9db27538..75fbbd5a4b15 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -997,6 +997,10 @@ const struct of_device_id int of_i2c_get_board_info(struct device *dev, struct device_node *node, struct i2c_board_info *info); +#if IS_ENABLED(CONFIG_OF_DYNAMIC) +int i2c_of_probe_component(struct device *dev, const char *type); +#endif + #else static inline struct i2c_client *of_find_i2c_device_by_node(struct device_node *node) From patchwork Tue Nov 28 08:42:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 170628 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3769672vqx; Tue, 28 Nov 2023 00:46:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFwLfwJcb7liKtSngquPRJ9MDr/85QTBoahaRNLuA0qNLoGdTyCYodFrpGh95QQAqlW+Pc5 X-Received: by 2002:a05:6358:6f18:b0:16e:34f4:185b with SMTP id r24-20020a0563586f1800b0016e34f4185bmr8854440rwn.20.1701161180583; Tue, 28 Nov 2023 00:46:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701161180; cv=none; d=google.com; s=arc-20160816; b=m+aamZTB/LRt1ft/Y29Ba94E3YtBcbPaxVtZVSj0yaJAk/B0N+s2hoN+mBPjlyFyPG J9vvrgyW2DZfc5GBGa07is+DHzNX8/WAhWR/Wf3ngiDZ8Hv05Xg3TaYJe8RW+CRMRzWP 32Ywg0FDhytiYVf4Wic/bNH0YPD8oQd3CAAjyygahMkhQrftJP1xgSjWgMHP5sp5mgvg +aUNiPaLWEX9p8xrAu7djBgewZTfTrn1/guc+/KqI1jfhn817zsYTFeATfa7PM5R/wTi chKKGTG7vDfh3Rau062PMpmeJZhINH6j5Y5HiLDlyvjZ2VWtkX8uposwaoTVyR0Ek7dM 8SJQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=W8/TdtPK7mZHmPEMzqlWjR5HwzhRhEqW5dnoF8OBNcQ=; fh=8QP7fVOWLSDOp8hxtrSQbFKqGDfCbAKvH6yY7D4IGkc=; b=tROjtokDfMnkwEcz4b0Z5ygBgIVHhX2JWPqHwOa0ZS/ltlpcG9jSZmfd63L7Dps1AV /qorRwYdVmhrKkS7xwIH/3R7L/+82qiEqZWi1oG39/9vRXxQ8xpamQutA7KFirjcZqGJ OhHB3OstjUW2PJ3AzS4jXnmd4JwNqaxbncBUQWJ150jpHNyV/KxLnI3umzVT31ApGIVv 1i87dI2JOnWvRiMJJ9mBdxfvBU425UhbSNBDNJN4HHcgBxVNc40wJctfBY/D0NGrEOh9 A+gP0ABdtuZxn4Vg3Q47yoM9c8SZWkxdJwhU+TAS40Tit9xaqM3u3oQOGKGYUXyYZNKu W6Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=m27szb8L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id q7-20020a63cc47000000b005c24211ca87si11761229pgi.243.2023.11.28.00.46.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 00:46:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=m27szb8L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 05D1C81829FA; Tue, 28 Nov 2023 00:46:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344255AbjK1IpY (ORCPT + 99 others); Tue, 28 Nov 2023 03:45:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344225AbjK1IpN (ORCPT ); Tue, 28 Nov 2023 03:45:13 -0500 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A9B210C1 for ; Tue, 28 Nov 2023 00:45:17 -0800 (PST) Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-5a9bc2ec556so3173738a12.0 for ; Tue, 28 Nov 2023 00:45:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1701161116; x=1701765916; darn=vger.kernel.org; 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=W8/TdtPK7mZHmPEMzqlWjR5HwzhRhEqW5dnoF8OBNcQ=; b=m27szb8LxKARre4eazapdHG3ArkqLpOcvNNIFBH8kxUG6vmSzX2a9revgy+8tQVUbx itpJ1RHDege9HG9CCdktKupNQccZnI9PJ4JLCbilNUzimUJKK2KVJ/HJBWEhOA3UzFkI S8I1Qv9hoGC1ODJzoT/JxGk6jSRwwLH+VwQNE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701161116; x=1701765916; 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=W8/TdtPK7mZHmPEMzqlWjR5HwzhRhEqW5dnoF8OBNcQ=; b=CTcJRQRX9MyWYQSH94PtVaNKPrYE/JJKrM+8aylXvlHU0sk5A6KpWFbxKgr6yzIgq5 jvPEy6I+nCHV4+mrpNJ6F+SfWHktCRW8ZnzxBnA2rlzBTUovcXhfkq0PZA6NiN/XwQRy dBZcfZFbHGeNQb2sOpdiPEZrThgd98FN9odzKzN7wWO+OWSmnIKx0iyVeFFmcD3wyN8z 8NBFBU94p+Q0rftXU9ilOmEigby4ZC3Q9rtKLgv3i6xDqj7WtYg5NGdCB5NUdrVPi1Uh PNSoBelZQjL7FyeRqG3t6Rl5bjPo32DgxmOc/cqUthS7g35ksqrKhrxpwM4JkYR4/0X/ E/PA== X-Gm-Message-State: AOJu0Yw2VS/dB/ms4iYXEFPLZr+NnSfjStMpAHMeZ/ldLEP6IY6mfmZ9 iGsy91os0rWrj7lsfqrAPlCvTQ== X-Received: by 2002:a05:6a20:d48d:b0:189:dc00:cf85 with SMTP id im13-20020a056a20d48d00b00189dc00cf85mr14610135pzb.36.1701161116308; Tue, 28 Nov 2023 00:45:16 -0800 (PST) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:a990:1e95:a915:9c70]) by smtp.gmail.com with ESMTPSA id j1-20020a170902c08100b001ab39cd875csm8358074pld.133.2023.11.28.00.45.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 00:45:15 -0800 (PST) From: Chen-Yu Tsai To: Rob Herring , Frank Rowand , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Wolfram Sang , Benson Leung , Tzung-Bi Shih Cc: Chen-Yu Tsai , chrome-platform@lists.linux.dev, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Douglas Anderson , Johan Hovold , Hsin-Yi Wang , Dmitry Torokhov , andriy.shevchenko@linux.intel.com, Jiri Kosina , linus.walleij@linaro.org, broonie@kernel.org, gregkh@linuxfoundation.org, hdegoede@redhat.com, james.clark@arm.com, james@equiv.tech, keescook@chromium.org, rafael@kernel.org, tglx@linutronix.de, Jeff LaBundy , linux-input@vger.kernel.org, linux-i2c@vger.kernel.org Subject: [RFC PATCH v3 3/5] platform/chrome: Introduce device tree hardware prober Date: Tue, 28 Nov 2023 16:42:32 +0800 Message-ID: <20231128084236.157152-4-wenst@chromium.org> X-Mailer: git-send-email 2.43.0.rc1.413.gea7ed67945-goog In-Reply-To: <20231128084236.157152-1-wenst@chromium.org> References: <20231128084236.157152-1-wenst@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 28 Nov 2023 00:46:15 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783796785655524755 X-GMAIL-MSGID: 1783796785655524755 Some devices are designed and manufactured with some components having multiple drop-in replacement options. These components are often connected to the mainboard via ribbon cables, having the same signals and pin assignments across all options. These may include the display panel and touchscreen on laptops and tablets, and the trackpad on laptops. Sometimes which component option is used in a particular device can be detected by some firmware provided identifier, other times that information is not available, and the kernel has to try to probe each device. This change attempts to make the "probe each device" case cleaner. The current approach is to have all options added and enabled in the device tree. The kernel would then bind each device and run each driver's probe function. This works, but has been broken before due to the introduction of asynchronous probing, causing multiple instances requesting "shared" resources, such as pinmuxes, GPIO pins, interrupt lines, at the same time, with only one instance succeeding. Work arounds for these include moving the pinmux to the parent I2C controller, using GPIO hogs or pinmux settings to keep the GPIO pins in some fixed configuration, and requesting the interrupt line very late. Such configurations can be seen on the MT8183 Krane Chromebook tablets, and the Qualcomm sc8280xp-based Lenovo Thinkpad 13S. Instead of this delicate dance between drivers and device tree quirks, this change introduces a simple I2C component prober. For any given class of devices on the same I2C bus, it will go through all of them, doing a simple I2C read transfer and see which one of them responds. It will then enable the device that responds. This requires some minor modifications in the existing device tree. The status for all the device nodes for the component options must be set to "failed-needs-probe". This makes it clear that some mechanism is needed to enable one of them, and also prevents the prober and device drivers running at the same time. Signed-off-by: Chen-Yu Tsai --- Changes since v2: - Addressed Rob's comments - Move remaining driver code to drivers/platform/chrome/ - Depend on rather than select CONFIG_I2C - Copy machine check to driver init function - Addressed Andy's comments - Explicitly mention "device tree" or OF in driver name, description and Kconfig symbol - Drop filename from inside the file - Switch to passing "struct device *" to shorten lines - Move "ret = 0" to just before for_each_child_of_node(i2c_node, node) - Make loop variable size_t (instead of unsigned int as Andy asked) - Use PLATFORM_DEVID_NONE instead of raw -1 - Use standard goto error path pattern in hw_prober_driver_init() - Changes since v1: - New patch --- drivers/platform/chrome/Kconfig | 11 +++ drivers/platform/chrome/Makefile | 1 + .../platform/chrome/chromeos_of_hw_prober.c | 89 +++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 drivers/platform/chrome/chromeos_of_hw_prober.c diff --git a/drivers/platform/chrome/Kconfig b/drivers/platform/chrome/Kconfig index 7a83346bfa53..aa161f2f09e3 100644 --- a/drivers/platform/chrome/Kconfig +++ b/drivers/platform/chrome/Kconfig @@ -61,6 +61,17 @@ config CHROMEOS_TBMC To compile this driver as a module, choose M here: the module will be called chromeos_tbmc. +config CHROMEOS_OF_HW_PROBER + bool "ChromeOS Device Tree Hardware Prober" + depends on OF + depends on I2C + select OF_DYNAMIC + default OF + help + This option enables the device tree hardware prober for ChromeOS + devices. The driver will probe the correct component variant in + devices that have multiple drop-in options for one component. + config CROS_EC tristate "ChromeOS Embedded Controller" select CROS_EC_PROTO diff --git a/drivers/platform/chrome/Makefile b/drivers/platform/chrome/Makefile index 2dcc6ccc2302..21a9d5047053 100644 --- a/drivers/platform/chrome/Makefile +++ b/drivers/platform/chrome/Makefile @@ -8,6 +8,7 @@ obj-$(CONFIG_CHROMEOS_ACPI) += chromeos_acpi.o obj-$(CONFIG_CHROMEOS_LAPTOP) += chromeos_laptop.o obj-$(CONFIG_CHROMEOS_PRIVACY_SCREEN) += chromeos_privacy_screen.o obj-$(CONFIG_CHROMEOS_PSTORE) += chromeos_pstore.o +obj-$(CONFIG_CHROMEOS_OF_HW_PROBER) += chromeos_of_hw_prober.o obj-$(CONFIG_CHROMEOS_TBMC) += chromeos_tbmc.o obj-$(CONFIG_CROS_EC) += cros_ec.o obj-$(CONFIG_CROS_EC_I2C) += cros_ec_i2c.o diff --git a/drivers/platform/chrome/chromeos_of_hw_prober.c b/drivers/platform/chrome/chromeos_of_hw_prober.c new file mode 100644 index 000000000000..13aaad6382aa --- /dev/null +++ b/drivers/platform/chrome/chromeos_of_hw_prober.c @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * ChromeOS Device Tree Hardware Prober + * + * Copyright (c) 2023 Google LLC + */ + +#include +#include +#include +#include + +#define DRV_NAME "chromeos_of_hw_prober" + +/** + * struct hw_prober_entry - Holds an entry for the hardware prober + * + * @compatible: compatible string to match against the machine + * @prober: prober function to call when machine matches + * @data: extra data for the prober function + */ +struct hw_prober_entry { + const char *compatible; + int (*prober)(struct device *dev, const void *data); + const void *data; +}; + +static int chromeos_i2c_component_prober(struct device *dev, const void *data) +{ + const char *type = data; + + return i2c_of_probe_component(dev, type); +} + +static const struct hw_prober_entry hw_prober_platforms[] = { + { .compatible = "google,hana", .prober = chromeos_i2c_component_prober, .data = "touchscreen" }, + { .compatible = "google,hana", .prober = chromeos_i2c_component_prober, .data = "trackpad" }, +}; + +static int chromeos_of_hw_prober_probe(struct platform_device *pdev) +{ + for (size_t i = 0; i < ARRAY_SIZE(hw_prober_platforms); i++) + if (of_machine_is_compatible(hw_prober_platforms[i].compatible)) { + int ret; + + ret = hw_prober_platforms[i].prober(&pdev->dev, + hw_prober_platforms[i].data); + if (ret) + return ret; + } + + return 0; +} + +static struct platform_driver chromeos_of_hw_prober_driver = { + .probe = chromeos_of_hw_prober_probe, + .driver = { + .name = DRV_NAME, + }, +}; + +static int __init chromeos_of_hw_prober_driver_init(void) +{ + struct platform_device *pdev; + size_t i; + int ret; + + for (i = 0; i < ARRAY_SIZE(hw_prober_platforms); i++) + if (of_machine_is_compatible(hw_prober_platforms[i].compatible)) + break; + if (i == ARRAY_SIZE(hw_prober_platforms)) + return 0; + + ret = platform_driver_register(&chromeos_of_hw_prober_driver); + if (ret) + return ret; + + pdev = platform_device_register_simple(DRV_NAME, PLATFORM_DEVID_NONE, NULL, 0); + if (IS_ERR(pdev)) + goto err; + + return 0; + +err: + platform_driver_unregister(&chromeos_of_hw_prober_driver); + + return PTR_ERR(pdev); +} +device_initcall(chromeos_of_hw_prober_driver_init); From patchwork Tue Nov 28 08:42:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 170625 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3769485vqx; Tue, 28 Nov 2023 00:45:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IFfWQWdqkM2KpoZGPJK6l9BIDfp6plD9eafvpV8Gebicr1iOatbges5xTbsOGJQg0l7mzum X-Received: by 2002:a05:6a21:150a:b0:18a:f462:5d3c with SMTP id nq10-20020a056a21150a00b0018af4625d3cmr18381540pzb.12.1701161155049; Tue, 28 Nov 2023 00:45:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701161155; cv=none; d=google.com; s=arc-20160816; b=akT0xwOJ2TfgmvAFeS0a6Mr25a1Xjh9WtvamRisK+3804n7FnUmZja41OTzuVZaDe8 rNeRHmcqm4QMhJmIGmNlsbs1As0tM47YYPpGUx8d2yVjqhFIP6NY6qRAVrl6oAkLy8fc Hlqcu636Yu87QxObqAGUXAkBYgFtV25nNjqW1SUnBApdO/KWs3rkQ4orcyxj9T/ss9Hz zuVM8GUz4jB3Yp9Cm/PKm4s0d+nfm2AmexKijOSjOuQgkKyC6ARiS59raFupyP8cu5vz Pt7opbc3nBX3+uU3bqsHsUjYf/IcBTXZvMTkAaWH6jDVEllFHwDyyDdkQcuDK+JCKtaM zLJw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/Y9ycKtKFTX/BTOyRnkXgZtClc28FDD42zjunKgTjuA=; fh=8QP7fVOWLSDOp8hxtrSQbFKqGDfCbAKvH6yY7D4IGkc=; b=eckRAbeHi5IMimLHizYLpJHw6ZLSAcwiUfgbOAAII5mRDY++AJydseKD3NSsz9sobi fvGLzJwJ9u+9IrxGqEhURLsphIEbOAJO6iLHKnBtzgA2fWqBt124fsdTJbg0q1Srtmwk ulyiTz1hoXbK3pROnvxw5IRbOL/StvK0YiZqSTdoGMXXpSrIa9wvgmVQweUWnVhDvcxB AFSV2kDrQ7bP2LyIZaVYip5Ka4RL9reDDzJ4U323VU0rbIcvWIdt2+4t2AZmpI6DlQEW eDCvR+OUkVdb6qZASa+bwimHdYzi3PYCIMFRY0oL4doPKpDJq0WDwyxD9Jk7V5SZ7ZyR Ex5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SwGzLlVx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id bf8-20020a170902b90800b001cfe03b2bafsi2229621plb.491.2023.11.28.00.45.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 00:45:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SwGzLlVx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 5C6E280EFC47; Tue, 28 Nov 2023 00:45:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344290AbjK1Iph (ORCPT + 99 others); Tue, 28 Nov 2023 03:45:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344251AbjK1IpU (ORCPT ); Tue, 28 Nov 2023 03:45:20 -0500 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11D2F19A4 for ; Tue, 28 Nov 2023 00:45:22 -0800 (PST) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1cf5901b4c8so44632285ad.1 for ; Tue, 28 Nov 2023 00:45:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1701161121; x=1701765921; darn=vger.kernel.org; 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=/Y9ycKtKFTX/BTOyRnkXgZtClc28FDD42zjunKgTjuA=; b=SwGzLlVxYnuU6rAgNgj3DZrhO26TdPHjJsVmCM/NrZV6DUC8GIS7AFsMT86M2+orCe sOha5G6nntDkOommdQkSqmgGX9tdr8zhz/5p/xn+mFv+Cr1pHv7mBI/1ddtNYsH9T/fA U3piRgAPk5ZbvU3l9vvmiLjvgpH1fM/NSV884= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701161121; x=1701765921; 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=/Y9ycKtKFTX/BTOyRnkXgZtClc28FDD42zjunKgTjuA=; b=PcmDMhu32KpP7iCKt/HtG1rFkYA38ppsZEzW0NUGXjq3doiS0Cnu80RJ1lmk4Jb9XO v0KcsFrHtyFsRBj/UotKL12dAqP4tDGMMVydF6usRqLbhJXhO1SiDm4zxsGrCezymuSR 8T3PSr/Ij9dbZFgxfItwsnq6P6XWHfd3vrU37eR8ewzzbrqeeFbaoE6KD9yt5VG6OAis da+DKEj3FNUhVNoeCGrUR3qKF/o8+TS0SYLoP3Xm8RmGVlu1810J+IP/nj88Mm0494P5 8mIQkQmbSt+cNjXNNQaWmMEV87ydKIFNd+kui4hf/aiGgP/f78l/30krnmSQlaQa9lf3 ZmSw== X-Gm-Message-State: AOJu0Yx7M5LmPxA6YCsps2YZx39PYkD0ERN/8Jp+qZ+Dz9sUgcQeKB5y tEA+Rdl42G0ETjVtqVOpX94eLQ== X-Received: by 2002:a17:902:f54d:b0:1cf:b3d2:5f18 with SMTP id h13-20020a170902f54d00b001cfb3d25f18mr13659883plf.56.1701161121540; Tue, 28 Nov 2023 00:45:21 -0800 (PST) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:a990:1e95:a915:9c70]) by smtp.gmail.com with ESMTPSA id j1-20020a170902c08100b001ab39cd875csm8358074pld.133.2023.11.28.00.45.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 00:45:21 -0800 (PST) From: Chen-Yu Tsai To: Rob Herring , Frank Rowand , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Wolfram Sang , Benson Leung , Tzung-Bi Shih Cc: Chen-Yu Tsai , chrome-platform@lists.linux.dev, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Douglas Anderson , Johan Hovold , Hsin-Yi Wang , Dmitry Torokhov , andriy.shevchenko@linux.intel.com, Jiri Kosina , linus.walleij@linaro.org, broonie@kernel.org, gregkh@linuxfoundation.org, hdegoede@redhat.com, james.clark@arm.com, james@equiv.tech, keescook@chromium.org, rafael@kernel.org, tglx@linutronix.de, Jeff LaBundy , linux-input@vger.kernel.org, linux-i2c@vger.kernel.org Subject: [RFC PATCH v3 4/5] arm64: dts: mediatek: mt8173-elm-hana: Mark touchscreens and trackpads as fail Date: Tue, 28 Nov 2023 16:42:33 +0800 Message-ID: <20231128084236.157152-5-wenst@chromium.org> X-Mailer: git-send-email 2.43.0.rc1.413.gea7ed67945-goog In-Reply-To: <20231128084236.157152-1-wenst@chromium.org> References: <20231128084236.157152-1-wenst@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 28 Nov 2023 00:45:52 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783796759238988876 X-GMAIL-MSGID: 1783796759238988876 Instead of having them all available, mark them all as "fail-needs-probe" and have the implementation try to probe which one is present. Signed-off-by: Chen-Yu Tsai --- Changes since v2: - Drop class from status --- arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtsi b/arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtsi index bdcd35cecad9..1d68bc6834e4 100644 --- a/arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtsi @@ -15,6 +15,7 @@ touchscreen2: touchscreen@34 { reg = <0x34>; interrupt-parent = <&pio>; interrupts = <88 IRQ_TYPE_LEVEL_LOW>; + status = "fail-needs-probe"; }; /* @@ -28,6 +29,7 @@ touchscreen3: touchscreen@20 { hid-descr-addr = <0x0020>; interrupt-parent = <&pio>; interrupts = <88 IRQ_TYPE_LEVEL_LOW>; + status = "fail-needs-probe"; }; }; @@ -44,6 +46,7 @@ trackpad2: trackpad@2c { reg = <0x2c>; hid-descr-addr = <0x0020>; wakeup-source; + status = "fail-needs-probe"; }; }; @@ -68,3 +71,11 @@ pins_wp { }; }; }; + +&touchscreen { + status = "fail-needs-probe"; +}; + +&trackpad { + status = "fail-needs-probe"; +}; From patchwork Tue Nov 28 08:42:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 170627 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3769658vqx; Tue, 28 Nov 2023 00:46:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IEt1sZlYZByJ0HceWI6rZGXvKTun9E5DQYGXI/oHVdfpQ0LKDHr5dJnrv5ZT2Gw2bDA2P4f X-Received: by 2002:a05:6870:568e:b0:1f9:515e:24a7 with SMTP id p14-20020a056870568e00b001f9515e24a7mr18618813oao.18.1701161178296; Tue, 28 Nov 2023 00:46:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701161178; cv=none; d=google.com; s=arc-20160816; b=bARSZIx9quo2sPNnojg1m2km/vDhOmfCQpGw1xQWwzkN37rUgd5ZV6KohiL/vr7MsS FvpIEVIzM+QvoX7X7EuIe9y4Xt+EEr77NYR4nYadv1dGtQ8nvHhqJ6aScSNQW2Ifb21S zm8jzNMtrhUJxqXlTfecb7CnzoiBEEqNPg/VHFAntBbVDjFcryyHagqaFjqoaXBOa5dz wCVrwN2uf9wp7StExJeiGNS/kWV9r+BTsC6nyD3cXWTl1AcCPtOm7zoyJVkWd3jLyvQ1 LfCLG0Z44Lz6S2aEiprGMFHJTxdyJbL43pihtVU6MyEkk09s5v9WEmcRR5eVrGxyKgk4 jmFQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dxKs9xH99OQyNQM5ja7w5sBqIVdDZ2l2tkwooD9gc1c=; fh=8QP7fVOWLSDOp8hxtrSQbFKqGDfCbAKvH6yY7D4IGkc=; b=JzpR+c3Jr+F8yAg7ufY5hUZ39l+SZX0WL1gHvUBz35Kq3dnQqkJUlCn3OhWZJeAcZo baL+NRgdc90QQqBrQ2qL4mA+pC08ssM3VjtRmCZMv8elMK7sQ3NFX/U5MNdfgGTX2Bca cYpbqQOB4ubMHM93WANVqy4mME+H0IGdJ0/Tay6WcjJFKnRftVpNBtHYgOcu9yke/5By 7X8AcYF5CGnczbFbgVRtvqbCsqB3hSqTcHU72f1ukGlLtDWin9decvyMMMa5OiZbadNG q9u++OKqAgbXk6yz/R9JtNOj1wF42J3zz4uZae5QBC4pAeYtcQOVCaXXKG/lCRdwGBeA +WKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=M7OCSlHr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id u1-20020a056a00158100b006bd360e70edsi12180142pfk.103.2023.11.28.00.46.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 00:46:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=M7OCSlHr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 47E248081CCD; Tue, 28 Nov 2023 00:46:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344212AbjK1Ipm (ORCPT + 99 others); Tue, 28 Nov 2023 03:45:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344247AbjK1IpX (ORCPT ); Tue, 28 Nov 2023 03:45:23 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A937BD56 for ; Tue, 28 Nov 2023 00:45:27 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1cf89e31773so35328455ad.0 for ; Tue, 28 Nov 2023 00:45:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1701161126; x=1701765926; darn=vger.kernel.org; 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=dxKs9xH99OQyNQM5ja7w5sBqIVdDZ2l2tkwooD9gc1c=; b=M7OCSlHrgPke0dbRqhyKdV1U2j9DpXjb4BCazCV3m+84qXU2FL1ddycrfXCIqHph/f ho6kJGxPgWAnRHqRtJAJRY2tqfLbYFoAVS5FClxouPLTXDerBCtgJN1NI8jPG81stcAm tovPvDMh9jBVtmUBDucEX24Dj789D8LC366RQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701161126; x=1701765926; 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=dxKs9xH99OQyNQM5ja7w5sBqIVdDZ2l2tkwooD9gc1c=; b=JVavb0rsOiWLLjAN1678dGVcbwRk+POmuhL6VI9jmcwOMhJI8tFjD7e60+6bsws7YH +3nYKGs7reeU1pJ4GEG2C3LOMEY1YI4sqNcLTyeoD1h1CE1paowjmmoPWz6DoEH2/viO iHw3cYKyhD4IxevHAu9kaYi7izoaLlsG7dAq3/FJEzqcxSmoJVvTEwVvSa6XzSzCgPWZ Clp1VqDjyPQ6EPOUPmSw1eJIo9PvyXRZ3FNOplXGPEwDBe65APUornHgUch9b95YJEmD w49sP97/qQRbMXLICPVzh78KpfTV/HSAU06HzwBe8J3W9oGMrgFdUOGg8Qjj3YaADtX4 B8bA== X-Gm-Message-State: AOJu0YwTFsMAMpOapuyM6ZXSHBlTmAmI+fAx/9ZXuCOcro29rL8gogbG 6KYFLrRiV93SFCswpxXupTqCbQ== X-Received: by 2002:a17:902:988b:b0:1cf:b130:e9af with SMTP id s11-20020a170902988b00b001cfb130e9afmr10074896plp.20.1701161126645; Tue, 28 Nov 2023 00:45:26 -0800 (PST) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:a990:1e95:a915:9c70]) by smtp.gmail.com with ESMTPSA id j1-20020a170902c08100b001ab39cd875csm8358074pld.133.2023.11.28.00.45.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 00:45:26 -0800 (PST) From: Chen-Yu Tsai To: Rob Herring , Frank Rowand , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Wolfram Sang , Benson Leung , Tzung-Bi Shih Cc: Chen-Yu Tsai , chrome-platform@lists.linux.dev, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Douglas Anderson , Johan Hovold , Hsin-Yi Wang , Dmitry Torokhov , andriy.shevchenko@linux.intel.com, Jiri Kosina , linus.walleij@linaro.org, broonie@kernel.org, gregkh@linuxfoundation.org, hdegoede@redhat.com, james.clark@arm.com, james@equiv.tech, keescook@chromium.org, rafael@kernel.org, tglx@linutronix.de, Jeff LaBundy , linux-input@vger.kernel.org, linux-i2c@vger.kernel.org Subject: [RFC PATCH v3 5/5] arm64: dts: mediatek: mt8173-elm-hana: Add G2touch G7500 touchscreen Date: Tue, 28 Nov 2023 16:42:34 +0800 Message-ID: <20231128084236.157152-6-wenst@chromium.org> X-Mailer: git-send-email 2.43.0.rc1.413.gea7ed67945-goog In-Reply-To: <20231128084236.157152-1-wenst@chromium.org> References: <20231128084236.157152-1-wenst@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 28 Nov 2023 00:46:01 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783796783769772555 X-GMAIL-MSGID: 1783796783769772555 This introduces yet another second-source touchscreen found on Hana. This is a G2touch G7500 touchscreen, which is compatible with HID over I2C. Add a device node for it. In keeping with the new scheme for second source components, mark it as "failed-needs-probe". Signed-off-by: Chen-Yu Tsai --- Changes since v2: - Drop class from status --- arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtsi b/arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtsi index 1d68bc6834e4..216d8b43be05 100644 --- a/arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8173-elm-hana.dtsi @@ -31,6 +31,15 @@ touchscreen3: touchscreen@20 { interrupts = <88 IRQ_TYPE_LEVEL_LOW>; status = "fail-needs-probe"; }; + + touchscreen4: touchscreen@40 { + compatible = "hid-over-i2c"; + reg = <0x40>; + hid-descr-addr = <0x0001>; + interrupt-parent = <&pio>; + interrupts = <88 IRQ_TYPE_LEVEL_LOW>; + status = "fail-needs-probe"; + }; }; &i2c4 {