summaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorAlexander Kurz <akurz@blala.de>2016-07-20 07:57:28 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-08-03 07:30:40 +0200
commitd8a7c4580b5c505da490ef82da56b2bd2411829f (patch)
tree56cc8104710d6c12a32cf680ab5d763f797801b7 /drivers/mfd
parent80c91b67cc19fedf9421632b7a2e165d622af591 (diff)
downloadbarebox-d8a7c4580b5c505da490ef82da56b2bd2411829f.tar.gz
barebox-d8a7c4580b5c505da490ef82da56b2bd2411829f.tar.xz
mc13xxx: make driver-provided SPI frequency overridable
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> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/mc13xxx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mfd/mc13xxx.c b/drivers/mfd/mc13xxx.c
index 68d70c53d5..b2fcd95516 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);
}