All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] gpio: mcp32s08: add support for mcp23018
@ 2017-10-05  1:23 Phil Reid
       [not found] ` <1507166615-4530-1-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Phil Reid @ 2017-10-05  1:23 UTC (permalink / raw)
  To: linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
	preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO,
	linux-gpio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

This adds the required definitions for the mcp23018 which is the i2c
variant of the mcp23s18.


Phil Reid (2):
  gpio: dt-bindings: add mcp23018 to mcp23s08 documentation
  gpio: mcp32s08: add support for mcp23018

 Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt |  1 +
 drivers/gpio/gpio-mcp23s08.c                             | 15 ++++++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

-- 
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	[flat|nested] 6+ messages in thread

* [PATCH 1/2] gpio: dt-bindings: add mcp23018 to mcp23s08 documentation
       [not found] ` <1507166615-4530-1-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
@ 2017-10-05  1:23   ` Phil Reid
  2017-10-07 23:41     ` Linus Walleij
  2017-10-05  1:23   ` [PATCH 2/2] gpio: mcp32s08: add support for mcp23018 Phil Reid
  1 sibling, 1 reply; 6+ messages in thread
From: Phil Reid @ 2017-10-05  1:23 UTC (permalink / raw)
  To: linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
	preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO,
	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>
---
 Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt b/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt
index c934106..c0f495e 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio-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 SPI 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] 6+ messages in thread

* [PATCH 2/2] gpio: mcp32s08: add support for mcp23018
       [not found] ` <1507166615-4530-1-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
  2017-10-05  1:23   ` [PATCH 1/2] gpio: dt-bindings: add mcp23018 to mcp23s08 documentation Phil Reid
@ 2017-10-05  1:23   ` Phil Reid
  2017-10-05  6:56     ` Phil Reid
  1 sibling, 1 reply; 6+ messages in thread
From: Phil Reid @ 2017-10-05  1:23 UTC (permalink / raw)
  To: linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
	preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO,
	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/gpio/gpio-mcp23s08.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c
index 2a57d024..92751e5 100644
--- a/drivers/gpio/gpio-mcp23s08.c
+++ b/drivers/gpio/gpio-mcp23s08.c
@@ -33,6 +33,7 @@
 #define MCP_TYPE_008	2
 #define MCP_TYPE_017	3
 #define MCP_TYPE_S18    4
+#define MCP_TYPE_018    5
 
 /* Registers are all 8 bits wide.
  *
@@ -595,6 +596,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:
@@ -640,7 +648,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);
@@ -729,6 +737,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",
@@ -812,6 +824,7 @@ static int mcp230xx_remove(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] 6+ messages in thread

* Re: [PATCH 2/2] gpio: mcp32s08: add support for mcp23018
  2017-10-05  1:23   ` [PATCH 2/2] gpio: mcp32s08: add support for mcp23018 Phil Reid
@ 2017-10-05  6:56     ` Phil Reid
  0 siblings, 0 replies; 6+ messages in thread
From: Phil Reid @ 2017-10-05  6:56 UTC (permalink / raw)
  To: linus.walleij, robh+dt, mark.rutland, linux-gpio, devicetree

On 5/10/2017 09:23, Phil Reid wrote:
> This adds the required definitions for the mcp23018 which is the i2c
> variant of the mcp23s18.
> 
> Signed-off-by: Phil Reid <preid@electromag.com.au>
> ---
>   drivers/gpio/gpio-mcp23s08.c | 15 ++++++++++++++-
>   1 file changed, 14 insertions(+), 1 deletion(-)

I've just noticed that this needs to be rebased as mcp23s08 driver has moved.
Other that the new location the patch is the same so far.
I have a couple of queries regarding the driver in another email, will wait for that first..



> 
> diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c
> index 2a57d024..92751e5 100644
> --- a/drivers/gpio/gpio-mcp23s08.c
> +++ b/drivers/gpio/gpio-mcp23s08.c
> @@ -33,6 +33,7 @@
>   #define MCP_TYPE_008	2
>   #define MCP_TYPE_017	3
>   #define MCP_TYPE_S18    4
> +#define MCP_TYPE_018    5
>   
>   /* Registers are all 8 bits wide.
>    *
> @@ -595,6 +596,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:
> @@ -640,7 +648,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);
> @@ -729,6 +737,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",
> @@ -812,6 +824,7 @@ static int mcp230xx_remove(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);
> 


-- 
Regards
Phil Reid

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] gpio: dt-bindings: add mcp23018 to mcp23s08 documentation
  2017-10-05  1:23   ` [PATCH 1/2] gpio: dt-bindings: add mcp23018 to mcp23s08 documentation Phil Reid
@ 2017-10-07 23:41     ` Linus Walleij
  2017-10-08 10:20       ` Phil Reid
  0 siblings, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2017-10-07 23:41 UTC (permalink / raw)
  To: Phil Reid; +Cc: Rob Herring, Mark Rutland, linux-gpio, devicetree

On Thu, Oct 5, 2017 at 3:23 AM, Phil Reid <preid@electromag.com.au> wrote:

> This adds the required definitions for the mcp23018 which is the i2c
> variant of the mcp23s18.

Which is logical if "s" stands for "SPI", "0" is normal or I2C.

>      - "microchip,mcp23s18" for 16 GPIO SPI version

So that is the 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 SPI version

And right here you say that this is also the SPI version, but the
commit message says it is the I2C version.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] gpio: dt-bindings: add mcp23018 to mcp23s08 documentation
  2017-10-07 23:41     ` Linus Walleij
@ 2017-10-08 10:20       ` Phil Reid
  0 siblings, 0 replies; 6+ messages in thread
From: Phil Reid @ 2017-10-08 10:20 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Rob Herring, Mark Rutland, linux-gpio, devicetree

On 8/10/2017 07:41, Linus Walleij wrote:
> On Thu, Oct 5, 2017 at 3:23 AM, Phil Reid <preid@electromag.com.au> wrote:
> 
>> This adds the required definitions for the mcp23018 which is the i2c
>> variant of the mcp23s18.
> 
> Which is logical if "s" stands for "SPI", "0" is normal or I2C.
> 
>>       - "microchip,mcp23s18" for 16 GPIO SPI version
> 
> So that is the 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 SPI version
> 
> And right here you say that this is also the SPI version, but the
> commit message says it is the I2C version.
> 
G'day Linus,

thanks for looking at this.
Sorry, there's a v2 fixing that.

Along with proposed patches for fixing the items raised in my RFI.

Except for modelling the inverter. Not even sure how to approach that one.


-- 
Regards
Phil Reid

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-10-08 10:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-05  1:23 [PATCH 0/2] gpio: mcp32s08: add support for mcp23018 Phil Reid
     [not found] ` <1507166615-4530-1-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
2017-10-05  1:23   ` [PATCH 1/2] gpio: dt-bindings: add mcp23018 to mcp23s08 documentation Phil Reid
2017-10-07 23:41     ` Linus Walleij
2017-10-08 10:20       ` Phil Reid
2017-10-05  1:23   ` [PATCH 2/2] gpio: mcp32s08: add support for mcp23018 Phil Reid
2017-10-05  6:56     ` Phil Reid

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.