Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp6270990rwj; Wed, 21 Dec 2022 13:07:04 -0800 (PST) X-Google-Smtp-Source: AMrXdXvDo2l4HLnm2ZvkY6LaVFzyRVdQpPWm8ZiYLYzlw2DuGWwbCP1FUwyeaXhv9ODz7RbUr1x2 X-Received: by 2002:a17:90a:1bc7:b0:223:b680:d78b with SMTP id r7-20020a17090a1bc700b00223b680d78bmr3408495pjr.37.1671656823949; Wed, 21 Dec 2022 13:07:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671656823; cv=none; d=google.com; s=arc-20160816; b=AmlY5e/bT2WrvR8HZgpZz/5TRszNvs7ORrYoBs5KZaI1K3Thsg3ABqJF0Bz1nb9P2D xKglVOFpasUyRfWtdn7RHI7QejBqnSBJ8h1CRsLdxEANnafAQaZjR6Rm8lhQjWzvWSyx nk+W5Ulag/y6u5qw/4kh86XjrK+c6v6YNmJMBmiCb3p6P0+7WrUyWEK8bgLypJf0xCOF HAN6wJE6XTzx9uYdyvppacjvKW9NWVKGLCvWLIvYBNqyxAfngy7gJfO2SVGpObSS1/KO K5SOxKWlZWte3r8BbwY1QC1Xno/0cmRddR8URQOeKFmATASIs72Ll4q8Ew0czy7NFjp6 uxZA== 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=6zCe4ufIr/No26lRqlARtCkg/ggfyQN/WYU8B/o/Vas=; b=s2Ytbu0LNTQuFhMYkSsk49Nbgw1kVPTGFOfSzqNN1YDAG9Tu9mJNY87XDJSV+mKUMK Sh6fklzY6DS0o3ugGTdDBC452dfNyeDitBoJpLk8BsKfKHpFN5E9xCKedF35DXzz7ffp tEpUpFYCP9DAJUwyO7ARKVTPrmy3fV+CIi5WcffemBS5YzLcSy8Ox1cu457G56AqgAYE 04VWwrr1OkRPqiltMgCVuAK+E8gL4xuMo4wThmoynLRTVH249kpf7yzvYd9Mr946rAHb bCn03Vsl/K0vHtodLJjmTEddZF1M7oQeb86LLSDeg5AG92GHIiG3JhtWas9lbR+7grcd F+Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=mtpeyBEm; 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 h6-20020a17090acf0600b0020aeaa98ed4si2617675pju.93.2022.12.21.13.06.54; Wed, 21 Dec 2022 13:07:03 -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=mtpeyBEm; 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 S229601AbiLUUwL (ORCPT + 68 others); Wed, 21 Dec 2022 15:52:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234797AbiLUUwH (ORCPT ); Wed, 21 Dec 2022 15:52:07 -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 C1DB12529B; Wed, 21 Dec 2022 12:52:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1671655927; x=1703191927; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6zCe4ufIr/No26lRqlARtCkg/ggfyQN/WYU8B/o/Vas=; b=mtpeyBEm9KpTL8XvsKUynOmRrUyqMQZG46wM7/BQBs4rNsLZiHSI5Gzf qc2mgB5crYXOxrFyFX176Ri4y78WUhzmMLUt7De17KyHuepo8JBRwr22s fx+cZmh9u1PqLLAvUuMI/JrKqAdcATcpgLx9USS8viKu6Scenuwr6kl5E 8=; X-IronPort-AV: E=Sophos;i="5.96,263,1665446400"; d="scan'208";a="279788630" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-pdx-2a-m6i4x-44b6fc51.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; 21 Dec 2022 20:52:05 +0000 Received: from EX13D43EUA001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-pdx-2a-m6i4x-44b6fc51.us-west-2.amazon.com (Postfix) with ESMTPS id 8615DA3613; Wed, 21 Dec 2022 20:52:04 +0000 (UTC) Received: from EX19D019EUA002.ant.amazon.com (10.252.50.84) by EX13D43EUA001.ant.amazon.com (10.43.165.66) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 21 Dec 2022 20:52:02 +0000 Received: from dev-dsk-hhhawa-1b-84e0d7ff.eu-west-1.amazon.com (10.43.162.134) 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, 21 Dec 2022 20:51:58 +0000 From: Hanna Hawa To: , , , , CC: , , , , , , , , Subject: [PATCH v4 1/2] pinctrl: Add an API to get the pinctrl pins if initialized Date: Wed, 21 Dec 2022 20:51:15 +0000 Message-ID: <20221221205116.73941-2-hhhawa@amazon.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221221205116.73941-1-hhhawa@amazon.com> References: <20221221205116.73941-1-hhhawa@amazon.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.43.162.134] X-ClientProxiedBy: EX13D28UWC004.ant.amazon.com (10.43.162.24) 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 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 --- include/linux/pinctrl/devinfo.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/linux/pinctrl/devinfo.h b/include/linux/pinctrl/devinfo.h index a48ff69acddd..83eef2ac8cd6 100644 --- a/include/linux/pinctrl/devinfo.h +++ b/include/linux/pinctrl/devinfo.h @@ -17,6 +17,7 @@ #ifdef CONFIG_PINCTRL /* The device core acts as a consumer toward pinctrl */ +#include #include /** @@ -40,6 +41,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 +65,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