2013-08-22 09:57:00

by Lars Poeschel

[permalink] [raw]
Subject: [PATCH 1/2] gpio: mcp23s08: rename the device tree property

From: Lars Poeschel <[email protected]>

The device tree property should be more descriptive.
microchip seems more reasonable than mcp. As there are no
in tree users of this property, so the rename can still be
done without pain.

Signed-off-by: Lars Poeschel <[email protected]>
---
.../devicetree/bindings/gpio/gpio-mcp23s08.txt | 16 ++++++++--------
drivers/gpio/gpio-mcp23s08.c | 14 +++++++++-----
2 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt b/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt
index 629d0ef..f207b7c 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt
@@ -3,10 +3,10 @@ Microchip MCP2308/MCP23S08/MCP23017/MCP23S17 driver for

Required properties:
- compatible : Should be
- - "mcp,mcp23s08" for 8 GPIO SPI version
- - "mcp,mcp23s17" for 16 GPIO SPI version
- - "mcp,mcp23008" for 8 GPIO I2C version or
- - "mcp,mcp23017" for 16 GPIO I2C version of the chip
+ - "microchip,mcp23s08" for 8 GPIO SPI version
+ - "microchip,mcp23s17" for 16 GPIO SPI version
+ - "microchip,mcp23008" for 8 GPIO I2C version or
+ - "microchip,mcp23017" for 16 GPIO I2C version of the chip
- #gpio-cells : Should be two.
- first cell is the pin number
- second cell is used to specify flags. Flags are currently unused.
@@ -15,10 +15,10 @@ Required properties:
SPI uses this to specify the chipselect line which the chip is
connected to. The driver and the SPI variant of the chip support
multiple chips on the same chipselect. Have a look at
- mcp,spi-present-mask below.
+ microchip,spi-present-mask below.

Required device specific properties (only for SPI chips):
-- mcp,spi-present-mask : This is a present flag, that makes only sense for SPI
+- microchip,spi-present-mask : This is a present flag, that makes only sense for SPI
chips - as the name suggests. Multiple SPI chips can share the same
SPI chipselect. Set a bit in bit0-7 in this mask to 1 if there is a
chip connected with the corresponding spi address set. For example if
@@ -30,7 +30,7 @@ Required device specific properties (only for SPI chips):

