linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] mfd: mc13xxx: Honor designed SPI mode
@ 2014-03-02  7:44 Alexander Shiyan
  2014-03-02  7:44 ` [PATCH 2/4] mfd: mc13xxx: Limit maximum SPI speed Alexander Shiyan
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Alexander Shiyan @ 2014-03-02  7:44 UTC (permalink / raw)
  To: linux-arm-kernel

Instead of using hard coded SPI mode, use mode described in
devicetree or defined for the board.
Additionally, patch updates all users of this PMIC to use
correct SPI mode.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 arch/arm/mach-imx/mach-mx31lilly.c | 1 +
 arch/arm/mach-imx/mach-mx31lite.c  | 1 +
 drivers/mfd/mc13xxx-spi.c          | 2 --
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/mach-mx31lilly.c b/arch/arm/mach-imx/mach-mx31lilly.c
index 832b1e2..16c688e 100644
--- a/arch/arm/mach-imx/mach-mx31lilly.c
+++ b/arch/arm/mach-imx/mach-mx31lilly.c
@@ -231,6 +231,7 @@ static struct spi_board_info mc13783_dev __initdata = {
 	.bus_num	= 1,
 	.chip_select	= 0,
 	.platform_data	= &mc13783_pdata,
+	.mode		= SPI_MODE_0 | SPI_CS_HIGH,
 	/* irq number is run-time assigned */
 };
 
diff --git a/arch/arm/mach-imx/mach-mx31lite.c b/arch/arm/mach-imx/mach-mx31lite.c
index bea0729..bf3e61e 100644
--- a/arch/arm/mach-imx/mach-mx31lite.c
+++ b/arch/arm/mach-imx/mach-mx31lite.c
@@ -121,6 +121,7 @@ static struct spi_board_info mc13783_spi_dev __initdata = {
 	.bus_num	= 1,
 	.chip_select    = 0,
 	.platform_data  = &mc13783_pdata,
+	.mode		= SPI_MODE_0 | SPI_CS_HIGH,
 	/* irq number is run-time assigned */
 };
 
diff --git a/drivers/mfd/mc13xxx-spi.c b/drivers/mfd/mc13xxx-spi.c
index 38ab678..f88087f 100644
--- a/drivers/mfd/mc13xxx-spi.c
+++ b/drivers/mfd/mc13xxx-spi.c
@@ -136,8 +136,6 @@ static int mc13xxx_spi_probe(struct spi_device *spi)
 
 	dev_set_drvdata(&spi->dev, mc13xxx);
 
-	spi->mode = SPI_MODE_0 | SPI_CS_HIGH;
-
 	mc13xxx->irq = spi->irq;
 
 	mc13xxx->regmap = devm_regmap_init(&spi->dev, &regmap_mc13xxx_bus,
-- 
1.8.3.2

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

* [PATCH 2/4] mfd: mc13xxx: Limit maximum SPI speed
  2014-03-02  7:44 [PATCH 1/4] mfd: mc13xxx: Honor designed SPI mode Alexander Shiyan
@ 2014-03-02  7:44 ` Alexander Shiyan
  2014-03-03  7:36   ` Lee Jones
  2014-03-02  7:44 ` [PATCH 3/4] mfd: mc13xxx: Add missing spi_setup() Alexander Shiyan
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Alexander Shiyan @ 2014-03-02  7:44 UTC (permalink / raw)
  To: linux-arm-kernel

The patch adds the maximum speed limit in accordance with the
PMIC datasheet if other value is not given in the devicetree
description or board data.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/mfd/mc13xxx-spi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mfd/mc13xxx-spi.c b/drivers/mfd/mc13xxx-spi.c
index f88087f..cd27c32 100644
--- a/drivers/mfd/mc13xxx-spi.c
+++ b/drivers/mfd/mc13xxx-spi.c
@@ -138,6 +138,8 @@ static int mc13xxx_spi_probe(struct spi_device *spi)
 
 	mc13xxx->irq = spi->irq;
 
