mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexander Kurz <akurz@blala.de>
To: barebox@lists.infradead.org
Cc: Alexander Kurz <akurz@blala.de>
Subject: [PATCH] mc13xxx: make driver-provided SPI frequency overridable
Date: Wed, 20 Jul 2016 07:57:28 +0200	[thread overview]
Message-ID: <1468994248-12641-1-git-send-email-akurz@blala.de> (raw)

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

             reply	other threads:[~2016-07-20  5:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-20  5:57 Alexander Kurz [this message]
2016-07-21  6:18 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1468994248-12641-1-git-send-email-akurz@blala.de \
    --to=akurz@blala.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox