Non-critical DaVinci fixes for v4.11

* Coding style and typo fix
 * Make PLL0 rate setting API for DA850
   less confusing to use.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJYh0mWAAoJEGFBu2jqvgRNx2UQAJhfKAccehGfPHA+JguI3fWv
 uYKCf5OjyaKOmXfx60QhVvqf0LHA8JTfMRtCz4Q/aUjNogylMJvbOGYZi7zptusZ
 yUJHQpk9deAzpj0vUlgMMtWWAryfhzLzyTvBOhTrUZJM9+3ELTGOiBZEOJmWZdmh
 h/Xm0TBzpPjFZkHQuw8YQTDfqTwh1qObRQqsVa3shJHuORVv7OhlTe50jQsypRUX
 2W0fx4LuvpSVGSR0pW8zmNJFHcIBswih7FvRuMH4jCllJeNYP4X6Yz8cTtPZc8uX
 YD/65FlTkngx/7iqBecO+tn1Km6S/CPxyDNcuYsPLa/elEUNsHaZyxCoxHgwWmS9
 YjwtP7hphtEPQwLYlvZ9MYLA2+a+NdErxCFKY1snTdgOevvepKXjLG0oAvb+06vw
 55o5B0EPaLwgACeVhAYH0XBZMzFiwMvWacLb1gCXU4YCZ+QNNz08iWp+w20w38Qd
 K94gqBy8+NQ0FmpgO68x3qtSXMwLxjHqMmjGg2MMr85KwUobfSgzlCCimaGp/mxw
 /fLphOv2IBrPezaTwbBpTp7TkwZ6LLeCNrt5bKaqjTE5Ol6KCPO6whWMqX8mCqvS
 W/rCLf0JhaWS30PMzeQeZQCgabnPK3JCNZYxMRLupGrb5WMo8X9ObgicQDjPSLw3
 6Mf/YkZqTGlQEcIcs7Ls
 =rf0t
 -----END PGP SIGNATURE-----

Merge tag 'davinci-for-v4.11/fixes-non-critical' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into next/fixes-non-critical

Non-critical DaVinci fixes for v4.11

* Coding style and typo fix
* Make PLL0 rate setting API for DA850
  less confusing to use.

* tag 'davinci-for-v4.11/fixes-non-critical' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci:
  bus: da850-mstpri: fix my e-mail address
  ARM: davinci: da850: fix da850_set_pll0rate()
  ARM: davinci: da850: coding style fix

Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
Olof Johansson 2017-01-29 16:58:18 -08:00
commit 2af49ab686
3 changed files with 21 additions and 7 deletions

View File

@ -543,7 +543,7 @@ static struct clk_lookup da850_clks[] = {
CLK("spi_davinci.0", NULL, &spi0_clk),
CLK("spi_davinci.1", NULL, &spi1_clk),
CLK("vpif", NULL, &vpif_clk),
CLK("ahci_da850", NULL, &sata_clk),
CLK("ahci_da850", NULL, &sata_clk),
CLK("davinci-rproc.0", NULL, &dsp_clk),
CLK(NULL, NULL, &ehrpwm_clk),
CLK("ehrpwm.0", "fck", &ehrpwm0_clk),
@ -1174,14 +1174,28 @@ static int da850_set_armrate(struct clk *clk, unsigned long index)
return clk_set_rate(pllclk, index);
}
static int da850_set_pll0rate(struct clk *clk, unsigned long index)
static int da850_set_pll0rate(struct clk *clk, unsigned long rate)
{
unsigned int prediv, mult, postdiv;
struct da850_opp *opp;
struct pll_data *pll = clk->pll_data;
struct cpufreq_frequency_table *freq;
unsigned int prediv, mult, postdiv;
struct da850_opp *opp = NULL;
int ret;
opp = (struct da850_opp *) cpufreq_info.freq_table[index].driver_data;
rate /= 1000;
for (freq = da850_freq_table;
freq->frequency != CPUFREQ_TABLE_END; freq++) {
/* rate is in Hz, freq->frequency is in KHz */
if (freq->frequency == rate) {
opp = (struct da850_opp *)freq->driver_data;
break;
}
}
if (!opp)
return -EINVAL;
prediv = opp->prediv;
mult = opp->mult;
postdiv = opp->postdiv;

View File

@ -4,7 +4,7 @@
* Copyright (C) 2016 BayLibre SAS
*
* Author:
* Bartosz Golaszewski <bgolaszewski@baylibre.com.com>
* Bartosz Golaszewski <bgolaszewski@baylibre.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as

View File

@ -55,7 +55,7 @@ static int davinci_target(struct cpufreq_policy *policy, unsigned int idx)
return ret;
}
ret = clk_set_rate(armclk, idx);
ret = clk_set_rate(armclk, new_freq * 1000);
if (ret)
return ret;