mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mc13xxx: make driver-provided SPI frequency overridable
@ 2016-07-20  5:57 Alexander Kurz
  2016-07-21  6:18 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Kurz @ 2016-07-20  5:57 UTC (permalink / raw)
  To: barebox; +Cc: Alexander Kurz

The preset SPI frequency for mc13xxx PMIC introduced with patch 6e18b3a48ee4
("mc13xxx: Define maximum SPI clock frequency global to driver") is not
desirable or working on all boards. Provide a possibility to override
the default SPI max_speed_hz from board code.

Signed-off-by: Alexander Kurz <akurz@blala.de>
---
 drivers/mfd/mc13xxx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/mc13xxx.c b/drivers/mfd/mc13xxx.c
index 68d70c5..b2fcd95 100644
--- a/drivers/mfd/mc13xxx.c
+++ b/drivers/mfd/mc13xxx.c
@@ -330,7 +330,8 @@ static int __init mc13xxx_probe(struct device_d *dev)
 		mc_dev->spi = dev->type_data;
 		mc_dev->spi->mode = SPI_MODE_0 | SPI_CS_HIGH;
 		mc_dev->spi->bits_per_word = 32;
-		mc_dev->spi->max_speed_hz = 20000000;
+		mc_dev->spi->max_speed_hz = mc_dev->spi->max_speed_hz ?
+			mc_dev->spi->max_speed_hz : 20000000;
 		mc_dev->map = regmap_init(dev, &regmap_mc13xxx_spi_bus,
 			     mc_dev, &mc13xxx_regmap_spi_config);
 	}
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] mc13xxx: make driver-provided SPI frequency overridable
  2016-07-20  5:57 [PATCH] mc13xxx: make driver-provided SPI frequency overridable Alexander Kurz
@ 2016-07-21  6:18 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2016-07-21  6:18 UTC (permalink / raw)
  To: Alexander Kurz; +Cc: barebox

On Wed, Jul 20, 2016 at 07:57:28AM +0200, Alexander Kurz wrote:
> The preset SPI frequency for mc13xxx PMIC introduced with patch 6e18b3a48ee4
> ("mc13xxx: Define maximum SPI clock frequency global to driver") is not
> desirable or working on all boards. Provide a possibility to override
> the default SPI max_speed_hz from board code.
> 
> Signed-off-by: Alexander Kurz <akurz@blala.de>
> ---
>  drivers/mfd/mc13xxx.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/mfd/mc13xxx.c b/drivers/mfd/mc13xxx.c
> index 68d70c5..b2fcd95 100644
> --- a/drivers/mfd/mc13xxx.c
> +++ b/drivers/mfd/mc13xxx.c
> @@ -330,7 +330,8 @@ static int __init mc13xxx_probe(struct device_d *dev)
>  		mc_dev->spi = dev->type_data;
>  		mc_dev->spi->mode = SPI_MODE_0 | SPI_CS_HIGH;
>  		mc_dev->spi->bits_per_word = 32;
> -		mc_dev->spi->max_speed_hz = 20000000;
> +		mc_dev->spi->max_speed_hz = mc_dev->spi->max_speed_hz ?
> +			mc_dev->spi->max_speed_hz : 20000000;
>  		mc_dev->map = regmap_init(dev, &regmap_mc13xxx_spi_bus,
>  			     mc_dev, &mc13xxx_regmap_spi_config);
>  	}
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

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

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2016-07-21  6:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-20  5:57 [PATCH] mc13xxx: make driver-provided SPI frequency overridable Alexander Kurz
2016-07-21  6:18 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox