From: Caleb Connolly <kc@postmarketos.org>
To: Caleb Connolly <kc@postmarketos.org>,
Rob Herring <robh+dt@kernel.org>,
Heiko Stuebner <heiko@sntech.de>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-gpio@vger.kernel.org
Cc: ~postmarketos/upstreaming@lists.sr.ht, martijn@brixit.nl,
Arnaud Ferraris <arnaud.ferraris@collabora.com>
Subject: [PATCH 2/4] pinctrl/rockchip: support setting input-enable param
Date: Mon, 28 Mar 2022 01:50:03 +0100 [thread overview]
Message-ID: <20220328005005.72492-3-kc@postmarketos.org> (raw)
In-Reply-To: <20220328005005.72492-1-kc@postmarketos.org>
Handle the PIN_CONFIG_INPUT_ENABLE param for configuring GPIOs as input.
Signed-off-by: Caleb Connolly <kc@postmarketos.org>
---
drivers/pinctrl/pinctrl-rockchip.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index d54fc1cdf609..9d50d9756bb9 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -2129,7 +2129,7 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
param = pinconf_to_config_param(configs[i]);
arg = pinconf_to_config_argument(configs[i]);
- if (param == (PIN_CONFIG_OUTPUT | PIN_CONFIG_INPUT_ENABLE)) {
+ if (param == PIN_CONFIG_OUTPUT || param == PIN_CONFIG_INPUT_ENABLE) {
/*
* Check for gpio driver not being probed yet.
* The lock makes sure that either gpio-probe has completed
@@ -2181,6 +2181,16 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
if (rc)
return rc;
break;
+ case PIN_CONFIG_INPUT_ENABLE:
+ rc = rockchip_set_mux(bank, pin - bank->pin_base,
+ RK_FUNC_GPIO);
+ if (rc != RK_FUNC_GPIO)
+ return -EINVAL;
+
+ rc = gpio->direction_input(gpio, pin - bank->pin_base);
+ if (rc)
+ return rc;
+ break;
case PIN_CONFIG_DRIVE_STRENGTH:
/* rk3288 is the first with per-pin drive-strength */
if (!info->ctrl->drv_calc_reg)
--
2.35.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
WARNING: multiple messages have this Message-ID
From: Caleb Connolly <kc@postmarketos.org>
To: Caleb Connolly <kc@postmarketos.org>,
Rob Herring <robh+dt@kernel.org>,
Heiko Stuebner <heiko@sntech.de>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-gpio@vger.kernel.org
Cc: ~postmarketos/upstreaming@lists.sr.ht, martijn@brixit.nl,
Arnaud Ferraris <arnaud.ferraris@collabora.com>
Subject: [PATCH 2/4] pinctrl/rockchip: support setting input-enable param
Date: Mon, 28 Mar 2022 01:50:03 +0100 [thread overview]
Message-ID: <20220328005005.72492-3-kc@postmarketos.org> (raw)
In-Reply-To: <20220328005005.72492-1-kc@postmarketos.org>
Handle the PIN_CONFIG_INPUT_ENABLE param for configuring GPIOs as input.
Signed-off-by: Caleb Connolly <kc@postmarketos.org>
---
drivers/pinctrl/pinctrl-rockchip.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index d54fc1cdf609..9d50d9756bb9 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -2129,7 +2129,7 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
param = pinconf_to_config_param(configs[i]);
arg = pinconf_to_config_argument(configs[i]);
- if (param == (PIN_CONFIG_OUTPUT | PIN_CONFIG_INPUT_ENABLE)) {
+ if (param == PIN_CONFIG_OUTPUT || param == PIN_CONFIG_INPUT_ENABLE) {
/*
* Check for gpio driver not being probed yet.
* The lock makes sure that either gpio-probe has completed
@@ -2181,6 +2181,16 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
if (rc)
return rc;
break;
+ case PIN_CONFIG_INPUT_ENABLE:
+ rc = rockchip_set_mux(bank, pin - bank->pin_base,
+ RK_FUNC_GPIO);
+ if (rc != RK_FUNC_GPIO)
+ return -EINVAL;
+
+ rc = gpio->direction_input(gpio, pin - bank->pin_base);
+ if (rc)
+ return rc;
+ break;
case PIN_CONFIG_DRIVE_STRENGTH:
/* rk3288 is the first with per-pin drive-strength */
if (!info->ctrl->drv_calc_reg)
--
2.35.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID
From: Caleb Connolly <kc@postmarketos.org>
To: Caleb Connolly <kc@postmarketos.org>,
Rob Herring <robh+dt@kernel.org>,
Heiko Stuebner <heiko@sntech.de>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-gpio@vger.kernel.org
Cc: ~postmarketos/upstreaming@lists.sr.ht, martijn@brixit.nl,
Arnaud Ferraris <arnaud.ferraris@collabora.com>
Subject: [PATCH 2/4] pinctrl/rockchip: support setting input-enable param
Date: Mon, 28 Mar 2022 01:50:03 +0100 [thread overview]
Message-ID: <20220328005005.72492-3-kc@postmarketos.org> (raw)
In-Reply-To: <20220328005005.72492-1-kc@postmarketos.org>
Handle the PIN_CONFIG_INPUT_ENABLE param for configuring GPIOs as input.
Signed-off-by: Caleb Connolly <kc@postmarketos.org>
---
drivers/pinctrl/pinctrl-rockchip.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index d54fc1cdf609..9d50d9756bb9 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -2129,7 +2129,7 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
param = pinconf_to_config_param(configs[i]);
arg = pinconf_to_config_argument(configs[i]);
- if (param == (PIN_CONFIG_OUTPUT | PIN_CONFIG_INPUT_ENABLE)) {
+ if (param == PIN_CONFIG_OUTPUT || param == PIN_CONFIG_INPUT_ENABLE) {
/*
* Check for gpio driver not being probed yet.
* The lock makes sure that either gpio-probe has completed
@@ -2181,6 +2181,16 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
if (rc)
return rc;
break;
+ case PIN_CONFIG_INPUT_ENABLE:
+ rc = rockchip_set_mux(bank, pin - bank->pin_base,
+ RK_FUNC_GPIO);
+ if (rc != RK_FUNC_GPIO)
+ return -EINVAL;
+
+ rc = gpio->direction_input(gpio, pin - bank->pin_base);
+ if (rc)
+ return rc;
+ break;
case PIN_CONFIG_DRIVE_STRENGTH:
/* rk3288 is the first with per-pin drive-strength */
if (!info->ctrl->drv_calc_reg)
--
2.35.1
next prev parent reply other threads:[~2022-03-28 0:53 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-28 0:50 [PATCH 0/4] rockchip: support configuring pins as input Caleb Connolly
2022-03-28 0:50 ` Caleb Connolly
2022-03-28 0:50 ` Caleb Connolly
2022-03-28 0:50 ` [PATCH 1/4] pinctrl/rockchip: support deferring other gpio params Caleb Connolly
2022-03-28 0:50 ` Caleb Connolly
2022-03-28 0:50 ` Caleb Connolly
2022-03-28 0:50 ` Caleb Connolly [this message]
2022-03-28 0:50 ` [PATCH 2/4] pinctrl/rockchip: support setting input-enable param Caleb Connolly
2022-03-28 0:50 ` Caleb Connolly
2022-03-28 0:50 ` [PATCH 3/4] gpio/rockchip: handle deferring input-enable pinconfs Caleb Connolly
2022-03-28 0:50 ` Caleb Connolly
2022-03-28 0:50 ` Caleb Connolly
2022-04-18 19:47 ` Bartosz Golaszewski
2022-04-18 19:47 ` Bartosz Golaszewski
2022-04-18 19:47 ` Bartosz Golaszewski
2022-03-28 0:50 ` [PATCH 4/4] arm64: dts: rockchip: rk3399: add an input enable pinconf Caleb Connolly
2022-03-28 0:50 ` Caleb Connolly
2022-03-28 0:50 ` Caleb Connolly
2022-04-19 22:37 ` [PATCH 0/4] rockchip: support configuring pins as input Linus Walleij
2022-04-19 22:37 ` Linus Walleij
2022-04-19 22:37 ` Linus Walleij
2022-04-30 14:05 ` (subset) " Heiko Stuebner
2022-04-30 14:05 ` Heiko Stuebner
2022-04-30 14:05 ` Heiko Stuebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220328005005.72492-3-kc@postmarketos.org \
--to=kc@postmarketos.org \
--cc=arnaud.ferraris@collabora.com \
--cc=brgl@bgdev.pl \
--cc=devicetree@vger.kernel.org \
--cc=heiko@sntech.de \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=martijn@brixit.nl \
--cc=robh+dt@kernel.org \
--cc=~postmarketos/upstreaming@lists.sr.ht \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.