+	spi->max_speed_hz = spi->max_speed_hz ? : 26000000;
+
 	mc13xxx->regmap = devm_regmap_init(&spi->dev, &regmap_mc13xxx_bus,
 					   &spi->dev,
 					   &mc13xxx_regmap_spi_config);
-- 
1.8.3.2

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

* [PATCH 3/4] mfd: mc13xxx: Add missing spi_setup()
  2014-03-02  7:44 [PATCH 1/4] mfd: mc13xxx: Honor designed SPI mode Alexander Shiyan
  2014-03-02  7:44 ` [PATCH 2/4] mfd: mc13xxx: Limit maximum SPI speed Alexander Shiyan
@ 2014-03-02  7:44 ` Alexander Shiyan
  2014-03-03  7:37   ` Lee Jones
  2014-03-02  7:44 ` [PATCH 4/4] regulator: mc13xxx: Fix probing with DT Alexander Shiyan
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Alexander Shiyan @ 2014-03-02  7:44 UTC (permalink / raw)
  To: linux-arm-kernel

The probe routine should call spi_setup() to configure the SPI bus
so it can properly communicate with the device.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/mfd/mc13xxx-spi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mfd/mc13xxx-spi.c b/drivers/mfd/mc13xxx-spi.c
index cd27c32..f35624a 100644
--- a/drivers/mfd/mc13xxx-spi.c
+++ b/drivers/mfd/mc13xxx-spi.c
@@ -139,6 +139,9 @@ static int mc13xxx_spi_probe(struct spi_device *spi)
 	mc13xxx->irq = spi->irq;
 
 	spi->max_speed_hz = spi->max_speed_hz ? : 26000000;
