* [PATCH v2 1/7] pinctrl: change Kconfig PINCTRL variable to a menuconfig
[not found] ` <1507266491-73971-1-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
@ 2017-10-06 5:08 ` Phil Reid
[not found] ` <1507266491-73971-2-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
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
` (4 subsequent siblings)
5 siblings, 2 replies; 25+ messages in thread
From: Phil Reid @ 2017-10-06 5:08 UTC (permalink / raw)
To: linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
poeschel-Xtl8qvBWbHwb1SvskN2V4Q,
preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO,
sre-DgEjT+Ai2ygdnm+yROfE0A, linux-gpio-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
This allows PINCTRL to be selected manually to allow enabling of the
mcp23s08 i2c/spi gpio driver. Which is not platform specific.
Signed-off-by: Phil Reid <preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
---
drivers/pinctrl/Kconfig | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
index 1778cf4..8da29e9 100644
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -2,11 +2,10 @@
# PINCTRL infrastructure and drivers
#
-config PINCTRL
- bool
+menuconfig PINCTRL
+ bool "Pin controllers"
-menu "Pin controllers"
- depends on PINCTRL
+if PINCTRL
config GENERIC_PINCTRL_GROUPS
bool
@@ -379,4 +378,4 @@ config PINCTRL_TB10X
depends on OF && ARC_PLAT_TB10X
select GPIOLIB
-endmenu
+endif
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 25+ messages in thread
[parent not found: <1507266491-73971-2-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>]
* Re: [PATCH v2 1/7] pinctrl: change Kconfig PINCTRL variable to a menuconfig
[not found] ` <1507266491-73971-2-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
@ 2017-10-08 21:24 ` Sebastian Reichel
0 siblings, 0 replies; 25+ messages in thread
From: Sebastian Reichel @ 2017-10-08 21:24 UTC (permalink / raw)
To: Phil Reid
Cc: linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
poeschel-Xtl8qvBWbHwb1SvskN2V4Q,
linux-gpio-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]
Hi,
On Fri, Oct 06, 2017 at 01:08:05PM +0800, Phil Reid wrote:
> This allows PINCTRL to be selected manually to allow enabling of the
> mcp23s08 i2c/spi gpio driver. Which is not platform specific.
FWIW with i2c/spi based pin controllers available it makes sense
to have this available everywhere. I actually did test my changes
using an i2c-tiny-usb controller with my x86 based notebook, so:
Reviewed-by: Sebastian Reichel <sebastian.reichel-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
-- Sebastian
> Signed-off-by: Phil Reid <preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
> ---
> drivers/pinctrl/Kconfig | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
> index 1778cf4..8da29e9 100644
> --- a/drivers/pinctrl/Kconfig
> +++ b/drivers/pinctrl/Kconfig
> @@ -2,11 +2,10 @@
> # PINCTRL infrastructure and drivers
> #
>
> -config PINCTRL
> - bool
> +menuconfig PINCTRL
> + bool "Pin controllers"
>
> -menu "Pin controllers"
> - depends on PINCTRL
> +if PINCTRL
>
> config GENERIC_PINCTRL_GROUPS
> bool
> @@ -379,4 +378,4 @@ config PINCTRL_TB10X
> depends on OF && ARC_PLAT_TB10X
> select GPIOLIB
>
> -endmenu
> +endif
> --
> 1.8.3.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v2 1/7] pinctrl: change Kconfig PINCTRL variable to a menuconfig
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-11 7:58 ` Linus Walleij
1 sibling, 0 replies; 25+ messages in thread
From: Linus Walleij @ 2017-10-11 7:58 UTC (permalink / raw)
To: Phil Reid
Cc: Rob Herring, Mark Rutland, Lars Poeschel, Sebastian Reichel,
linux-gpio@vger.kernel.org, devicetree@vger.kernel.org
On Fri, Oct 6, 2017 at 7:08 AM, Phil Reid <preid@electromag.com.au> wrote:
> This allows PINCTRL to be selected manually to allow enabling of the
> mcp23s08 i2c/spi gpio driver. Which is not platform specific.
>
> Signed-off-by: Phil Reid <preid@electromag.com.au>
Patch applied with Sebastian's review tag.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH v2 2/7] dt-bindings: pinctrl: add mcp23018 to mcp23s08 documentation
[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
@ 2017-10-06 5:08 ` Phil Reid
[not found] ` <1507266491-73971-3-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
2017-10-06 5:08 ` [PATCH v2 3/7] gpio: mcp23s08: add support for mcp23018 Phil Reid
` (3 subsequent siblings)
5 siblings, 1 reply; 25+ messages in thread
From: Phil Reid @ 2017-10-06 5:08 UTC (permalink / raw)
To: linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
poeschel-Xtl8qvBWbHwb1SvskN2V4Q,
preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO,
sre-DgEjT+Ai2ygdnm+yROfE0A, linux-gpio-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
This adds the compatible string for the mcp23018, which is the i2c variant
of the mcp23s18.
Signed-off-by: Phil Reid <preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
---
Documentation/devicetree/bindings/pinctrl/pinctrl-mcp23s08.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-mcp23s08.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-mcp23s08.txt
index c934106..8a5bf99 100644
--- a/Documentation/devicetree/bindings/pinctrl/pinctrl-mcp23s08.txt
+++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mcp23s08.txt
@@ -13,6 +13,7 @@ Required properties:
- "microchip,mcp23s18" for 16 GPIO SPI version
- "microchip,mcp23008" for 8 GPIO I2C version or
- "microchip,mcp23017" for 16 GPIO I2C version of the chip
+ - "microchip,mcp23018" for 16 GPIO I2C version
NOTE: Do not use the old mcp prefix any more. It is deprecated and will be
removed.
- #gpio-cells : Should be two.
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v2 3/7] gpio: mcp23s08: add support for mcp23018
[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
2017-10-06 5:08 ` [PATCH v2 2/7] dt-bindings: pinctrl: add mcp23018 to mcp23s08 documentation Phil Reid
@ 2017-10-06 5:08 ` Phil Reid
[not found] ` <1507266491-73971-4-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
2017-10-06 5:08 ` [PATCH v2 5/7] pinctrl: mcp23s08: add open drain configuration for irq pinctrl Phil Reid
` (2 subsequent siblings)
5 siblings, 1 reply; 25+ messages in thread
From: Phil Reid @ 2017-10-06 5:08 UTC (permalink / raw)
To: linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
poeschel-Xtl8qvBWbHwb1SvskN2V4Q,
preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO,
sre-DgEjT+Ai2ygdnm+yROfE0A, linux-gpio-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
This adds the required definitions for the mcp23018 which is the i2c
variant of the mcp23s18.
Signed-off-by: Phil Reid <preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
---
drivers/pinctrl/pinctrl-mcp23s08.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-mcp23s08.c b/drivers/pinctrl/pinctrl-mcp23s08.c
index 3e40d42..8d356df 100644
--- a/drivers/pinctrl/pinctrl-mcp23s08.c
+++ b/drivers/pinctrl/pinctrl-mcp23s08.c
@@ -25,6 +25,7 @@
#define MCP_TYPE_008 2
#define MCP_TYPE_017 3
#define MCP_TYPE_S18 4
+#define MCP_TYPE_018 5
#define MCP_MAX_DEV_PER_CS 8
@@ -837,6 +838,13 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
mcp->chip.ngpio = 16;
mcp->chip.label = "mcp23017";
break;
+
+ case MCP_TYPE_018:
+ mcp->regmap = devm_regmap_init_i2c(data, &mcp23x17_regmap);
+ mcp->reg_shift = 1;
+ mcp->chip.ngpio = 16;
+ mcp->chip.label = "mcp23018";
+ break;
#endif /* CONFIG_I2C */
default:
@@ -883,7 +891,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
if (mirror)
status |= IOCON_MIRROR | (IOCON_MIRROR << 8);
- if (type == MCP_TYPE_S18)
+ if (type == MCP_TYPE_S18 || type == MCP_TYPE_018)
status |= IOCON_INTCC | (IOCON_INTCC << 8);
ret = mcp_write(mcp, MCP_IOCON, status);
@@ -964,6 +972,10 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
.compatible = "microchip,mcp23017",
.data = (void *) MCP_TYPE_017,
},
+ {
+ .compatible = "microchip,mcp23018",
+ .data = (void *) MCP_TYPE_018,
+ },
/* NOTE: The use of the mcp prefix is deprecated and will be removed. */
{
.compatible = "mcp,mcp23008",
@@ -1013,6 +1025,7 @@ static int mcp230xx_probe(struct i2c_client *client,
static const struct i2c_device_id mcp230xx_id[] = {
{ "mcp23008", MCP_TYPE_008 },
{ "mcp23017", MCP_TYPE_017 },
+ { "mcp23018", MCP_TYPE_018 },
{ },
};
MODULE_DEVICE_TABLE(i2c, mcp230xx_id);
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [PATCH v2 5/7] pinctrl: mcp23s08: add open drain configuration for irq pinctrl
[not found] ` <1507266491-73971-1-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
` (2 preceding siblings ...)
2017-10-06 5:08 ` [PATCH v2 3/7] gpio: mcp23s08: add support for mcp23018 Phil Reid
@ 2017-10-06 5:08 ` Phil Reid
2017-10-08 21:16 ` Sebastian Reichel
[not found] ` <1507266491-73971-6-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
2017-10-06 5:08 ` [PATCH v2 6/7] pinctrl: mcp23s08: remove hardcoded irq polarity in irq_setup Phil Reid
2017-10-06 5:08 ` [PATCH v2 7/7] pinctrl: mcp23s08: remove unused variables from pinconf_set Phil Reid
5 siblings, 2 replies; 25+ messages in thread
From: Phil Reid @ 2017-10-06 5:08 UTC (permalink / raw)
To: linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
poeschel-Xtl8qvBWbHwb1SvskN2V4Q,
preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO,
sre-DgEjT+Ai2ygdnm+yROfE0A, linux-gpio-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
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-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
---
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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [PATCH v2 5/7] pinctrl: mcp23s08: add open drain configuration for irq pinctrl
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
[not found] ` <1507266491-73971-6-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
1 sibling, 0 replies; 25+ messages in thread
From: Sebastian Reichel @ 2017-10-08 21:16 UTC (permalink / raw)
To: Phil Reid
Cc: linus.walleij, robh+dt, mark.rutland, poeschel, linux-gpio,
devicetree
[-- 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 --]
^ permalink raw reply [flat|nested] 25+ messages in thread
[parent not found: <1507266491-73971-6-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>]
* Re: [PATCH v2 5/7] pinctrl: mcp23s08: add open drain configuration for irq pinctrl
[not found] ` <1507266491-73971-6-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
@ 2017-10-11 8:16 ` Linus Walleij
0 siblings, 0 replies; 25+ messages in thread
From: Linus Walleij @ 2017-10-11 8:16 UTC (permalink / raw)
To: Phil Reid
Cc: Rob Herring, Mark Rutland, Lars Poeschel, Sebastian Reichel,
linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On Fri, Oct 6, 2017 at 7:08 AM, Phil Reid <preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org> 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-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
See my comment on patch 4/7 for directions on what to do with this
patch.
Use standard binding, look at irq descriptor props, IRQF_SHARED.
Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH v2 6/7] pinctrl: mcp23s08: remove hardcoded irq polarity in irq_setup
[not found] ` <1507266491-73971-1-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
` (3 preceding siblings ...)
2017-10-06 5:08 ` [PATCH v2 5/7] pinctrl: mcp23s08: add open drain configuration for irq pinctrl Phil Reid
@ 2017-10-06 5:08 ` 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-06 5:08 ` [PATCH v2 7/7] pinctrl: mcp23s08: remove unused variables from pinconf_set Phil Reid
5 siblings, 2 replies; 25+ messages in thread
From: Phil Reid @ 2017-10-06 5:08 UTC (permalink / raw)
To: linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
poeschel-Xtl8qvBWbHwb1SvskN2V4Q,
preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO,
sre-DgEjT+Ai2ygdnm+yROfE0A, linux-gpio-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
The irq_active_high flag is for controlling the polarity of the output
from the mcp23s08 series devices. The polarity of the irq could be altered
by additional logic (eg inverters) between the device and irq input device.
The device-tree already allows for this as the irq can be specified in the
binding. So hardcoding it in the driver is overly restrictive.
There are no inkernel users of the mcp23s08 driver with irq's.
Signed-off-by: Phil Reid <preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
---
drivers/pinctrl/pinctrl-mcp23s08.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-mcp23s08.c b/drivers/pinctrl/pinctrl-mcp23s08.c
index 150f216..8dceaa1 100644
--- a/drivers/pinctrl/pinctrl-mcp23s08.c
+++ b/drivers/pinctrl/pinctrl-mcp23s08.c
@@ -630,11 +630,6 @@ static int mcp23s08_irq_setup(struct mcp23s08 *mcp)
int err;
unsigned long irqflags = IRQF_ONESHOT | IRQF_SHARED;
- if (mcp->irq_active_high)
- irqflags |= IRQF_TRIGGER_HIGH;
- else
- irqflags |= IRQF_TRIGGER_LOW;
-
err = devm_request_threaded_irq(chip->parent, mcp->irq, NULL,
mcp23s08_irq,
irqflags, dev_name(chip->parent), mcp);
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [PATCH v2 6/7] pinctrl: mcp23s08: remove hardcoded irq polarity in irq_setup
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>
1 sibling, 0 replies; 25+ messages in thread
From: Sebastian Reichel @ 2017-10-08 21:14 UTC (permalink / raw)
To: Phil Reid
Cc: linus.walleij, robh+dt, mark.rutland, poeschel, linux-gpio,
devicetree
[-- Attachment #1: Type: text/plain, Size: 1395 bytes --]
Hi,
On Fri, Oct 06, 2017 at 01:08:10PM +0800, Phil Reid wrote:
> The irq_active_high flag is for controlling the polarity of the output
> from the mcp23s08 series devices. The polarity of the irq could be altered
> by additional logic (eg inverters) between the device and irq input device.
> The device-tree already allows for this as the irq can be specified in the
> binding. So hardcoding it in the driver is overly restrictive.
>
> There are no inkernel users of the mcp23s08 driver with irq's.
>
> Signed-off-by: Phil Reid <preid@electromag.com.au>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
-- Sebastian
> ---
> drivers/pinctrl/pinctrl-mcp23s08.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-mcp23s08.c b/drivers/pinctrl/pinctrl-mcp23s08.c
> index 150f216..8dceaa1 100644
> --- a/drivers/pinctrl/pinctrl-mcp23s08.c
> +++ b/drivers/pinctrl/pinctrl-mcp23s08.c
> @@ -630,11 +630,6 @@ static int mcp23s08_irq_setup(struct mcp23s08 *mcp)
> int err;
> unsigned long irqflags = IRQF_ONESHOT | IRQF_SHARED;
>
> - if (mcp->irq_active_high)
> - irqflags |= IRQF_TRIGGER_HIGH;
> - else
> - irqflags |= IRQF_TRIGGER_LOW;
> -
> err = devm_request_threaded_irq(chip->parent, mcp->irq, NULL,
> mcp23s08_irq,
> irqflags, dev_name(chip->parent), mcp);
> --
> 1.8.3.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
[parent not found: <1507266491-73971-7-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>]
* Re: [PATCH v2 6/7] pinctrl: mcp23s08: remove hardcoded irq polarity in irq_setup
[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
1 sibling, 0 replies; 25+ messages in thread
From: Linus Walleij @ 2017-10-11 8:17 UTC (permalink / raw)
To: Phil Reid
Cc: Rob Herring, Mark Rutland, Lars Poeschel, Sebastian Reichel,
linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On Fri, Oct 6, 2017 at 7:08 AM, Phil Reid <preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org> wrote:
> The irq_active_high flag is for controlling the polarity of the output
> from the mcp23s08 series devices. The polarity of the irq could be altered
> by additional logic (eg inverters) between the device and irq input device.
> The device-tree already allows for this as the irq can be specified in the
> binding. So hardcoding it in the driver is overly restrictive.
>
> There are no inkernel users of the mcp23s08 driver with irq's.
>
> Signed-off-by: Phil Reid <preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
Look this up from the irq descriptor as discussed in 4/7.
Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH v2 6/7] pinctrl: mcp23s08: remove hardcoded irq polarity in irq_setup
[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>
1 sibling, 1 reply; 25+ messages in thread
From: Linus Walleij @ 2017-10-12 9:04 UTC (permalink / raw)
To: Phil Reid, Marc Zyngier
Cc: Rob Herring, Mark Rutland, Lars Poeschel, Sebastian Reichel,
linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On Fri, Oct 6, 2017 at 7:08 AM, Phil Reid <preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org> wrote:
> The polarity of the irq could be altered
> by additional logic (eg inverters) between the device and irq input device.
Marc Zyngier has pointed out that inverters should be modeled
using hierarchichal irq domains. You would need to add a new
irqchip to invert the line.
See this PDF:
https://elinux.org/images/8/8c/Zyngier.pdf
drivers/irqchips/irq-uniphier-aidet.c supports inversion of IRQs
for example. For this it uses irq_domain_create_hierarchy()
I guess it would be helpful with a reusable generic "inverter
irq chip", that you can just enable and slam into your device
tree to tell the system that a line is statically inverted, i.e.
non-programmable logic on the board.
Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH v2 7/7] pinctrl: mcp23s08: remove unused variables from pinconf_set
[not found] ` <1507266491-73971-1-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
` (4 preceding siblings ...)
2017-10-06 5:08 ` [PATCH v2 6/7] pinctrl: mcp23s08: remove hardcoded irq polarity in irq_setup Phil Reid
@ 2017-10-06 5:08 ` Phil Reid
2017-10-08 21:12 ` Sebastian Reichel
[not found] ` <1507266491-73971-8-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
5 siblings, 2 replies; 25+ messages in thread
From: Phil Reid @ 2017-10-06 5:08 UTC (permalink / raw)
To: linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
poeschel-Xtl8qvBWbHwb1SvskN2V4Q,
preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO,
sre-DgEjT+Ai2ygdnm+yROfE0A, linux-gpio-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
Variable mask and val are not used in the mcp_pinconf_set().
Signed-off-by: Phil Reid <preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
---
drivers/pinctrl/pinctrl-mcp23s08.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-mcp23s08.c b/drivers/pinctrl/pinctrl-mcp23s08.c
index 8dceaa1..8e461cc 100644
--- a/drivers/pinctrl/pinctrl-mcp23s08.c
+++ b/drivers/pinctrl/pinctrl-mcp23s08.c
@@ -279,8 +279,7 @@ static int mcp_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
{
struct mcp23s08 *mcp = pinctrl_dev_get_drvdata(pctldev);
enum pin_config_param param;
- u32 arg, mask;
- u16 val;
+ u32 arg;
int ret = 0;
int i;
@@ -290,8 +289,6 @@ static int mcp_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
switch (param) {
case PIN_CONFIG_BIAS_PULL_UP:
- val = arg ? 0xFFFF : 0x0000;
- mask = BIT(pin);
ret = mcp_set_bit(mcp, MCP_GPPU, pin, arg);
break;
default:
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [PATCH v2 7/7] pinctrl: mcp23s08: remove unused variables from pinconf_set
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>
1 sibling, 0 replies; 25+ messages in thread
From: Sebastian Reichel @ 2017-10-08 21:12 UTC (permalink / raw)
To: Phil Reid
Cc: linus.walleij, robh+dt, mark.rutland, poeschel, linux-gpio,
devicetree
[-- Attachment #1: Type: text/plain, Size: 1266 bytes --]
Hi,
On Fri, Oct 06, 2017 at 01:08:11PM +0800, Phil Reid wrote:
> Variable mask and val are not used in the mcp_pinconf_set().
>
> Signed-off-by: Phil Reid <preid@electromag.com.au>
Thanks, those are leftovers from before I added mcp_set_bit.
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
-- Sebastian
> ---
> drivers/pinctrl/pinctrl-mcp23s08.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-mcp23s08.c b/drivers/pinctrl/pinctrl-mcp23s08.c
> index 8dceaa1..8e461cc 100644
> --- a/drivers/pinctrl/pinctrl-mcp23s08.c
> +++ b/drivers/pinctrl/pinctrl-mcp23s08.c
> @@ -279,8 +279,7 @@ static int mcp_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
> {
> struct mcp23s08 *mcp = pinctrl_dev_get_drvdata(pctldev);
> enum pin_config_param param;
> - u32 arg, mask;
> - u16 val;
> + u32 arg;
> int ret = 0;
> int i;
>
> @@ -290,8 +289,6 @@ static int mcp_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
>
> switch (param) {
> case PIN_CONFIG_BIAS_PULL_UP:
> - val = arg ? 0xFFFF : 0x0000;
> - mask = BIT(pin);
> ret = mcp_set_bit(mcp, MCP_GPPU, pin, arg);
> break;
> default:
> --
> 1.8.3.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
[parent not found: <1507266491-73971-8-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>]
* Re: [PATCH v2 7/7] pinctrl: mcp23s08: remove unused variables from pinconf_set
[not found] ` <1507266491-73971-8-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
@ 2017-10-11 8:19 ` Linus Walleij
0 siblings, 0 replies; 25+ messages in thread
From: Linus Walleij @ 2017-10-11 8:19 UTC (permalink / raw)
To: Phil Reid
Cc: Rob Herring, Mark Rutland, Lars Poeschel, Sebastian Reichel,
linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On Fri, Oct 6, 2017 at 7:08 AM, Phil Reid <preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org> wrote:
> Variable mask and val are not used in the mcp_pinconf_set().
>
> Signed-off-by: Phil Reid <preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
Patch applied with Sebastian's ACK.
Please rebase the remaining patches on my devel branch
and focus on getting open drain and active high/low things
right.
Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 25+ messages in thread