Example I2C:
gpiom1: gpio@20 {
- compatible = "mcp,mcp23017";
+ compatible = "microchip,mcp23017";
gpio-controller;
#gpio-cells = <2>;
reg = <0x20>;
@@ -38,7 +38,7 @@ gpiom1: gpio@20 {

Example SPI:
gpiom1: gpio@0 {
- compatible = "mcp,mcp23s17";
+ compatible = "microchip,mcp23s17";
gpio-controller;
#gpio-cells = <2>;
spi-present-mask = <0x01>;
diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c
index 6a4470b..73cf236 100644
--- a/drivers/gpio/gpio-mcp23s08.c
+++ b/drivers/gpio/gpio-mcp23s08.c
@@ -483,10 +483,12 @@ fail:
#ifdef CONFIG_SPI_MASTER
static struct of_device_id mcp23s08_spi_of_match[] = {
{
- .compatible = "mcp,mcp23s08", .data = (void *) MCP_TYPE_S08,
+ .compatible = "microchip,mcp23s08",
+ .data = (void *) MCP_TYPE_S08,
},
{
- .compatible = "mcp,mcp23s17", .data = (void *) MCP_TYPE_S17,
+ .compatible = "microchip,mcp23s17",
+ .data = (void *) MCP_TYPE_S17,
},
{ },
};
@@ -496,10 +498,12 @@ MODULE_DEVICE_TABLE(of, mcp23s08_spi_of_match);
#if IS_ENABLED(CONFIG_I2C)
static struct of_device_id mcp23s08_i2c_of_match[] = {
{
- .compatible = "mcp,mcp23008", .data = (void *) MCP_TYPE_008,
+ .compatible = "microchip,mcp23008",
+ .data = (void *) MCP_TYPE_008,
},
{
- .compatible = "mcp,mcp23017", .data = (void *) MCP_TYPE_017,
+ .compatible = "microchip,mcp23017",
+ .data = (void *) MCP_TYPE_017,
},
{ },
};
@@ -621,7 +625,7 @@ static int mcp23s08_probe(struct spi_device *spi)
if (match) {
type = (int)match->data;
status = of_property_read_u32(spi->dev.of_node,
- "mcp,spi-present-mask", &spi_present_mask);
+ "microchip,spi-present-mask", &spi_present_mask);
if (status) {
dev_err(&spi->dev, "DT has no spi-present-mask\n");
return -ENODEV;
--
1.7.10.4


2013-08-22 09:57:30

by Lars Poeschel

[permalink] [raw]
Subject: [PATCH 2/2] of: add vendor prefix for Microchip Technology Inc

From: Lars Poeschel <[email protected]>

Trivial patch to add Microchip Technology Inc. to the list
of devicetree vendor prefixes.

Signed-off-by: Lars Poeschel <[email protected]>
---
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 366ce9b..4cdfbe8 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -36,6 +36,7 @@ linux Linux-specific binding
lsi LSI Corp. (LSI Logic)
marvell Marvell Technology Group Ltd.
maxim Maxim Integrated Products
+microchip Microchip Technology Inc.
mosaixtech Mosaix Technologies, Inc.
national National Semiconductor
nintendo Nintendo
--
1.7.10.4

2013-08-23 14:20:26

by Mark Rutland

[permalink] [raw]
Subject: Re: [PATCH 2/2] of: add vendor prefix for Microchip Technology Inc

On Thu, Aug 22, 2013 at 10:56:18AM +0100, Lars Poeschel wrote:
> From: Lars Poeschel <[email protected]>
>
> Trivial patch to add Microchip Technology Inc. to the list
> of devicetree vendor prefixes.
>
> Signed-off-by: Lars Poeschel <[email protected]>

Acked-by: Mark Rutland <[email protected]>

> ---
> Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
> index 366ce9b..4cdfbe8 100644
> --- a/Documentation/devicetree/bindings/vendor-prefixes.txt
> +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
> @@ -36,6 +36,7 @@ linux Linux-specific binding
> lsi LSI Corp. (LSI Logic)
> marvell Marvell Technology Group Ltd.
> maxim Maxim Integrated Products
> +microchip Microchip Technology Inc.
> mosaixtech Mosaix Technologies, Inc.
> national National Semiconductor
> nintendo Nintendo
> --
> 1.7.10.4
>
>

2013-08-23 14:24:29

by Mark Rutland

[permalink] [raw]
Subject: Re: [PATCH 1/2] gpio: mcp23s08: rename the device tree property

On Thu, Aug 22, 2013 at 10:56:17AM +0100, Lars Poeschel wrote:
> From: Lars Poeschel <[email protected]>
>
> The device tree property should be more descriptive.
> microchip seems more reasonable than mcp. As there are no
> in tree users of this property, so the rename can still be
> done without pain.

Are there definitely no users? I see there are no dts with a
"mcp,mcp23***" compatible string, but are there any boards already out
there with this hardware that someone might be using and a currently
release kernel supports?

With the bcm/broadcom => brcm change, we marked the old vendor prefix as
deprecated (but left the support code).

If we can 100% guarantee no-one's using the compatible string, I'm happy
to change it. Otherwise we just have to mark the old string as
deprecated.

Thanks,
Mark.

>
> Signed-off-by: Lars Poeschel <[email protected]>
> ---
> .../devicetree/bindings/gpio/gpio-mcp23s08.txt | 16 ++++++++--------
> drivers/gpio/gpio-mcp23s08.c | 14 +++++++++-----
> 2 files changed, 17 insertions(+), 13 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt b/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt
> index 629d0ef..f207b7c 100644
> --- a/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt
> +++ b/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt
> @@ -3,10 +3,10 @@ Microchip MCP2308/MCP23S08/MCP23017/MCP23S17 driver for
>
> Required properties:
> - compatible : Should be
> - - "mcp,mcp23s08" for 8 GPIO SPI version
> - - "mcp,mcp23s17" for 16 GPIO SPI version
> - - "mcp,mcp23008" for 8 GPIO I2C version or
> - - "mcp,mcp23017" for 16 GPIO I2C version of the chip
> + - "microchip,mcp23s08" for 8 GPIO SPI version
> + - "microchip,mcp23s17" for 16 GPIO SPI version
> + - "microchip,mcp23008" for 8 GPIO I2C version or
> + - "microchip,mcp23017" for 16 GPIO I2C version of the chip
> - #gpio-cells : Should be two.
> - first cell is the pin number
> - second cell is used to specify flags. Flags are currently unused.
> @@ -15,10 +15,10 @@ Required properties:
> SPI uses this to specify the chipselect line which the chip is
> connected to. The driver and the SPI variant of the chip support
> multiple chips on the same chipselect. Have a look at
> - mcp,spi-present-mask below.
> + microchip,spi-present-mask below.
>
> Required device specific properties (only for SPI chips):
> -- mcp,spi-present-mask : This is a present flag, that makes only sense for SPI
> +- microchip,spi-present-mask : This is a present flag, that makes only sense for SPI
> chips - as the name suggests. Multiple SPI chips can share the same
> SPI chipselect. Set a bit in bit0-7 in this mask to 1 if there is a
> chip connected with the corresponding spi address set. For example if
> @@ -30,7 +30,7 @@ Required device specific properties (only for SPI chips):
>
> Example I2C:
> gpiom1: gpio@20 {
> - compatible = "mcp,mcp23017";
> + compatible = "microchip,mcp23017";
> gpio-controller;
> #gpio-cells = <2>;
> reg = <0x20>;
> @@ -38,7 +38,7 @@ gpiom1: gpio@20 {
>
> Example SPI:
> gpiom1: gpio@0 {
> - compatible = "mcp,mcp23s17";
> + compatible = "microchip,mcp23s17";
> gpio-controller;
> #gpio-cells = <2>;
> spi-present-mask = <0x01>;
> diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c
> index 6a4470b..73cf236 100644
> --- a/drivers/gpio/gpio-mcp23s08.c
> +++ b/drivers/gpio/gpio-mcp23s08.c
> @@ -483,10 +483,12 @@ fail:
> #ifdef CONFIG_SPI_MASTER
> static struct of_device_id mcp23s08_spi_of_match[] = {
> {
> - .compatible = "mcp,mcp23s08", .data = (void *) MCP_TYPE_S08,
> + .compatible = "microchip,mcp23s08",
> + .data = (void *) MCP_TYPE_S08,
> },
> {
> - .compatible = "mcp,mcp23s17", .data = (void *) MCP_TYPE_S17,
> + .compatible = "microchip,mcp23s17",
> + .data = (void *) MCP_TYPE_S17,
> },
> { },
> };
> @@ -496,10 +498,12 @@ MODULE_DEVICE_TABLE(of, mcp23s08_spi_of_match);
> #if IS_ENABLED(CONFIG_I2C)
> static struct of_device_id mcp23s08_i2c_of_match[] = {
> {
> - .compatible = "mcp,mcp23008", .data = (void *) MCP_TYPE_008,
> + .compatible = "microchip,mcp23008",
> + .data = (void *) MCP_TYPE_008,
> },
> {
> - .compatible = "mcp,mcp23017", .data = (void *) MCP_TYPE_017,
> + .compatible = "microchip,mcp23017",
> + .data = (void *) MCP_TYPE_017,
> },
> { },
> };
> @@ -621,7 +625,7 @@ static int mcp23s08_probe(struct spi_device *spi)
> if (match) {
> type = (int)match->data;
> status = of_property_read_u32(spi->dev.of_node,
> - "mcp,spi-present-mask", &spi_present_mask);
> + "microchip,spi-present-mask", &spi_present_mask);
> if (status) {
> dev_err(&spi->dev, "DT has no spi-present-mask\n");
> return -ENODEV;
> --
> 1.7.10.4
>
>

2013-08-23 15:22:22

by Lars Poeschel

[permalink] [raw]
Subject: Re: [PATCH 1/2] gpio: mcp23s08: rename the device tree property

On Friday 23 August 2013 at 16:24:21, Mark Rutland wrote:
> On Thu, Aug 22, 2013 at 10:56:17AM +0100, Lars Poeschel wrote:
> > From: Lars Poeschel <[email protected]>
> >
> > The device tree property should be more descriptive.
> > microchip seems more reasonable than mcp. As there are no
> > in tree users of this property, so the rename can still be
> > done without pain.
>
> Are there definitely no users? I see there are no dts with a
> "mcp,mcp23***" compatible string, but are there any boards already out
> there with this hardware that someone might be using and a currently
> release kernel supports?

What do you mean by "release"? The device tree support for the gpio-
mcp23s08 driver and thus the "mcp" string came in with v3.9. This is stable
but not longterm.

> With the bcm/broadcom => brcm change, we marked the old vendor prefix as
> deprecated (but left the support code).
>
> If we can 100% guarantee no-one's using the compatible string, I'm happy
> to change it. Otherwise we just have to mark the old string as
> deprecated.

I am the developer of the device tree support for that driver and I am not
aware of any user, but surely I can not guarantee it.

I never imagined how hard it would be. ;-)
I presented both variants:
1.) simply add mcp to vendor-prefixes.txt
2.) change the driver to microchip and add microchip to vendor-prefixes.txt

May one of the maintainers decide which one to take or even take none of
the patches.
Or do you need a third variant with both strings in the driver and
microchip in vendor-prefixes?

Lars

2013-08-23 16:48:51

by Mark Rutland

[permalink] [raw]
Subject: Re: [PATCH 1/2] gpio: mcp23s08: rename the device tree property

On Fri, Aug 23, 2013 at 04:22:10PM +0100, Lars Poeschel wrote:
> On Friday 23 August 2013 at 16:24:21, Mark Rutland wrote:
> > On Thu, Aug 22, 2013 at 10:56:17AM +0100, Lars Poeschel wrote:
> > > From: Lars Poeschel <[email protected]>
> > >
> > > The device tree property should be more descriptive.
> > > microchip seems more reasonable than mcp. As there are no
> > > in tree users of this property, so the rename can still be
> > > done without pain.
> >
> > Are there definitely no users? I see there are no dts with a
> > "mcp,mcp23***" compatible string, but are there any boards already out
> > there with this hardware that someone might be using and a currently
> > release kernel supports?
>
> What do you mean by "release"? The device tree support for the gpio-
> mcp23s08 driver and thus the "mcp" string came in with v3.9. This is stable
> but not longterm.

I meant a vX.Y non -rc kernel. v3.9 definitely counts.

>
> > With the bcm/broadcom => brcm change, we marked the old vendor prefix as
> > deprecated (but left the support code).
> >
> > If we can 100% guarantee no-one's using the compatible string, I'm happy
> > to change it. Otherwise we just have to mark the old string as
> > deprecated.
>
> I am the developer of the device tree support for that driver and I am not
> aware of any user, but surely I can not guarantee it.
>
> I never imagined how hard it would be. ;-)
> I presented both variants:
> 1.) simply add mcp to vendor-prefixes.txt
> 2.) change the driver to microchip and add microchip to vendor-prefixes.txt

I think "microchip" is definitely preferable to "mcp", and would prefer
that going forward.

>
> May one of the maintainers decide which one to take or even take none of
> the patches.
> Or do you need a third variant with both strings in the driver and
> microchip in vendor-prefixes?

If there are users, maintaining support for the old, deprecated string
in the driver (alongside the new one) is preferable, and simple to do.
That's how we've handled the other name changes in bindings. We should
probably do that here, documenting the "mcp,mcp23***" strings as
deprecated in the binding document.

Later, we may choose to drop unused deprecated bindings.

Thanks,
Mark.

2013-08-23 19:10:05

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 1/2] gpio: mcp23s08: rename the device tree property

On Thu, Aug 22, 2013 at 11:56 AM, Lars Poeschel <[email protected]> wrote:

> From: Lars Poeschel <[email protected]>
>
> The device tree property should be more descriptive.
> microchip seems more reasonable than mcp. As there are no
> in tree users of this property, so the rename can still be
> done without pain.
>
> Signed-off-by: Lars Poeschel <[email protected]>

So do I apply this to the GPIO tree now or what?

Are the DT custodians happy?

Yours,
Linus Walleij

2013-08-25 10:06:51

by Lars Poeschel

[permalink] [raw]
Subject: Re: [PATCH 1/2] gpio: mcp23s08: rename the device tree property

Am Freitag 23 August 2013, 21:10:00 schrieb Linus Walleij:
> On Thu, Aug 22, 2013 at 11:56 AM, Lars Poeschel <[email protected]>
wrote:
> > From: Lars Poeschel <[email protected]>
> >
> > The device tree property should be more descriptive.
> > microchip seems more reasonable than mcp. As there are no
> > in tree users of this property, so the rename can still be
> > done without pain.
> >
> > Signed-off-by: Lars Poeschel <[email protected]>
>
> So do I apply this to the GPIO tree now or what?
>
> Are the DT custodians happy?

No Linus, do not take this.
There will be a new version.

Thanks,
Lars