Lines Matching defs:nk

19 			     struct _ccu_nk *nk)
25 for (_k = nk->min_k; _k <= nk->max_k; _k++) {
26 for (_n = nk->min_n; _n <= nk->max_n; _n++) {
40 nk->k = best_k;
41 nk->n = best_n;
46 struct ccu_nk *nk = hw_to_ccu_nk(hw);
48 return ccu_gate_helper_disable(&nk->common, nk->enable);
53 struct ccu_nk *nk = hw_to_ccu_nk(hw);
55 return ccu_gate_helper_enable(&nk->common, nk->enable);
60 struct ccu_nk *nk = hw_to_ccu_nk(hw);
62 return ccu_gate_helper_is_enabled(&nk->common, nk->enable);
68 struct ccu_nk *nk = hw_to_ccu_nk(hw);
72 reg = readl(nk->common.base + nk->common.reg);
74 n = reg >> nk->n.shift;
75 n &= (1 << nk->n.width) - 1;
76 n += nk->n.offset;
80 k = reg >> nk->k.shift;
81 k &= (1 << nk->k.width) - 1;
82 k += nk->k.offset;
87 if (nk->common.features & CCU_FEATURE_FIXED_POSTDIV)
88 rate /= nk->fixed_post_div;
96 struct ccu_nk *nk = hw_to_ccu_nk(hw);
99 if (nk->common.features & CCU_FEATURE_FIXED_POSTDIV)
100 rate *= nk->fixed_post_div;
102 _nk.min_n = nk->n.min ?: 1;
103 _nk.max_n = nk->n.max ?: 1 << nk->n.width;
104 _nk.min_k = nk->k.min ?: 1;
105 _nk.max_k = nk->k.max ?: 1 << nk->k.width;
110 if (nk->common.features & CCU_FEATURE_FIXED_POSTDIV)
111 rate = rate / nk->fixed_post_div;
119 struct ccu_nk *nk = hw_to_ccu_nk(hw);
124 if (nk->common.features & CCU_FEATURE_FIXED_POSTDIV)
125 rate = rate * nk->fixed_post_div;
127 _nk.min_n = nk->n.min ?: 1;
128 _nk.max_n = nk->n.max ?: 1 << nk->n.width;
129 _nk.min_k = nk->k.min ?: 1;
130 _nk.max_k = nk->k.max ?: 1 << nk->k.width;
134 spin_lock_irqsave(nk->common.lock, flags);
136 reg = readl(nk->common.base + nk->common.reg);
137 reg &= ~GENMASK(nk->n.width + nk->n.shift - 1, nk->n.shift);
138 reg &= ~GENMASK(nk->k.width + nk->k.shift - 1, nk->k.shift);
140 reg |= (_nk.k - nk->k.offset) << nk->k.shift;
141 reg |= (_nk.n - nk->n.offset) << nk->n.shift;
142 writel(reg, nk->common.base + nk->common.reg);
144 spin_unlock_irqrestore(nk->common.lock, flags);
146 ccu_helper_wait_for_lock(&nk->common, nk->lock);