From patchwork Mon Nov 13 13:15:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 743611 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA3C61DFEA for ; Mon, 13 Nov 2023 13:16:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="UbnIhs5e" Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0C9DD6C; Mon, 13 Nov 2023 05:16:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699881374; x=1731417374; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=0W1lXUBGP+iBxAlWICinNyER0ndu/deNSI5T1s1ZuWI=; b=UbnIhs5elNDtBzhF84Cix8lCguYE7k+jHZkAjJ3bGViK6+q6FM1tEFYp Ifo2zUTTUDfXLECXZVfF1R3LGs/bs4iIqUKUuNq01wf1WCV99qJ5MXrBb StF3TlsDv9Z5zSlhn9WF0JR6iqoiTO4IMDC6lxJCyKkLTNNFc6B2e+fHG 4lXFhv56HFHqR7bkqN04Qgw9jo2mwAMRsoK5NHaGpM5Vw4N8tjlamy6bV XzXTgYvKLE17wb4aexiyHwJFeINk5aDvljQ1XFNsswVGJNq3THOM0Pc4z 89vUdRkUnB+zlkD6YBepCC+9y8vNVvNL8zV/UdtOznn6459PZOtconI/f A==; X-IronPort-AV: E=McAfee;i="6600,9927,10893"; a="454726902" X-IronPort-AV: E=Sophos;i="6.03,299,1694761200"; d="scan'208";a="454726902" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Nov 2023 05:16:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,299,1694761200"; d="scan'208";a="5649391" Received: from inlubt0316.iind.intel.com ([10.191.20.213]) by fmviesa002.fm.intel.com with ESMTP; 13 Nov 2023 05:16:12 -0800 From: Raag Jadav To: linus.walleij@linaro.org, brgl@bgdev.pl, mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, mallikarjunappa.sangannavar@intel.com, bala.senthil@intel.com, Raag Jadav Subject: [PATCH v1 1/3] gpio: tangier: use EXPORT_NS_GPL_SIMPLE_DEV_PM_OPS() helper Date: Mon, 13 Nov 2023 18:45:58 +0530 Message-Id: <20231113131600.10828-2-raag.jadav@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231113131600.10828-1-raag.jadav@intel.com> References: <20231113131600.10828-1-raag.jadav@intel.com> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Use EXPORT_NS_GPL_SIMPLE_DEV_PM_OPS() helper to export pm_ops to GPIO_TANGIER namespace, so that they can be reused. Signed-off-by: Raag Jadav --- drivers/gpio/gpio-tangier.c | 3 +++ drivers/gpio/gpio-tangier.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/gpio/gpio-tangier.c b/drivers/gpio/gpio-tangier.c index 7ce3eddaed25..52d0868476e1 100644 --- a/drivers/gpio/gpio-tangier.c +++ b/drivers/gpio/gpio-tangier.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -531,6 +532,8 @@ int tng_gpio_resume(struct device *dev) } EXPORT_SYMBOL_NS_GPL(tng_gpio_resume, GPIO_TANGIER); +EXPORT_NS_GPL_SIMPLE_DEV_PM_OPS(tng_gpio_pm_ops, tng_gpio_suspend, tng_gpio_resume, GPIO_TANGIER); + MODULE_AUTHOR("Andy Shevchenko "); MODULE_AUTHOR("Pandith N "); MODULE_AUTHOR("Raag Jadav "); diff --git a/drivers/gpio/gpio-tangier.h b/drivers/gpio/gpio-tangier.h index 16c4f22908fb..333e5f79b908 100644 --- a/drivers/gpio/gpio-tangier.h +++ b/drivers/gpio/gpio-tangier.h @@ -13,6 +13,7 @@ #define _GPIO_TANGIER_H_ #include +#include #include #include @@ -114,4 +115,6 @@ int devm_tng_gpio_probe(struct device *dev, struct tng_gpio *gpio); int tng_gpio_suspend(struct device *dev); int tng_gpio_resume(struct device *dev); +extern const struct dev_pm_ops tng_gpio_pm_ops; + #endif /* _GPIO_TANGIER_H_ */ From patchwork Mon Nov 13 13:15:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 744523 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5F031E511 for ; Mon, 13 Nov 2023 13:16:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="MHj9hizD" Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD5FF1724; Mon, 13 Nov 2023 05:16:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699881377; x=1731417377; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=cVMB2JEbcvllLrApb7yUV501OiVQ89spuRHP1dIfQB0=; b=MHj9hizDydxhMqNLgi0oM0+3rCZP+2ddYOI83bNt52QA3M9PK+1IcC38 2QOdpTIb+l7lPIPrJGNdtWz+QlzKrMy8yF6O7LBXd2kioUu3SvRwR6PlU 1muyvej7YuVkmsSOaxH+SiekOPMP8sOaHV8T3jAAlP8sjcjcATLOqnc3b TM7AFSoGm/rMKIUeaFojxQqPhlglTqq2tA43RXCDO182VqOWq5mB9/JoX qJcjY3WxcNrvbpcHFeAl4nSX9lVmsaTD/3yqyeqpDOOoYdm2zGlPar2R8 6Xng2+wDNxKO9Zx+T8jUkRP4QJcj2W97hTsVpu5bC2t1KBX4uuU7OEBXh w==; X-IronPort-AV: E=McAfee;i="6600,9927,10893"; a="454726910" X-IronPort-AV: E=Sophos;i="6.03,299,1694761200"; d="scan'208";a="454726910" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Nov 2023 05:16:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,299,1694761200"; d="scan'208";a="5649403" Received: from inlubt0316.iind.intel.com ([10.191.20.213]) by fmviesa002.fm.intel.com with ESMTP; 13 Nov 2023 05:16:14 -0800 From: Raag Jadav To: linus.walleij@linaro.org, brgl@bgdev.pl, mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, mallikarjunappa.sangannavar@intel.com, bala.senthil@intel.com, Raag Jadav Subject: [PATCH v1 2/3] gpio: elkhartlake: reuse pm_ops from Intel Tangier driver Date: Mon, 13 Nov 2023 18:45:59 +0530 Message-Id: <20231113131600.10828-3-raag.jadav@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231113131600.10828-1-raag.jadav@intel.com> References: <20231113131600.10828-1-raag.jadav@intel.com> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Reuse tng_gpio_pm_ops from Intel Tangier driver instead of calling them through a local copy. Signed-off-by: Raag Jadav --- drivers/gpio/gpio-elkhartlake.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/gpio/gpio-elkhartlake.c b/drivers/gpio/gpio-elkhartlake.c index a9c8b16215be..887c0fe99d39 100644 --- a/drivers/gpio/gpio-elkhartlake.c +++ b/drivers/gpio/gpio-elkhartlake.c @@ -55,18 +55,6 @@ static int ehl_gpio_probe(struct platform_device *pdev) return 0; } -static int ehl_gpio_suspend(struct device *dev) -{ - return tng_gpio_suspend(dev); -} - -static int ehl_gpio_resume(struct device *dev) -{ - return tng_gpio_resume(dev); -} - -static DEFINE_SIMPLE_DEV_PM_OPS(ehl_gpio_pm_ops, ehl_gpio_suspend, ehl_gpio_resume); - static const struct platform_device_id ehl_gpio_ids[] = { { "gpio-elkhartlake" }, { } @@ -76,7 +64,7 @@ MODULE_DEVICE_TABLE(platform, ehl_gpio_ids); static struct platform_driver ehl_gpio_driver = { .driver = { .name = "gpio-elkhartlake", - .pm = pm_sleep_ptr(&ehl_gpio_pm_ops), + .pm = pm_sleep_ptr(&tng_gpio_pm_ops), }, .probe = ehl_gpio_probe, .id_table = ehl_gpio_ids, From patchwork Mon Nov 13 13:16:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 743610 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 959501F60A for ; Mon, 13 Nov 2023 13:16:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="PVXHOBgb" Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A332A171A; Mon, 13 Nov 2023 05:16:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699881380; x=1731417380; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=aKYkLQ60x1KnWYEBMDdCZzSTS/+78cy9Ut9qwrapwDw=; b=PVXHOBgb+6b5NIfC0hFmx0NrJPbsD7oIDXBglqvYtssatpDnnDBTTpQl AFtIRxdWBe6HYsDWmd6kmIuqusvRS6JzXlrGH6J8+JbYPuCiRo6aEI9lD IwM+QtEnzIOaoJm365i4FSEDsvvLAaEzn1TUaSQSvv+k24/luwZQHwQX0 SbrwogojwWwC4MkfJrjHnVWAqs4T19LWScdBF0BMP421o0BZaJMLkdOnn WaomKQbwRDsUOP3L4VIAcgS9/oBVQK3OBPSBJ4S9fkuo2UFQAkwM5Tddr 2htrlyKd/pVm/ByPf0gd3xzmy/Xo2JHj1h2yUVPuTcdxRfYLD5v45fl9T g==; X-IronPort-AV: E=McAfee;i="6600,9927,10893"; a="454726918" X-IronPort-AV: E=Sophos;i="6.03,299,1694761200"; d="scan'208";a="454726918" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Nov 2023 05:16:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,299,1694761200"; d="scan'208";a="5649419" Received: from inlubt0316.iind.intel.com ([10.191.20.213]) by fmviesa002.fm.intel.com with ESMTP; 13 Nov 2023 05:16:17 -0800 From: Raag Jadav To: linus.walleij@linaro.org, brgl@bgdev.pl, mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, mallikarjunappa.sangannavar@intel.com, bala.senthil@intel.com, Raag Jadav Subject: [PATCH v1 3/3] gpio: tangier: unexport suspend/resume handles Date: Mon, 13 Nov 2023 18:46:00 +0530 Message-Id: <20231113131600.10828-4-raag.jadav@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231113131600.10828-1-raag.jadav@intel.com> References: <20231113131600.10828-1-raag.jadav@intel.com> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Unexport suspend/resume handles for the lack of external users and while at it, make them static, so that they can be discarded by the compiler if not used (CONFIG_PM_SLEEP=n). Signed-off-by: Raag Jadav --- drivers/gpio/gpio-tangier.c | 6 ++---- drivers/gpio/gpio-tangier.h | 3 --- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/gpio/gpio-tangier.c b/drivers/gpio/gpio-tangier.c index 52d0868476e1..158fa9054e9c 100644 --- a/drivers/gpio/gpio-tangier.c +++ b/drivers/gpio/gpio-tangier.c @@ -478,7 +478,7 @@ int devm_tng_gpio_probe(struct device *dev, struct tng_gpio *gpio) } EXPORT_SYMBOL_NS_GPL(devm_tng_gpio_probe, GPIO_TANGIER); -int tng_gpio_suspend(struct device *dev) +static int tng_gpio_suspend(struct device *dev) { struct tng_gpio *priv = dev_get_drvdata(dev); struct tng_gpio_context *ctx = priv->ctx; @@ -503,9 +503,8 @@ int tng_gpio_suspend(struct device *dev) return 0; } -EXPORT_SYMBOL_NS_GPL(tng_gpio_suspend, GPIO_TANGIER); -int tng_gpio_resume(struct device *dev) +static int tng_gpio_resume(struct device *dev) { struct tng_gpio *priv = dev_get_drvdata(dev); struct tng_gpio_context *ctx = priv->ctx; @@ -530,7 +529,6 @@ int tng_gpio_resume(struct device *dev) return 0; } -EXPORT_SYMBOL_NS_GPL(tng_gpio_resume, GPIO_TANGIER); EXPORT_NS_GPL_SIMPLE_DEV_PM_OPS(tng_gpio_pm_ops, tng_gpio_suspend, tng_gpio_resume, GPIO_TANGIER); diff --git a/drivers/gpio/gpio-tangier.h b/drivers/gpio/gpio-tangier.h index 333e5f79b908..ca7ab6cf6fa5 100644 --- a/drivers/gpio/gpio-tangier.h +++ b/drivers/gpio/gpio-tangier.h @@ -112,9 +112,6 @@ struct tng_gpio { int devm_tng_gpio_probe(struct device *dev, struct tng_gpio *gpio); -int tng_gpio_suspend(struct device *dev); -int tng_gpio_resume(struct device *dev); - extern const struct dev_pm_ops tng_gpio_pm_ops; #endif /* _GPIO_TANGIER_H_ */