linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
To: Phil Reid <preid@electromag.com.au>
Cc: linus.walleij@linaro.org, robh+dt@kernel.org,
	mark.rutland@arm.com, poeschel@lemonage.de,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 5/7] pinctrl: mcp23s08: add open drain configuration for irq pinctrl
Date: Sun, 8 Oct 2017 23:16:55 +0200	[thread overview]
Message-ID: <20171008211655.7o77rxdxvsf44xds@earth> (raw)
In-Reply-To: <1507266491-73971-6-git-send-email-preid@electromag.com.au>

[-- Attachment #1: Type: text/plain, Size: 1712 bytes --]

Hi,

On Fri, Oct 06, 2017 at 01:08:09PM +0800, Phil Reid wrote:
> The mcp23s08 series device can be configured for wired and interupts
> using an external pullup and open drain output via the IOCON_ODR bit.
> And "microchip,irq-open-drain" property to enable this.
> 
> Signed-off-by: Phil Reid <preid@electromag.com.au>

Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>

-- Sebastian

> ---
>  drivers/pinctrl/pinctrl-mcp23s08.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/pinctrl/pinctrl-mcp23s08.c b/drivers/pinctrl/pinctrl-mcp23s08.c
> index 8d356df..150f216 100644
> --- a/drivers/pinctrl/pinctrl-mcp23s08.c
> +++ b/drivers/pinctrl/pinctrl-mcp23s08.c
> @@ -780,6 +780,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
>  {
>  	int status, ret;
>  	bool mirror = false;
> +	bool open_drain = false;
>  
>  	mutex_init(&mcp->lock);
>  
> @@ -876,6 +877,8 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
>  					      "microchip,irq-active-high");
>  
>  		mirror = device_property_read_bool(dev, "microchip,irq-mirror");
> +		open_drain = device_property_read_bool(dev,
> +						    "microchip,irq-open-drain");
>  	}
>  
>  	if ((status & IOCON_SEQOP) || !(status & IOCON_HAEN) || mirror ||
> @@ -891,6 +894,9 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
>  		if (mirror)
>  			status |= IOCON_MIRROR | (IOCON_MIRROR << 8);
>  
> +		if (open_drain)
> +			status |= IOCON_ODR | (IOCON_ODR << 8);
> +
>  		if (type == MCP_TYPE_S18 || type == MCP_TYPE_018)
>  			status |= IOCON_INTCC | (IOCON_INTCC << 8);
>  
> -- 
> 1.8.3.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-10-08 21:16 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-06  5:08 [PATCH v2 0/7] pinctrl: mcp32s08: add support for mcp23018 Phil Reid
     [not found] ` <1507266491-73971-1-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
2017-10-06  5:08   ` [PATCH v2 1/7] pinctrl: change Kconfig PINCTRL variable to a menuconfig Phil Reid
     [not found]     ` <1507266491-73971-2-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
2017-10-08 21:24       ` Sebastian Reichel
2017-10-11  7:58     ` Linus Walleij
2017-10-06  5:08   ` [PATCH v2 2/7] dt-bindings: pinctrl: add mcp23018 to mcp23s08 documentation Phil Reid
     [not found]     ` <1507266491-73971-3-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
2017-10-08 21:18       ` Sebastian Reichel
2017-10-11  8:04       ` Linus Walleij
2017-10-06  5:08   ` [PATCH v2 3/7] gpio: mcp23s08: add support for mcp23018 Phil Reid
     [not found]     ` <1507266491-73971-4-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
2017-10-08 21:18       ` Sebastian Reichel
2017-10-19  7:00         ` Phil Reid
     [not found]           ` <b749e94a-94e4-0087-aea2-99183b25b5ef-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
2017-10-19  8:24             ` Linus Walleij
2017-10-06  5:08   ` [PATCH v2 5/7] pinctrl: mcp23s08: add open drain configuration for irq pinctrl Phil Reid
2017-10-08 21:16     ` Sebastian Reichel [this message]
     [not found]     ` <1507266491-73971-6-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
2017-10-11  8:16       ` Linus Walleij
2017-10-06  5:08   ` [PATCH v2 6/7] pinctrl: mcp23s08: remove hardcoded irq polarity in irq_setup Phil Reid
2017-10-08 21:14     ` Sebastian Reichel
     [not found]     ` <1507266491-73971-7-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
2017-10-11  8:17       ` Linus Walleij
2017-10-12  9:04       ` Linus Walleij
     [not found]         ` <CACRpkdaWNthg5OU3ZiSKjPe59cJF5A6jucQ=3bQdz3uAsJ=3dQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-10-12 14:27           ` Phil Reid
2017-10-06  5:08   ` [PATCH v2 7/7] pinctrl: mcp23s08: remove unused variables from pinconf_set Phil Reid
2017-10-08 21:12     ` Sebastian Reichel
     [not found]     ` <1507266491-73971-8-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
2017-10-11  8:19       ` Linus Walleij
2017-10-06  5:08 ` [PATCH v2 4/7] dt-bindings: pinctrl: mcp23s08: add documentation for irq-open-drain Phil Reid
2017-10-08 21:15   ` Sebastian Reichel
     [not found]   ` <1507266491-73971-5-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
2017-10-11  8:15     ` 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=20171008211655.7o77rxdxvsf44xds@earth \
    --to=sebastian.reichel@collabora.co.uk \
    --cc=devicetree@vger.kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=poeschel@lemonage.de \
    --cc=preid@electromag.com.au \
    --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).