Allwinner clock changes, take 2

A few minor bug and comment fixes, plus some fixes for the PRCM CCU driver
 merged in the prior pull request
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABCAAGBQJY+G2RAAoJEBx+YmzsjxAgIgoP/jkK2DQ7SfrS60dFSSu8zllD
 wm2mBmcmU+qnkMkc5YWls/5Wfq37K4TZrA1/ZJUr9QsWj89iafmmHQVpWV3/2LpK
 3afV9FjRRZONhy9ThRj+DCZg9WSvo73VSNrOXiZKTEVufi8crKCcG2g59p86KyfO
 obTE7Lrl72wqRE+j+KNnIBiCj+rVE6vGrGY5p2ZE/N8VecveJ8Zje03lNL1Jyj+Z
 +rLkQCk4j2DKAKUaaIf+NMQ7L5iT7ePkFPP/yFa3/mpd1Emqp5Kq3cIDxV4Zh+c/
 DwtMBqGbabSvHFeokK9IvEYuTdQidREN/R7uWSLgcWcr1om6es7FD41pVF0FIaAN
 AYgRfIR3RTOXFbPJt8YQrvV/Xg7yQRweEqlKI6sAC4lVI9yzKQAdAoXTM50AotYS
 jB0inoNXg07oQxXrcBaFlcKwsIFOS8k9YWH6NXbofi9/FBswuafgXcZxXKoaNDDU
 K+q2bMG2qlMKTgDV44B8ylbdQISCIrPfreqGkYLRfmZx6iPq79nwdd2Wp+GDZ8sk
 jX+a8UFVdP9194Xk9ZGA/BGIgRTz1OeJtQH2mWmLheGoQjL2lcdriCtUQ+35Yuzd
 caONPr38gvmoixKaWdlqwdurmWvEy8xMvN+r+G9BM855yZMh4ue372xQbGTG4h+d
 sOU4mINfk9z8cZ5UgMdx
 =Gi2w
 -----END PGP SIGNATURE-----

Merge tag 'sunxi-clk-for-4.12-2' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into HEAD

Pull Allwinner clock changes, take 2 from Maxime Ripard:

A few minor bug and comment fixes, plus some fixes for the PRCM CCU driver
merged in the prior pull request

* tag 'sunxi-clk-for-4.12-2' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
  clk: sunxi-ng: a80: Fix audio PLL comment not matching actual code
  clk: sunxi-ng: Fix round_rate/set_rate multiplier minimum mismatch
  clk: sunxi-ng: use 1 as fallback for minimum multiplier
  clk: sunxi-ng: fix PRCM CCU CLK_NUMBER value
  clk: sunxi-ng: fix PRCM CCU ir clk parent
This commit is contained in:
Stephen Boyd 2017-04-21 19:19:46 -07:00
commit de000a88c1
7 changed files with 17 additions and 18 deletions

View File

@ -81,7 +81,7 @@ static SUNXI_CCU_GATE(apb0_i2c_clk, "apb0-i2c", "apb0",
static SUNXI_CCU_GATE(apb0_twd_clk, "apb0-twd", "apb0",
0x28, BIT(7), 0);
static const char * const r_mod0_default_parents[] = { "osc32K", "osc24M" };
static const char * const r_mod0_default_parents[] = { "osc32k", "osc24M" };
static SUNXI_CCU_MP_WITH_MUX_GATE(ir_clk, "ir",
r_mod0_default_parents, 0x54,
0, 4, /* M */

View File

@ -22,6 +22,6 @@
#define CLK_AHB0 1
#define CLK_APB0 2
#define CLK_NUMBER (CLK_APB0_TWD + 1)
#define CLK_NUMBER (CLK_IR + 1)
#endif /* _CCU_SUN8I_R_H */

View File

@ -70,8 +70,7 @@ static struct ccu_mult pll_c1cpux_clk = {
/*
* The Audio PLL has d1, d2 dividers in addition to the usual N, M
* factors. Since we only need 2 frequencies from this PLL: 22.5792 MHz
* and 24.576 MHz, ignore them for now. Enforce the default for them,
* which is d1 = 0, d2 = 1.
* and 24.576 MHz, ignore them for now. Enforce d1 = 0 and d2 = 0.
*/
#define SUN9I_A80_PLL_AUDIO_REG 0x008

View File

@ -102,9 +102,9 @@ static long ccu_nk_round_rate(struct clk_hw *hw, unsigned long rate,
if (nk->common.features & CCU_FEATURE_FIXED_POSTDIV)
rate *= nk->fixed_post_div;
_nk.min_n = nk->n.min;
_nk.min_n = nk->n.min ?: 1;
_nk.max_n = nk->n.max ?: 1 << nk->n.width;
_nk.min_k = nk->k.min;
_nk.min_k = nk->k.min ?: 1;
_nk.max_k = nk->k.max ?: 1 << nk->k.width;
ccu_nk_find_best(*parent_rate, rate, &_nk);
@ -127,9 +127,9 @@ static int ccu_nk_set_rate(struct clk_hw *hw, unsigned long rate,
if (nk->common.features & CCU_FEATURE_FIXED_POSTDIV)
rate = rate * nk->fixed_post_div;
_nk.min_n = nk->n.min;
_nk.min_n = nk->n.min ?: 1;
_nk.max_n = nk->n.max ?: 1 << nk->n.width;
_nk.min_k = nk->k.min;
_nk.min_k = nk->k.min ?: 1;
_nk.max_k = nk->k.max ?: 1 << nk->k.width;
ccu_nk_find_best(parent_rate, rate, &_nk);

View File

@ -109,9 +109,9 @@ static unsigned long ccu_nkm_round_rate(struct ccu_mux_internal *mux,
struct ccu_nkm *nkm = data;
struct _ccu_nkm _nkm;
_nkm.min_n = nkm->n.min;
_nkm.min_n = nkm->n.min ?: 1;
_nkm.max_n = nkm->n.max ?: 1 << nkm->n.width;
_nkm.min_k = nkm->k.min;
_nkm.min_k = nkm->k.min ?: 1;
_nkm.max_k = nkm->k.max ?: 1 << nkm->k.width;
_nkm.min_m = 1;
_nkm.max_m = nkm->m.max ?: 1 << nkm->m.width;
@ -138,9 +138,9 @@ static int ccu_nkm_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long flags;
u32 reg;
_nkm.min_n = nkm->n.min;
_nkm.min_n = nkm->n.min ?: 1;
_nkm.max_n = nkm->n.max ?: 1 << nkm->n.width;
_nkm.min_k = nkm->k.min;
_nkm.min_k = nkm->k.min ?: 1;
_nkm.max_k = nkm->k.max ?: 1 << nkm->k.width;
_nkm.min_m = 1;
_nkm.max_m = nkm->m.max ?: 1 << nkm->m.width;

View File

@ -116,9 +116,9 @@ static long ccu_nkmp_round_rate(struct clk_hw *hw, unsigned long rate,
struct ccu_nkmp *nkmp = hw_to_ccu_nkmp(hw);
struct _ccu_nkmp _nkmp;
_nkmp.min_n = nkmp->n.min;
_nkmp.min_n = nkmp->n.min ?: 1;
_nkmp.max_n = nkmp->n.max ?: 1 << nkmp->n.width;
_nkmp.min_k = nkmp->k.min;
_nkmp.min_k = nkmp->k.min ?: 1;
_nkmp.max_k = nkmp->k.max ?: 1 << nkmp->k.width;
_nkmp.min_m = 1;
_nkmp.max_m = nkmp->m.max ?: 1 << nkmp->m.width;
@ -138,9 +138,9 @@ static int ccu_nkmp_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long flags;
u32 reg;
_nkmp.min_n = 1;
_nkmp.min_n = nkmp->n.min ?: 1;
_nkmp.max_n = nkmp->n.max ?: 1 << nkmp->n.width;
_nkmp.min_k = 1;
_nkmp.min_k = nkmp->k.min ?: 1;
_nkmp.max_k = nkmp->k.max ?: 1 << nkmp->k.width;
_nkmp.min_m = 1;
_nkmp.max_m = nkmp->m.max ?: 1 << nkmp->m.width;

View File

@ -99,7 +99,7 @@ static long ccu_nm_round_rate(struct clk_hw *hw, unsigned long rate,
struct ccu_nm *nm = hw_to_ccu_nm(hw);
struct _ccu_nm _nm;
_nm.min_n = nm->n.min;
_nm.min_n = nm->n.min ?: 1;
_nm.max_n = nm->n.max ?: 1 << nm->n.width;
_nm.min_m = 1;
_nm.max_m = nm->m.max ?: 1 << nm->m.width;
@ -122,7 +122,7 @@ static int ccu_nm_set_rate(struct clk_hw *hw, unsigned long rate,
else
ccu_frac_helper_disable(&nm->common, &nm->frac);
_nm.min_n = 1;
_nm.min_n = nm->n.min ?: 1;
_nm.max_n = nm->n.max ?: 1 << nm->n.width;
_nm.min_m = 1;
_nm.max_m = nm->m.max ?: 1 << nm->m.width;