Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp4806806rwl; Wed, 28 Dec 2022 09:04:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXvJSvq/vhkKy9vGS4nBDJ2nI09kjk+aY+ddDHh63Pl3VbXD98QkPbDk7xsWQzxDa/Xn/wl4 X-Received: by 2002:a17:907:8b17:b0:7c1:8ba6:6eaf with SMTP id sz23-20020a1709078b1700b007c18ba66eafmr22840778ejc.5.1672247079109; Wed, 28 Dec 2022 09:04:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672247079; cv=none; d=google.com; s=arc-20160816; b=apYb8eluY2se6d37YLYwB/lpEzEwRJNFtNTVrpVUJNssc0PAmA+U4YVSAUt20uY+Ox GT3m4U+956OlkvfjrrDpZ2R2Z+UnKAFPaiO+CAgU2/1sNhV3k24FtzWFeux2/RktQsTp BGi5BpJa9ydCpUAU9HitliKE9yOQD9DpBqiyu3qYid63qtsbNjcBpoOUl4UGTb8wWbZW 9Bs/Q7TrvM01TE9/tCOJF3xIAmp0vbRij170YxjSt3rSXyVjTPTQpQw12PCOAophGS7j mpen/b6BtdXTVxto7IJN3yZTXaJQWyPLvqgV0xHeu+X8nMZw8+t9+sqa2GnIZgdROjQe DQYw== 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=ypztWKO0acnZ9KxjcJXXqWb0zwFVPuYw8z6bkanpP7I=; b=bRUI0F1leeIhJM+8iD9zJ6Lz64IxZs39Jp1pZY7IFy5r2qtay8XDS7HgZFVh2T0kiC WkfasW+5P6VyRkvzfliZbGX2DRFMDmLwoDmhuzaZEYU1SmPtiz7CPvA2UTUmd5uyVY8Z r9R/uYsmRuP4x7NfKtk1+KcSCO2ARgR7YWO0Hqqd2Z62sDECPU47AFnVlrN9fEXslxxY 5CXYqY7xvsKPyL+TaAlrWnqZFt+CdISrqcM625bnqChXw/Y0Rei5RpZHu1RSTHPRyhV7 EOSKjU6hXdDEmoMx9WY8H/TuNcFSalJ1/+NYW7620eri7S7MBkipKknMJ9R4/a0Hzp6D StVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=X2avdODi; 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 b1-20020a50ccc1000000b0046cc4440fbasi13483315edj.434.2022.12.28.09.04.22; Wed, 28 Dec 2022 09:04:39 -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=X2avdODi; 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 S233225AbiL1QyM (ORCPT + 63 others); Wed, 28 Dec 2022 11:54:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235060AbiL1QxZ (ORCPT ); Wed, 28 Dec 2022 11:53:25 -0500 Received: from smtp-fw-9102.amazon.com (smtp-fw-9102.amazon.com [207.171.184.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF2E71D30B; Wed, 28 Dec 2022 08:48:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1672246123; x=1703782123; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ypztWKO0acnZ9KxjcJXXqWb0zwFVPuYw8z6bkanpP7I=; b=X2avdODidm1GauxVEdrETEnAyBkNYgUVCsIq5vb37YTi23OZeOET9jN2 ad47jh4ley/NTa2LhqkZLduqsna9X3R6JCnJO1TznHbyVIN/ywI8o0/Wa CfTGsvZS02uzETzQ7ntTGM5MON/dtCkiX+9GgPkNtabTOeWx6ITmL9KCW I=; X-IronPort-AV: E=Sophos;i="5.96,281,1665446400"; d="scan'208";a="294965043" Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO email-inbound-relay-pdx-2b-m6i4x-cadc3fbd.us-west-2.amazon.com) ([10.25.36.210]) by smtp-border-fw-9102.sea19.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Dec 2022 16:48:37 +0000 Received: from EX13D46EUA001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-pdx-2b-m6i4x-cadc3fbd.us-west-2.amazon.com (Postfix) with ESMTPS id 5D439A0B2D; Wed, 28 Dec 2022 16:48:35 +0000 (UTC) Received: from EX19D019EUA002.ant.amazon.com (10.252.50.84) by EX13D46EUA001.ant.amazon.com (10.43.165.109) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 28 Dec 2022 16:48:34 +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:30 +0000 From: Hanna Hawa To: , , , , , CC: , , , , , , , , Subject: [PATCH v5 1/2] pinctrl: Add an API to get the pinctrl pins if initialized Date: Wed, 28 Dec 2022 16:48:12 +0000 Message-ID: <20221228164813.67964-2-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=-10.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, 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 Add an API to get the pinctrl pins if it was initialized before driver probed. This API will be used in I2C core to get the device pinctrl information for recovery state change. Signed-off-by: Hanna Hawa Reviewed-by: Andy Shevchenko --- include/linux/pinctrl/devinfo.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/linux/pinctrl/devinfo.h b/include/linux/pinctrl/devinfo.h index a48ff69acddd..670588bfc7ab 100644 --- a/include/linux/pinctrl/devinfo.h +++ b/include/linux/pinctrl/devinfo.h @@ -16,6 +16,8 @@ #ifdef CONFIG_PINCTRL +#include + /* The device core acts as a consumer toward pinctrl */ #include @@ -40,6 +42,14 @@ struct dev_pin_info { extern int pinctrl_bind_pins(struct device *dev); extern int pinctrl_init_done(struct device *dev); +static inline struct pinctrl *dev_pinctrl(struct device *dev) +{ + if (!dev->pins) + return NULL; + + return dev->pins->p; +} + #else struct device; @@ -56,5 +66,10 @@ static inline int pinctrl_init_done(struct device *dev) return 0; } +static inline struct pinctrl *dev_pinctrl(struct device *dev) +{ + return NULL; +} + #endif /* CONFIG_PINCTRL */ #endif /* PINCTRL_DEVINFO_H */ -- 2.38.1