diff options
author | Mark Brown | 2016-02-09 19:20:39 +0100 |
---|---|---|
committer | Mark Brown | 2016-02-09 19:20:39 +0100 |
commit | fcdcc79628a1919bde9acf239e364f65bab6327c (patch) | |
tree | 5499be387cf3028c90ac083b1cf866ebed7bf7e0 /drivers/spi/spi-sun6i.c | |
parent | spi: pxa2xx: Fix too early chipselect deassert (diff) | |
parent | spi: Let drivers translate ACPI DeviceSelection to suitable Linux chip select (diff) | |
download | kernel-qcow2-linux-fcdcc79628a1919bde9acf239e364f65bab6327c.tar.gz kernel-qcow2-linux-fcdcc79628a1919bde9acf239e364f65bab6327c.tar.xz kernel-qcow2-linux-fcdcc79628a1919bde9acf239e364f65bab6327c.zip |
Merge branch 'topic/acpi' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-pxa2xx
Diffstat (limited to 'drivers/spi/spi-sun6i.c')
-rw-r--r-- | drivers/spi/spi-sun6i.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c index ac48f59705a8..42e2c4bd690a 100644 --- a/drivers/spi/spi-sun6i.c +++ b/drivers/spi/spi-sun6i.c @@ -217,8 +217,8 @@ static int sun6i_spi_transfer_one(struct spi_master *master, /* Ensure that we have a parent clock fast enough */ mclk_rate = clk_get_rate(sspi->mclk); - if (mclk_rate < (2 * spi->max_speed_hz)) { - clk_set_rate(sspi->mclk, 2 * spi->max_speed_hz); + if (mclk_rate < (2 * tfr->speed_hz)) { + clk_set_rate(sspi->mclk, 2 * tfr->speed_hz); mclk_rate = clk_get_rate(sspi->mclk); } @@ -236,14 +236,14 @@ static int sun6i_spi_transfer_one(struct spi_master *master, * First try CDR2, and if we can't reach the expected * frequency, fall back to CDR1. */ - div = mclk_rate / (2 * spi->max_speed_hz); + div = mclk_rate / (2 * tfr->speed_hz); if (div <= (SUN6I_CLK_CTL_CDR2_MASK + 1)) { if (div > 0) div--; reg = SUN6I_CLK_CTL_CDR2(div) | SUN6I_CLK_CTL_DRS; } else { - div = ilog2(mclk_rate) - ilog2(spi->max_speed_hz); + div = ilog2(mclk_rate) - ilog2(tfr->speed_hz); reg = SUN6I_CLK_CTL_CDR1(div); } |