From: Ray Jui <ray.jui@broadcom.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Alexandre Courbot <gnurou@gmail.com>,
Rob Herring <robh+dt@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
bcm-kernel-feedback-list@broadcom.com,
devicetree@vger.kernel.org, Ray Jui <ray.jui@broadcom.com>
Subject: [PATCH 4/4] pinctrl: iproc: Allow PINCONF to be disabled completely
Date: Tue, 12 Apr 2016 17:15:23 -0700 [thread overview]
Message-ID: <1460506523-6249-5-git-send-email-ray.jui@broadcom.com> (raw)
In-Reply-To: <1460506523-6249-1-git-send-email-ray.jui@broadcom.com>
In some of the future iProc based SoCs, pinconf is handled by another
block and the iProc GPIO controller is solely used as a GPIO controller.
This patch adds support of a new compatible string "brcm,iproc-gpio-only",
that is introduced to handle this case, where pinconf functions in this
driver are completely disabled
Signed-off-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-by: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com>
Reviewed-by: Jon Mason <jon.mason@broadcom.com>
Reviewed-by: Scott Branden <scott.branden@broadcom.com>
---
drivers/pinctrl/bcm/pinctrl-iproc-gpio.c | 41 ++++++++++++++++++--------------
1 file changed, 23 insertions(+), 18 deletions(-)
diff --git a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
index 12a8922..bb5cfd9 100644
--- a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
+++ b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
@@ -716,7 +716,8 @@ static const struct of_device_id iproc_gpio_of_match[] = {
{ .compatible = "brcm,cygnus-asiu-gpio" },
{ .compatible = "brcm,cygnus-crmu-gpio" },
{ .compatible = "brcm,iproc-gpio" },
- { }
+ { .compatible = "brcm,iproc-gpio-only" },
+ { /* sentinel */ }
};
static int iproc_gpio_probe(struct platform_device *pdev)
@@ -781,24 +782,28 @@ static int iproc_gpio_probe(struct platform_device *pdev)
return ret;
}
- ret = iproc_gpio_register_pinconf(chip);
- if (ret) {
- dev_err(dev, "unable to register pinconf\n");
- goto err_rm_gpiochip;
- }
-
- /*
- * Optional DT property to disable unsupported pinconf parameters for
- * a particular iProc SoC
- */
- ret = of_property_read_u32(dev->of_node, "brcm,pinconf-func-off",
- &pinconf_disable_mask);
- if (!ret) {
- ret = iproc_pinconf_disable_map_create(chip,
- pinconf_disable_mask);
+ if (!of_device_is_compatible(dev->of_node, "brcm,iproc-gpio-only")) {
+ ret = iproc_gpio_register_pinconf(chip);
if (ret) {
- dev_err(dev, "unable to create pinconf disable map\n");
- goto err_unregister_pinconf;
+ dev_err(dev, "unable to register pinconf\n");
+ goto err_rm_gpiochip;
+ }
+
+ /*
+ * Optional DT property to disable unsupported pinconf
+ * parameters for a particular iProc SoC
+ */
+ ret = of_property_read_u32(dev->of_node,
+ "brcm,pinconf-func-off",
+ &pinconf_disable_mask);
+ if (!ret) {
+ ret = iproc_pinconf_disable_map_create(chip,
+ pinconf_disable_mask);
+ if (ret) {
+ dev_err(dev,
+ "unable to create pinconf disable map\n");
+ goto err_unregister_pinconf;
+ }
}
}
--
2.1.4
next prev parent reply other threads:[~2016-04-13 0:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-13 0:15 [PATCH 0/4] Additional iProc GPIO support Ray Jui
2016-04-13 0:15 ` [PATCH 1/4] dt-bindings: Update iProc GPIO bindings Ray Jui
2016-04-13 0:15 ` [PATCH 2/4] pinctrl: iproc: Allow certain PINCONF functions to be disabled Ray Jui
2016-04-15 8:20 ` Linus Walleij
2016-04-18 19:22 ` Ray Jui
[not found] ` <1460506523-6249-1-git-send-email-ray.jui-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2016-04-13 0:15 ` [PATCH 3/4] dt-bindings: Update iProc GPIO bindings Ray Jui
2016-04-14 14:38 ` Rob Herring
2016-04-18 18:27 ` Ray Jui
2016-04-13 0:15 ` Ray Jui [this message]
2016-04-15 8:24 ` [PATCH 4/4] pinctrl: iproc: Allow PINCONF to be disabled completely Linus Walleij
2016-04-18 19:30 ` Ray Jui
2016-04-29 8:43 ` Linus Walleij
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=1460506523-6249-5-git-send-email-ray.jui@broadcom.com \
--to=ray.jui@broadcom.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=devicetree@vger.kernel.org \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).