+	ret = spi_setup(spi);
+	if (ret)
+		return ret;
 
 	mc13xxx->regmap = devm_regmap_init(&spi->dev, &regmap_mc13xxx_bus,
 					   &spi->dev,
-- 
1.8.3.2

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

* [PATCH 4/4] regulator: mc13xxx: Fix probing with DT
  2014-03-02  7:44 [PATCH 1/4] mfd: mc13xxx: Honor designed SPI mode Alexander Shiyan
  2014-03-02  7:44 ` [PATCH 2/4] mfd: mc13xxx: Limit maximum SPI speed Alexander Shiyan
  2014-03-02  7:44 ` [PATCH 3/4] mfd: mc13xxx: Add missing spi_setup() Alexander Shiyan
@ 2014-03-02  7:44 ` Alexander Shiyan
  2014-03-03  1:58   ` Mark Brown
  2014-03-03  7:35 ` [PATCH 1/4] mfd: mc13xxx: Honor designed SPI mode Lee Jones
  2014-03-03  9:41 ` Sascha Hauer
  4 siblings, 1 reply; 15+ messages in thread
From: Alexander Shiyan @ 2014-03-02  7:44 UTC (permalink / raw)
  To: linux-arm-kernel

The nodes of regulators should be retrieved from parent device.
Bug was be introduced by commit (regulator: mc13xxx: Fix NULL
pointer error in non-DT mode) in conjuction with (mfd: Revert
"mfd: Always assign of_node in mfd_add_device()").

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/regulator/mc13xxx-regulator-core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/regulator/mc13xxx-regulator-core.c b/drivers/regulator/mc13xxx-regulator-core.c
index bf75fca..05b9717 100644
--- a/drivers/regulator/mc13xxx-regulator-core.c
+++ b/drivers/regulator/mc13xxx-regulator-core.c
@@ -167,10 +167,10 @@ int mc13xxx_get_num_regulators_dt(struct platform_device *pdev)
 	struct device_node *parent;
 	int num;
 
-	if (!pdev->dev.of_node)
+	if (!pdev->dev.parent->of_node)
 		return -ENODEV;
 
-	parent = of_get_child_by_name(pdev->dev.of_node, "regulators");
+	parent = of_get_child_by_name(pdev->dev.parent->of_node, "regulators");
 	if (!parent)
 		return -ENODEV;
 
@@ -189,10 +189,10 @@ struct mc13xxx_regulator_init_data *mc13xxx_parse_regulators_dt(
 	struct device_node *parent, *child;
 	int i, parsed = 0;
 
-	if (!pdev->dev.of_node)
+	if (!pdev->dev.parent->of_node)
 		return NULL;
 
-	parent = of_get_child_by_name(pdev->dev.of_node, "regulators");
+	parent = of_get_child_by_name(pdev->dev.parent->of_node, "regulators");
 	if (!parent)
 		return NULL;
 
-- 
1.8.3.2

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

* [PATCH 4/4] regulator: mc13xxx: Fix probing with DT
  2014-03-02  7:44 ` [PATCH 4/4] regulator: mc13xxx: Fix probing with DT Alexander Shiyan
@ 2014-03-03  1:58   ` Mark Brown
  0 siblings, 0 replies; 15+ messages in thread
From: Mark Brown @ 2014-03-03  1:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Mar 02, 2014 at 11:44:35AM +0400, Alexander Shiyan wrote:
> The nodes of regulators should be retrieved from parent device.
> Bug was be introduced by commit (regulator: mc13xxx: Fix NULL
> pointer error in non-DT mode) in conjuction with (mfd: Revert
> "mfd: Always assign of_node in mfd_add_device()").

Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140303/1da1bfe4/attachment-0001.sig>

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

* [PATCH 1/4] mfd: mc13xxx: Honor designed SPI mode
  2014-03-02  7:44 [PATCH 1/4] mfd: mc13xxx: Honor designed SPI mode Alexander Shiyan
                   ` (2 preceding siblings ...)
  2014-03-02  7:44 ` [PATCH 4/4] regulator: mc13xxx: Fix probing with DT Alexander Shiyan
@ 2014-03-03  7:35 ` Lee Jones
  2014-03-03  7:55   ` Alexander Shiyan
  2014-03-03  9:41 ` Sascha Hauer
  4 siblings, 1 reply; 15+ messages in thread
From: Lee Jones @ 2014-03-03  7:35 UTC (permalink / raw)
  To: linux-arm-kernel

> Instead of using hard coded SPI mode, use mode described in
> devicetree or defined for the board.
> Additionally, patch updates all users of this PMIC to use
> correct SPI mode.
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
>  arch/arm/mach-imx/mach-mx31lilly.c | 1 +
>  arch/arm/mach-imx/mach-mx31lite.c  | 1 +
>  drivers/mfd/mc13xxx-spi.c          | 2 --

There's no reason for these changes to be in the same patch.

Please split them up by subsystem and resubmit.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* [PATCH 2/4] mfd: mc13xxx: Limit maximum SPI speed
  2014-03-02  7:44 ` [PATCH 2/4] mfd: mc13xxx: Limit maximum SPI speed Alexander Shiyan
@ 2014-03-03  7:36   ` Lee Jones
  0 siblings, 0 replies; 15+ messages in thread
From: Lee Jones @ 2014-03-03  7:36 UTC (permalink / raw)
  To: linux-arm-kernel

> The patch adds the maximum speed limit in accordance with the
> PMIC datasheet if other value is not given in the devicetree
> description or board data.
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
>  drivers/mfd/mc13xxx-spi.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/mfd/mc13xxx-spi.c b/drivers/mfd/mc13xxx-spi.c
> index f88087f..cd27c32 100644
> --- a/drivers/mfd/mc13xxx-spi.c
> +++ b/drivers/mfd/mc13xxx-spi.c
> @@ -138,6 +138,8 @@ static int mc13xxx_spi_probe(struct spi_device *spi)
>  
>  	mc13xxx->irq = spi->irq;
>  
> +	spi->max_speed_hz = spi->max_speed_hz ? : 26000000;
> +
>  	mc13xxx->regmap = devm_regmap_init(&spi->dev, &regmap_mc13xxx_bus,
>  					   &spi->dev,
>  					   &mc13xxx_regmap_spi_config);

Applied, thanks.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* [PATCH 3/4] mfd: mc13xxx: Add missing spi_setup()
  2014-03-02  7:44 ` [PATCH 3/4] mfd: mc13xxx: Add missing spi_setup() Alexander Shiyan
@ 2014-03-03  7:37   ` Lee Jones
  0 siblings, 0 replies; 15+ messages in thread
From: Lee Jones @ 2014-03-03  7:37 UTC (permalink / raw)
  To: linux-arm-kernel

> The probe routine should call spi_setup() to configure the SPI bus
> so it can properly communicate with the device.
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
>  drivers/mfd/mc13xxx-spi.c | 3 +++
>  1 file changed, 3 insertions(+)

Applied, thanks.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 1/4] mfd: mc13xxx: Honor designed SPI mode
  2014-03-03  7:35 ` [PATCH 1/4] mfd: mc13xxx: Honor designed SPI mode Lee Jones
@ 2014-03-03  7:55   ` Alexander Shiyan
  2014-03-03  9:23     ` Lee Jones
  0 siblings, 1 reply; 15+ messages in thread
From: Alexander Shiyan @ 2014-03-03  7:55 UTC (permalink / raw)
  To: linux-arm-kernel

???????????,  3 ????? 2014, 15:35 +08:00 ?? Lee Jones <lee.jones@linaro.org>:
> > Instead of using hard coded SPI mode, use mode described in
> > devicetree or defined for the board.
> > Additionally, patch updates all users of this PMIC to use
> > correct SPI mode.
> > 
> > Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> > ---
> >  arch/arm/mach-imx/mach-mx31lilly.c | 1 +
> >  arch/arm/mach-imx/mach-mx31lite.c  | 1 +
> >  drivers/mfd/mc13xxx-spi.c          | 2 --
> 
> There's no reason for these changes to be in the same patch.
> 
> Please split them up by subsystem and resubmit.

This should be in one patch, since it cause to break functionality of these
boards due missing SPI_CS_HIGH property in the spi_board_info.

---

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

* [PATCH 1/4] mfd: mc13xxx: Honor designed SPI mode
  2014-03-03  7:55   ` Alexander Shiyan
@ 2014-03-03  9:23     ` Lee Jones
  0 siblings, 0 replies; 15+ messages in thread
From: Lee Jones @ 2014-03-03  9:23 UTC (permalink / raw)
  To: linux-arm-kernel

> ???????????,  3 ????? 2014, 15:35 +08:00 ?? Lee Jones <lee.jones@linaro.org>:
> > > Instead of using hard coded SPI mode, use mode described in
> > > devicetree or defined for the board.
> > > Additionally, patch updates all users of this PMIC to use
> > > correct SPI mode.
> > > 
> > > Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> > > ---
> > >  arch/arm/mach-imx/mach-mx31lilly.c | 1 +
> > >  arch/arm/mach-imx/mach-mx31lite.c  | 1 +
> > >  drivers/mfd/mc13xxx-spi.c          | 2 --
> > 
> > There's no reason for these changes to be in the same patch.
> > 
> > Please split them up by subsystem and resubmit.
> 
> This should be in one patch, since it cause to break functionality of these
> boards due missing SPI_CS_HIGH property in the spi_board_info.

Okay, I'll take your word for it.

For the MFD part:
  Acked-by: Lee Jones <lee.jones@linaro.org>

I'm happy to take this through the MFD tree and can provide an
immutable branch for the other Maintainers if requested.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* [PATCH 1/4] mfd: mc13xxx: Honor designed SPI mode
  2014-03-02  7:44 [PATCH 1/4] mfd: mc13xxx: Honor designed SPI mode Alexander Shiyan
                   ` (3 preceding siblings ...)
  2014-03-03  7:35 ` [PATCH 1/4] mfd: mc13xxx: Honor designed SPI mode Lee Jones
@ 2014-03-03  9:41 ` Sascha Hauer
  2014-03-03  9:51   ` Alexander Shiyan
  4 siblings, 1 reply; 15+ messages in thread
From: Sascha Hauer @ 2014-03-03  9:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Mar 02, 2014 at 11:44:32AM +0400, Alexander Shiyan wrote:
> Instead of using hard coded SPI mode, use mode described in
> devicetree or defined for the board.
> Additionally, patch updates all users of this PMIC to use
> correct SPI mode.

What's the reason for this change? Without it the driver just does the
correct thing, this only adds a chance for boards do get it wrong. This
for example happens with the i.MX27 phyCORE in this patch, see
happens with arch/arm/boot/dts/imx27-phytec-phycore-som.dts whih doesn't
have the spi-cs-high property.

Sascha

> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
>  arch/arm/mach-imx/mach-mx31lilly.c | 1 +
>  arch/arm/mach-imx/mach-mx31lite.c  | 1 +
>  drivers/mfd/mc13xxx-spi.c          | 2 --
>  3 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-imx/mach-mx31lilly.c b/arch/arm/mach-imx/mach-mx31lilly.c
> index 832b1e2..16c688e 100644
> --- a/arch/arm/mach-imx/mach-mx31lilly.c
> +++ b/arch/arm/mach-imx/mach-mx31lilly.c
> @@ -231,6 +231,7 @@ static struct spi_board_info mc13783_dev __initdata = {
>  	.bus_num	= 1,
>  	.chip_select	= 0,
>  	.platform_data	= &mc13783_pdata,
> +	.mode		= SPI_MODE_0 | SPI_CS_HIGH,
>  	/* irq number is run-time assigned */
>  };
>  
> diff --git a/arch/arm/mach-imx/mach-mx31lite.c b/arch/arm/mach-imx/mach-mx31lite.c
> index bea0729..bf3e61e 100644
> --- a/arch/arm/mach-imx/mach-mx31lite.c
> +++ b/arch/arm/mach-imx/mach-mx31lite.c
> @@ -121,6 +121,7 @@ static struct spi_board_info mc13783_spi_dev __initdata = {
>  	.bus_num	= 1,
>  	.chip_select    = 0,
>  	.platform_data  = &mc13783_pdata,
> +	.mode		= SPI_MODE_0 | SPI_CS_HIGH,
>  	/* irq number is run-time assigned */
>  };
>  
> diff --git a/drivers/mfd/mc13xxx-spi.c b/drivers/mfd/mc13xxx-spi.c
> index 38ab678..f88087f 100644
> --- a/drivers/mfd/mc13xxx-spi.c
> +++ b/drivers/mfd/mc13xxx-spi.c
> @@ -136,8 +136,6 @@ static int mc13xxx_spi_probe(struct spi_device *spi)
>  
>  	dev_set_drvdata(&spi->dev, mc13xxx);
>  
> -	spi->mode = SPI_MODE_0 | SPI_CS_HIGH;
> -
>  	mc13xxx->irq = spi->irq;
>  
>  	mc13xxx->regmap = devm_regmap_init(&spi->dev, &regmap_mc13xxx_bus,
> -- 
> 1.8.3.2
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH 1/4] mfd: mc13xxx: Honor designed SPI mode
  2014-03-03  9:41 ` Sascha Hauer
@ 2014-03-03  9:51   ` Alexander Shiyan
  2014-03-04 20:13     ` Sascha Hauer
  0 siblings, 1 reply; 15+ messages in thread
From: Alexander Shiyan @ 2014-03-03  9:51 UTC (permalink / raw)
  To: linux-arm-kernel

???????????,  3 ????? 2014, 10:41 +01:00 ?? Sascha Hauer <s.hauer@pengutronix.de>:
> On Sun, Mar 02, 2014 at 11:44:32AM +0400, Alexander Shiyan wrote:
> > Instead of using hard coded SPI mode, use mode described in
> > devicetree or defined for the board.
> > Additionally, patch updates all users of this PMIC to use
> > correct SPI mode.
> 
> What's the reason for this change? Without it the driver just does the
> correct thing, this only adds a chance for boards do get it wrong. This
> for example happens with the i.MX27 phyCORE in this patch, see
> happens with arch/arm/boot/dts/imx27-phytec-phycore-som.dts whih doesn't
> have the spi-cs-high property.

How specify proper functionality if chipselect connected through inverter?

For i.MX27 phyCORE:
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/arch/arm/boot/dts/imx27-phytec-phycore-som.dtsi?id=986cc4920412d8a7b5c9dba85601651f6373f45e

---

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

* [PATCH 1/4] mfd: mc13xxx: Honor designed SPI mode
  2014-03-03  9:51   ` Alexander Shiyan
@ 2014-03-04 20:13     ` Sascha Hauer
  2014-03-04 20:51       ` Alexander Shiyan
  0 siblings, 1 reply; 15+ messages in thread
From: Sascha Hauer @ 2014-03-04 20:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 03, 2014 at 01:51:05PM +0400, Alexander Shiyan wrote:
> ???????????,  3 ????? 2014, 10:41 +01:00 ?? Sascha Hauer <s.hauer@pengutronix.de>:
> > On Sun, Mar 02, 2014 at 11:44:32AM +0400, Alexander Shiyan wrote:
> > > Instead of using hard coded SPI mode, use mode described in
> > > devicetree or defined for the board.
> > > Additionally, patch updates all users of this PMIC to use
> > > correct SPI mode.
> > 
> > What's the reason for this change? Without it the driver just does the
> > correct thing, this only adds a chance for boards do get it wrong. This
> > for example happens with the i.MX27 phyCORE in this patch, see
> > happens with arch/arm/boot/dts/imx27-phytec-phycore-som.dts whih doesn't
> > have the spi-cs-high property.
> 
> How specify proper functionality if chipselect connected through inverter?

Is there such a hardware around?

> 
> For i.MX27 phyCORE:
> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/arch/arm/boot/dts/imx27-phytec-phycore-som.dtsi?id=986cc4920412d8a7b5c9dba85601651f6373f45e

Ok, I missed that one.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH 1/4] mfd: mc13xxx: Honor designed SPI mode
  2014-03-04 20:13     ` Sascha Hauer
@ 2014-03-04 20:51       ` Alexander Shiyan
  2014-03-05 11:57         ` Sascha Hauer
  0 siblings, 1 reply; 15+ messages in thread
From: Alexander Shiyan @ 2014-03-04 20:51 UTC (permalink / raw)
  To: linux-arm-kernel

???????,  4 ????? 2014, 21:13 +01:00 ?? Sascha Hauer <s.hauer@pengutronix.de>:
> On Mon, Mar 03, 2014 at 01:51:05PM +0400, Alexander Shiyan wrote:
> > ???????????,  3 ????? 2014, 10:41 +01:00 ?? Sascha Hauer <s.hauer@pengutronix.de>:
> > > On Sun, Mar 02, 2014 at 11:44:32AM +0400, Alexander Shiyan wrote:
> > > > Instead of using hard coded SPI mode, use mode described in
> > > > devicetree or defined for the board.
> > > > Additionally, patch updates all users of this PMIC to use
> > > > correct SPI mode.
> > > 
> > > What's the reason for this change? Without it the driver just does the
> > > correct thing, this only adds a chance for boards do get it wrong. This
> > > for example happens with the i.MX27 phyCORE in this patch, see
> > > happens with arch/arm/boot/dts/imx27-phytec-phycore-som.dts whih doesn't
> > > have the spi-cs-high property.
> > 
> > How specify proper functionality if chipselect connected through inverter?
> 
> Is there such a hardware around?

AFAIK no, but it is a protection for the future. Since this driver handle several PMICs,
we must anticipate the addition of new types of ICs and the emergence of new
devices using these PMICs, which could use external logic for chipselect.
Instead use tricks, use proper definitions (or DT description), from my point of view,
better.

> > For i.MX27 phyCORE:
> > https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/arch/arm/boot/dts/imx27-phytec-phycore-som.dtsi?id=986cc4920412d8a7b5c9dba85601651f6373f45e
> 
> Ok, I missed that one.

---

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

* [PATCH 1/4] mfd: mc13xxx: Honor designed SPI mode
  2014-03-04 20:51       ` Alexander Shiyan
@ 2014-03-05 11:57         ` Sascha Hauer
  0 siblings, 0 replies; 15+ messages in thread
From: Sascha Hauer @ 2014-03-05 11:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 05, 2014 at 12:51:05AM +0400, Alexander Shiyan wrote:
> ???????,  4 ????? 2014, 21:13 +01:00 ?? Sascha Hauer <s.hauer@pengutronix.de>:
> > On Mon, Mar 03, 2014 at 01:51:05PM +0400, Alexander Shiyan wrote:
> > > ???????????,  3 ????? 2014, 10:41 +01:00 ?? Sascha Hauer <s.hauer@pengutronix.de>:
> > > > On Sun, Mar 02, 2014 at 11:44:32AM +0400, Alexander Shiyan wrote:
> > > > > Instead of using hard coded SPI mode, use mode described in
> > > > > devicetree or defined for the board.
> > > > > Additionally, patch updates all users of this PMIC to use
> > > > > correct SPI mode.
> > > > 
> > > > What's the reason for this change? Without it the driver just does the
> > > > correct thing, this only adds a chance for boards do get it wrong. This
> > > > for example happens with the i.MX27 phyCORE in this patch, see
> > > > happens with arch/arm/boot/dts/imx27-phytec-phycore-som.dts whih doesn't
> > > > have the spi-cs-high property.
> > > 
> > > How specify proper functionality if chipselect connected through inverter?
> > 
> > Is there such a hardware around?
> 
> AFAIK no, but it is a protection for the future. Since this driver handle several PMICs,
> we must anticipate the addition of new types of ICs and the emergence of new
> devices using these PMICs, which could use external logic for chipselect.
> Instead use tricks, use proper definitions (or DT description), from my point of view,
> better.

In that case rather than breaking devicetree compatibility we really
should leave this problem to someone who actually has this problem. He
could introduce an explicit spi-cs-low property to overwrite the driver
preference.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

end of thread, other threads:[~2014-03-05 11:57 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-02  7:44 [PATCH 1/4] mfd: mc13xxx: Honor designed SPI mode Alexander Shiyan
2014-03-02  7:44 ` [PATCH 2/4] mfd: mc13xxx: Limit maximum SPI speed Alexander Shiyan
2014-03-03  7:36   ` Lee Jones
2014-03-02  7:44 ` [PATCH 3/4] mfd: mc13xxx: Add missing spi_setup() Alexander Shiyan
2014-03-03  7:37   ` Lee Jones
2014-03-02  7:44 ` [PATCH 4/4] regulator: mc13xxx: Fix probing with DT Alexander Shiyan
2014-03-03  1:58   ` Mark Brown
2014-03-03  7:35 ` [PATCH 1/4] mfd: mc13xxx: Honor designed SPI mode Lee Jones
2014-03-03  7:55   ` Alexander Shiyan
2014-03-03  9:23     ` Lee Jones
2014-03-03  9:41 ` Sascha Hauer
2014-03-03  9:51   ` Alexander Shiyan
2014-03-04 20:13     ` Sascha Hauer
2014-03-04 20:51       ` Alexander Shiyan
2014-03-05 11:57         ` Sascha Hauer

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).