Lines Matching refs:pmc

36 	struct at91_pmc *pmc;  member
44 struct at91_pmc *pmc; member
57 struct at91_pmc *pmc = periph->pmc; in clk_peripheral_enable() local
65 pmc_write(pmc, offset, PERIPHERAL_MASK(id)); in clk_peripheral_enable()
72 struct at91_pmc *pmc = periph->pmc; in clk_peripheral_disable() local
80 pmc_write(pmc, offset, PERIPHERAL_MASK(id)); in clk_peripheral_disable()
86 struct at91_pmc *pmc = periph->pmc; in clk_peripheral_is_enabled() local
94 return !!(pmc_read(pmc, offset) & PERIPHERAL_MASK(id)); in clk_peripheral_is_enabled()
104 at91_clk_register_peripheral(struct at91_pmc *pmc, const char *name, in at91_clk_register_peripheral() argument
111 if (!pmc || !name || !parent_name || id > PERIPHERAL_ID_MAX) in at91_clk_register_peripheral()
126 periph->pmc = pmc; in at91_clk_register_peripheral()
163 struct at91_pmc *pmc = periph->pmc; in clk_sam9x5_peripheral_enable() local
169 pmc_lock(pmc); in clk_sam9x5_peripheral_enable()
170 pmc_write(pmc, AT91_PMC_PCR, (periph->id & AT91_PMC_PCR_PID_MASK)); in clk_sam9x5_peripheral_enable()
171 tmp = pmc_read(pmc, AT91_PMC_PCR) & ~AT91_PMC_PCR_DIV_MASK; in clk_sam9x5_peripheral_enable()
172 pmc_write(pmc, AT91_PMC_PCR, tmp | AT91_PMC_PCR_DIV(periph->div) in clk_sam9x5_peripheral_enable()
175 pmc_unlock(pmc); in clk_sam9x5_peripheral_enable()
182 struct at91_pmc *pmc = periph->pmc; in clk_sam9x5_peripheral_disable() local
188 pmc_lock(pmc); in clk_sam9x5_peripheral_disable()
189 pmc_write(pmc, AT91_PMC_PCR, (periph->id & AT91_PMC_PCR_PID_MASK)); in clk_sam9x5_peripheral_disable()
190 tmp = pmc_read(pmc, AT91_PMC_PCR) & ~AT91_PMC_PCR_EN; in clk_sam9x5_peripheral_disable()
191 pmc_write(pmc, AT91_PMC_PCR, tmp | AT91_PMC_PCR_CMD); in clk_sam9x5_peripheral_disable()
192 pmc_unlock(pmc); in clk_sam9x5_peripheral_disable()
198 struct at91_pmc *pmc = periph->pmc; in clk_sam9x5_peripheral_is_enabled() local
204 pmc_lock(pmc); in clk_sam9x5_peripheral_is_enabled()
205 pmc_write(pmc, AT91_PMC_PCR, (periph->id & AT91_PMC_PCR_PID_MASK)); in clk_sam9x5_peripheral_is_enabled()
206 ret = !!(pmc_read(pmc, AT91_PMC_PCR) & AT91_PMC_PCR_EN); in clk_sam9x5_peripheral_is_enabled()
207 pmc_unlock(pmc); in clk_sam9x5_peripheral_is_enabled()
217 struct at91_pmc *pmc = periph->pmc; in clk_sam9x5_peripheral_recalc_rate() local
223 pmc_lock(pmc); in clk_sam9x5_peripheral_recalc_rate()
224 pmc_write(pmc, AT91_PMC_PCR, (periph->id & AT91_PMC_PCR_PID_MASK)); in clk_sam9x5_peripheral_recalc_rate()
225 tmp = pmc_read(pmc, AT91_PMC_PCR); in clk_sam9x5_peripheral_recalc_rate()
226 pmc_unlock(pmc); in clk_sam9x5_peripheral_recalc_rate()
321 at91_clk_register_sam9x5_peripheral(struct at91_pmc *pmc, const char *name, in at91_clk_register_sam9x5_peripheral() argument
329 if (!pmc || !name || !parent_name) in at91_clk_register_sam9x5_peripheral()
345 periph->pmc = pmc; in at91_clk_register_sam9x5_peripheral()
359 of_at91_clk_periph_setup(struct device_node *np, struct at91_pmc *pmc, u8 type) in of_at91_clk_periph_setup() argument
387 clk = at91_clk_register_peripheral(pmc, name, in of_at91_clk_periph_setup()
396 clk = at91_clk_register_sam9x5_peripheral(pmc, name, in of_at91_clk_periph_setup()
409 struct at91_pmc *pmc) in of_at91rm9200_clk_periph_setup() argument
411 of_at91_clk_periph_setup(np, pmc, PERIPHERAL_AT91RM9200); in of_at91rm9200_clk_periph_setup()
415 struct at91_pmc *pmc) in of_at91sam9x5_clk_periph_setup() argument
417 of_at91_clk_periph_setup(np, pmc, PERIPHERAL_AT91SAM9X5); in of_at91sam9x5_clk_periph_setup()