Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp4803596rwl; Wed, 28 Dec 2022 09:02:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXviMHrsMO3Cax1dddyW/Xbir3r9KGL9gKYFVImL1avPOf5ChFVe25j8zwh6rDkGNKTOKuM0 X-Received: by 2002:a05:6402:448a:b0:481:9219:f603 with SMTP id er10-20020a056402448a00b004819219f603mr16016567edb.28.1672246968811; Wed, 28 Dec 2022 09:02:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672246968; cv=none; d=google.com; s=arc-20160816; b=a989T9thDCcg0aQCMvPyYdpSvG9cWgfQHC4Qxl9+0Gv+LtT7kYPpFwUmq8mSl3MW8n s9zD3mU0cc2cxJzRfoJk0ivxlcQn+GURHQGceqy0/GpFQZyvd78BrJ9Uu+fEDcVLbFpk rJzWydxagDRRo8IT3RooUja+Iv+A+9WZGYumPkVOvXE9wg8h9Rf2fexwO2O7bJYu5hHL yOz+tKcAGdBEoC4N7s84+gcYJNSJjflysGFxxQgrD1Ad8wz1uxmP+NqJpqxCic+Kw6md lKGG5sZrf4BySoc3MrvMyyXTVBYDFOBu/dEuBwFaT+laQfbpV77yB7XQN0HodLQN43p5 jjBg== 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=1A5zlnRR2f2ZTu4fR9CQ3Z2F8xD3bcpX34JwmydLuRw=; b=cYqk+HPt6nwx61Kny5519/k+FcFHX4O3sQNzuJeKyl/QiI51mjtRN8d3IYbAjn/QJW /eNk5SPc4yPmLHngSaUVXRILo17kNtkTk6gymKYcBVD7Bn4MwGWQxvwiqoPwoznLfvzv DPxnmmgugmgW5jWBRQ59ZT4zqw5JH9lq7eZ/Qo1iq64J8fOIJuH5zFuly8IR7DVkb+7E Lwo3tQFq+AondvDCW4qztW74Y30uqmXcHtutp2XFHZLIA/JD/uu5dZjY72/1Qo+KLU0B vxnoDdUb2CTWjXczXI4QA9V35w1Od6YmBBzGcwBVcMo2BlnqkypvQ+QXgtIqj/fyag0o up4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=hRo+ktv3; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n8-20020a056402514800b00482466921d7si10774613edd.181.2022.12.28.09.02.27; Wed, 28 Dec 2022 09:02:48 -0800 (PST) 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=@amazon.com header.s=amazon201209 header.b=hRo+ktv3; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235057AbiL1QyI (ORCPT + 64 others); Wed, 28 Dec 2022 11:54:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235127AbiL1Qxa (ORCPT ); Wed, 28 Dec 2022 11:53:30 -0500 Received: from smtp-fw-6002.amazon.com (smtp-fw-6002.amazon.com [52.95.49.90]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 100281D322; Wed, 28 Dec 2022 08:48:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1672246125; x=1703782125; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1A5zlnRR2f2ZTu4fR9CQ3Z2F8xD3bcpX34JwmydLuRw=; b=hRo+ktv32bU5i4CiAAkrW190QrCGbcAEgFvf1M99Sl1fTEgWFy67EL9R OhFoTP9Zz5I0d7WnGdnA/aOSKL9/vqe/DFuMsZimNkKTfR2I9vC1Kzebw tfRL+TGKNDkhcNYDbxiXdln44uWUe/X77U6Szp3GmPnEuIm9YyXW43fjO Q=; X-IronPort-AV: E=Sophos;i="5.96,281,1665446400"; d="scan'208";a="281514154" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-pdx-2b-m6i4x-32fb4f1a.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-6002.iad6.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Dec 2022 16:48:43 +0000 Received: from EX13D45EUA003.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-pdx-2b-m6i4x-32fb4f1a.us-west-2.amazon.com (Postfix) with ESMTPS id CAEBAC30CB; Wed, 28 Dec 2022 16:48:41 +0000 (UTC) Received: from EX19D019EUA002.ant.amazon.com (10.252.50.84) by EX13D45EUA003.ant.amazon.com (10.43.165.71) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 28 Dec 2022 16:48:39 +0000 Received: from dev-dsk-hhhawa-1b-84e0d7ff.eu-west-1.amazon.com (10.43.162.56) by EX19D019EUA002.ant.amazon.com (10.252.50.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1118.20; Wed, 28 Dec 2022 16:48:34 +0000 From: Hanna Hawa To: , , , , , CC: , , , , , , , , Subject: [PATCH v5 2/2] i2c: Set i2c pinctrl recovery info from it's device pinctrl Date: Wed, 28 Dec 2022 16:48:13 +0000 Message-ID: <20221228164813.67964-3-hhhawa@amazon.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221228164813.67964-1-hhhawa@amazon.com> References: <20221228164813.67964-1-hhhawa@amazon.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.43.162.56] X-ClientProxiedBy: EX13D45UWA001.ant.amazon.com (10.43.160.91) To EX19D019EUA002.ant.amazon.com (10.252.50.84) X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_SPF_WL 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 Currently the i2c subsystem rely on the controller device tree to initialize the pinctrl recovery information, part of the drivers does not set this field (rinfo->pinctrl), for example i2c DesignWare driver. The pins information is saved part of the device structure before probe and it's done on pinctrl_bind_pins(). Make the i2c init recovery to get the device pins if it's not initialized by the driver from the device pins. Signed-off-by: Hanna Hawa Reviewed-by: Andy Shevchenko --- drivers/i2c/i2c-core-base.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 7539b0740351..fb5644457452 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -282,7 +283,9 @@ static void i2c_gpio_init_pinctrl_recovery(struct i2c_adapter *adap) { struct i2c_bus_recovery_info *bri = adap->bus_recovery_info; struct device *dev = &adap->dev; - struct pinctrl *p = bri->pinctrl; + struct pinctrl *p = bri->pinctrl ?: dev_pinctrl(dev->parent); + + bri->pinctrl = p; /* * we can't change states without pinctrl, so remove the states if -- 2.38.1