aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-img-spfi.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2015-04-08 16:04:43 -0400
committerMark Brown <broonie@kernel.org>2015-04-08 16:04:43 -0400
commita25202b04f17830dbf241a24838f8c8575a56611 (patch)
treeba86151a4c53cb96cb420a6e43b8404cac661280 /drivers/spi/spi-img-spfi.c
parentba33d8ac0c93fdfbdbc825ef690caab5d57e22c2 (diff)
parent8543d0e72d4340001d756bd89bee70ce239e1ea5 (diff)
Merge branch 'fix/img-spfi' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-img-spfi
Diffstat (limited to 'drivers/spi/spi-img-spfi.c')
-rw-r--r--drivers/spi/spi-img-spfi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/spi/spi-img-spfi.c b/drivers/spi/spi-img-spfi.c
index c37f6e50096e..dedb7d880ccc 100644
--- a/drivers/spi/spi-img-spfi.c
+++ b/drivers/spi/spi-img-spfi.c
@@ -453,10 +453,10 @@ static void img_spfi_config(struct spi_master *master, struct spi_device *spi,
453 453
454 /* 454 /*
455 * output = spfi_clk * (BITCLK / 512), where BITCLK must be a 455 * output = spfi_clk * (BITCLK / 512), where BITCLK must be a
456 * power of 2 up to 256 (where 255 == 256 since BITCLK is 8 bits) 456 * power of 2 up to 128
457 */ 457 */
458 div = DIV_ROUND_UP(master->max_speed_hz, xfer->speed_hz); 458 div = DIV_ROUND_UP(clk_get_rate(spfi->spfi_clk), xfer->speed_hz);
459 div = clamp(512 / (1 << get_count_order(div)), 1, 255); 459 div = clamp(512 / (1 << get_count_order(div)), 1, 128);
460 460
461 val = spfi_readl(spfi, SPFI_DEVICE_PARAMETER(spi->chip_select)); 461 val = spfi_readl(spfi, SPFI_DEVICE_PARAMETER(spi->chip_select));
462 val &= ~(SPFI_DEVICE_PARAMETER_BITCLK_MASK << 462 val &= ~(SPFI_DEVICE_PARAMETER_BITCLK_MASK <<
@@ -612,8 +612,8 @@ static int img_spfi_probe(struct platform_device *pdev)
612 master->num_chipselect = 5; 612 master->num_chipselect = 5;
613 master->dev.of_node = pdev->dev.of_node; 613 master->dev.of_node = pdev->dev.of_node;
614 master->bits_per_word_mask = SPI_BPW_MASK(32) | SPI_BPW_MASK(8); 614 master->bits_per_word_mask = SPI_BPW_MASK(32) | SPI_BPW_MASK(8);
615 master->max_speed_hz = clk_get_rate(spfi->spfi_clk); 615 master->max_speed_hz = clk_get_rate(spfi->spfi_clk) / 4;
616 master->min_speed_hz = master->max_speed_hz / 512; 616 master->min_speed_hz = clk_get_rate(spfi->spfi_clk) / 512;
617 617
618 master->set_cs = img_spfi_set_cs; 618 master->set_cs = img_spfi_set_cs;
619 master->transfer_one = img_spfi_transfer_one; 619 master->transfer_one = img_spfi_transfer_one;