cgu                35 drivers/clk/ingenic/cgu.c ingenic_cgu_gate_get(struct ingenic_cgu *cgu,
cgu                38 drivers/clk/ingenic/cgu.c 	return !!(readl(cgu->base + info->reg) & BIT(info->bit))
cgu                53 drivers/clk/ingenic/cgu.c ingenic_cgu_gate_set(struct ingenic_cgu *cgu,
cgu                56 drivers/clk/ingenic/cgu.c 	u32 clkgr = readl(cgu->base + info->reg);
cgu                63 drivers/clk/ingenic/cgu.c 	writel(clkgr, cgu->base + info->reg);
cgu                74 drivers/clk/ingenic/cgu.c 	struct ingenic_cgu *cgu = ingenic_clk->cgu;
cgu                82 drivers/clk/ingenic/cgu.c 	clk_info = &cgu->clock_info[ingenic_clk->idx];
cgu                86 drivers/clk/ingenic/cgu.c 	spin_lock_irqsave(&cgu->lock, flags);
cgu                87 drivers/clk/ingenic/cgu.c 	ctl = readl(cgu->base + pll_info->reg);
cgu                88 drivers/clk/ingenic/cgu.c 	spin_unlock_irqrestore(&cgu->lock, flags);
cgu               148 drivers/clk/ingenic/cgu.c 	struct ingenic_cgu *cgu = ingenic_clk->cgu;
cgu               151 drivers/clk/ingenic/cgu.c 	clk_info = &cgu->clock_info[ingenic_clk->idx];
cgu               172 drivers/clk/ingenic/cgu.c 	struct ingenic_cgu *cgu = ingenic_clk->cgu;
cgu               185 drivers/clk/ingenic/cgu.c 	spin_lock_irqsave(&cgu->lock, flags);
cgu               186 drivers/clk/ingenic/cgu.c 	ctl = readl(cgu->base + pll_info->reg);
cgu               197 drivers/clk/ingenic/cgu.c 	writel(ctl, cgu->base + pll_info->reg);
cgu               198 drivers/clk/ingenic/cgu.c 	spin_unlock_irqrestore(&cgu->lock, flags);
cgu               206 drivers/clk/ingenic/cgu.c 	struct ingenic_cgu *cgu = ingenic_clk->cgu;
cgu               214 drivers/clk/ingenic/cgu.c 	spin_lock_irqsave(&cgu->lock, flags);
cgu               215 drivers/clk/ingenic/cgu.c 	ctl = readl(cgu->base + pll_info->reg);
cgu               220 drivers/clk/ingenic/cgu.c 	writel(ctl, cgu->base + pll_info->reg);
cgu               224 drivers/clk/ingenic/cgu.c 		ctl = readl(cgu->base + pll_info->reg);
cgu               230 drivers/clk/ingenic/cgu.c 	spin_unlock_irqrestore(&cgu->lock, flags);
cgu               241 drivers/clk/ingenic/cgu.c 	struct ingenic_cgu *cgu = ingenic_clk->cgu;
cgu               247 drivers/clk/ingenic/cgu.c 	spin_lock_irqsave(&cgu->lock, flags);
cgu               248 drivers/clk/ingenic/cgu.c 	ctl = readl(cgu->base + pll_info->reg);
cgu               252 drivers/clk/ingenic/cgu.c 	writel(ctl, cgu->base + pll_info->reg);
cgu               253 drivers/clk/ingenic/cgu.c 	spin_unlock_irqrestore(&cgu->lock, flags);
cgu               259 drivers/clk/ingenic/cgu.c 	struct ingenic_cgu *cgu = ingenic_clk->cgu;
cgu               265 drivers/clk/ingenic/cgu.c 	spin_lock_irqsave(&cgu->lock, flags);
cgu               266 drivers/clk/ingenic/cgu.c 	ctl = readl(cgu->base + pll_info->reg);
cgu               267 drivers/clk/ingenic/cgu.c 	spin_unlock_irqrestore(&cgu->lock, flags);
cgu               289 drivers/clk/ingenic/cgu.c 	struct ingenic_cgu *cgu = ingenic_clk->cgu;
cgu               294 drivers/clk/ingenic/cgu.c 	clk_info = &cgu->clock_info[ingenic_clk->idx];
cgu               297 drivers/clk/ingenic/cgu.c 		reg = readl(cgu->base + clk_info->mux.reg);
cgu               317 drivers/clk/ingenic/cgu.c 	struct ingenic_cgu *cgu = ingenic_clk->cgu;
cgu               323 drivers/clk/ingenic/cgu.c 	clk_info = &cgu->clock_info[ingenic_clk->idx];
cgu               348 drivers/clk/ingenic/cgu.c 		spin_lock_irqsave(&cgu->lock, flags);
cgu               351 drivers/clk/ingenic/cgu.c 		reg = readl(cgu->base + clk_info->mux.reg);
cgu               354 drivers/clk/ingenic/cgu.c 		writel(reg, cgu->base + clk_info->mux.reg);
cgu               356 drivers/clk/ingenic/cgu.c 		spin_unlock_irqrestore(&cgu->lock, flags);
cgu               367 drivers/clk/ingenic/cgu.c 	struct ingenic_cgu *cgu = ingenic_clk->cgu;
cgu               372 drivers/clk/ingenic/cgu.c 	clk_info = &cgu->clock_info[ingenic_clk->idx];
cgu               375 drivers/clk/ingenic/cgu.c 		div_reg = readl(cgu->base + clk_info->div.reg);
cgu               442 drivers/clk/ingenic/cgu.c 	struct ingenic_cgu *cgu = ingenic_clk->cgu;
cgu               446 drivers/clk/ingenic/cgu.c 	clk_info = &cgu->clock_info[ingenic_clk->idx];
cgu               461 drivers/clk/ingenic/cgu.c 	struct ingenic_cgu *cgu = ingenic_clk->cgu;
cgu               469 drivers/clk/ingenic/cgu.c 	clk_info = &cgu->clock_info[ingenic_clk->idx];
cgu               483 drivers/clk/ingenic/cgu.c 		spin_lock_irqsave(&cgu->lock, flags);
cgu               484 drivers/clk/ingenic/cgu.c 		reg = readl(cgu->base + clk_info->div.reg);
cgu               500 drivers/clk/ingenic/cgu.c 		writel(reg, cgu->base + clk_info->div.reg);
cgu               505 drivers/clk/ingenic/cgu.c 				reg = readl(cgu->base + clk_info->div.reg);
cgu               514 drivers/clk/ingenic/cgu.c 		spin_unlock_irqrestore(&cgu->lock, flags);
cgu               524 drivers/clk/ingenic/cgu.c 	struct ingenic_cgu *cgu = ingenic_clk->cgu;
cgu               528 drivers/clk/ingenic/cgu.c 	clk_info = &cgu->clock_info[ingenic_clk->idx];
cgu               532 drivers/clk/ingenic/cgu.c 		spin_lock_irqsave(&cgu->lock, flags);
cgu               533 drivers/clk/ingenic/cgu.c 		ingenic_cgu_gate_set(cgu, &clk_info->gate, false);
cgu               534 drivers/clk/ingenic/cgu.c 		spin_unlock_irqrestore(&cgu->lock, flags);
cgu               546 drivers/clk/ingenic/cgu.c 	struct ingenic_cgu *cgu = ingenic_clk->cgu;
cgu               550 drivers/clk/ingenic/cgu.c 	clk_info = &cgu->clock_info[ingenic_clk->idx];
cgu               554 drivers/clk/ingenic/cgu.c 		spin_lock_irqsave(&cgu->lock, flags);
cgu               555 drivers/clk/ingenic/cgu.c 		ingenic_cgu_gate_set(cgu, &clk_info->gate, true);
cgu               556 drivers/clk/ingenic/cgu.c 		spin_unlock_irqrestore(&cgu->lock, flags);
cgu               563 drivers/clk/ingenic/cgu.c 	struct ingenic_cgu *cgu = ingenic_clk->cgu;
cgu               568 drivers/clk/ingenic/cgu.c 	clk_info = &cgu->clock_info[ingenic_clk->idx];
cgu               571 drivers/clk/ingenic/cgu.c 		spin_lock_irqsave(&cgu->lock, flags);
cgu               572 drivers/clk/ingenic/cgu.c 		enabled = !ingenic_cgu_gate_get(cgu, &clk_info->gate);
cgu               573 drivers/clk/ingenic/cgu.c 		spin_unlock_irqrestore(&cgu->lock, flags);
cgu               596 drivers/clk/ingenic/cgu.c static int ingenic_register_clock(struct ingenic_cgu *cgu, unsigned idx)
cgu               598 drivers/clk/ingenic/cgu.c 	const struct ingenic_cgu_clk_info *clk_info = &cgu->clock_info[idx];
cgu               609 drivers/clk/ingenic/cgu.c 		clk = of_clk_get_by_name(cgu->np, clk_info->name);
cgu               621 drivers/clk/ingenic/cgu.c 		cgu->clocks.clks[idx] = clk;
cgu               638 drivers/clk/ingenic/cgu.c 	ingenic_clk->cgu = cgu;
cgu               659 drivers/clk/ingenic/cgu.c 			parent = cgu->clocks.clks[clk_info->parents[i]];
cgu               670 drivers/clk/ingenic/cgu.c 		parent = cgu->clocks.clks[clk_info->parents[0]];
cgu               733 drivers/clk/ingenic/cgu.c 	cgu->clocks.clks[idx] = clk;
cgu               744 drivers/clk/ingenic/cgu.c 	struct ingenic_cgu *cgu;
cgu               746 drivers/clk/ingenic/cgu.c 	cgu = kzalloc(sizeof(*cgu), GFP_KERNEL);
cgu               747 drivers/clk/ingenic/cgu.c 	if (!cgu)
cgu               750 drivers/clk/ingenic/cgu.c 	cgu->base = of_iomap(np, 0);
cgu               751 drivers/clk/ingenic/cgu.c 	if (!cgu->base) {
cgu               756 drivers/clk/ingenic/cgu.c 	cgu->np = np;
cgu               757 drivers/clk/ingenic/cgu.c 	cgu->clock_info = clock_info;
cgu               758 drivers/clk/ingenic/cgu.c 	cgu->clocks.clk_num = num_clocks;
cgu               760 drivers/clk/ingenic/cgu.c 	spin_lock_init(&cgu->lock);
cgu               762 drivers/clk/ingenic/cgu.c 	return cgu;
cgu               765 drivers/clk/ingenic/cgu.c 	kfree(cgu);
cgu               770 drivers/clk/ingenic/cgu.c int ingenic_cgu_register_clocks(struct ingenic_cgu *cgu)
cgu               775 drivers/clk/ingenic/cgu.c 	cgu->clocks.clks = kcalloc(cgu->clocks.clk_num, sizeof(struct clk *),
cgu               777 drivers/clk/ingenic/cgu.c 	if (!cgu->clocks.clks) {
cgu               782 drivers/clk/ingenic/cgu.c 	for (i = 0; i < cgu->clocks.clk_num; i++) {
cgu               783 drivers/clk/ingenic/cgu.c 		err = ingenic_register_clock(cgu, i);
cgu               788 drivers/clk/ingenic/cgu.c 	err = of_clk_add_provider(cgu->np, of_clk_src_onecell_get,
cgu               789 drivers/clk/ingenic/cgu.c 				  &cgu->clocks);
cgu               796 drivers/clk/ingenic/cgu.c 	for (i = 0; i < cgu->clocks.clk_num; i++) {
cgu               797 drivers/clk/ingenic/cgu.c 		if (!cgu->clocks.clks[i])
cgu               799 drivers/clk/ingenic/cgu.c 		if (cgu->clock_info[i].type & CGU_CLK_EXT)
cgu               800 drivers/clk/ingenic/cgu.c 			clk_put(cgu->clocks.clks[i]);
cgu               802 drivers/clk/ingenic/cgu.c 			clk_unregister(cgu->clocks.clks[i]);
cgu               804 drivers/clk/ingenic/cgu.c 	kfree(cgu->clocks.clks);
cgu               198 drivers/clk/ingenic/cgu.h 	struct ingenic_cgu *cgu;
cgu               226 drivers/clk/ingenic/cgu.h int ingenic_cgu_register_clocks(struct ingenic_cgu *cgu);
cgu                31 drivers/clk/ingenic/jz4725b-cgu.c static struct ingenic_cgu *cgu;
cgu               247 drivers/clk/ingenic/jz4725b-cgu.c 	cgu = ingenic_cgu_new(jz4725b_cgu_clocks,
cgu               249 drivers/clk/ingenic/jz4725b-cgu.c 	if (!cgu) {
cgu               254 drivers/clk/ingenic/jz4725b-cgu.c 	retval = ingenic_cgu_register_clocks(cgu);
cgu               258 drivers/clk/ingenic/jz4725b-cgu.c 	ingenic_cgu_register_syscore_ops(cgu);
cgu                46 drivers/clk/ingenic/jz4740-cgu.c static struct ingenic_cgu *cgu;
cgu               244 drivers/clk/ingenic/jz4740-cgu.c 	cgu = ingenic_cgu_new(jz4740_cgu_clocks,
cgu               246 drivers/clk/ingenic/jz4740-cgu.c 	if (!cgu) {
cgu               251 drivers/clk/ingenic/jz4740-cgu.c 	retval = ingenic_cgu_register_clocks(cgu);
cgu               255 drivers/clk/ingenic/jz4740-cgu.c 	ingenic_cgu_register_syscore_ops(cgu);
cgu                47 drivers/clk/ingenic/jz4770-cgu.c static struct ingenic_cgu *cgu;
cgu                51 drivers/clk/ingenic/jz4770-cgu.c 	void __iomem *reg_opcr		= cgu->base + CGU_REG_OPCR;
cgu                52 drivers/clk/ingenic/jz4770-cgu.c 	void __iomem *reg_usbpcr1	= cgu->base + CGU_REG_USBPCR1;
cgu                61 drivers/clk/ingenic/jz4770-cgu.c 	void __iomem *reg_opcr		= cgu->base + CGU_REG_OPCR;
cgu                62 drivers/clk/ingenic/jz4770-cgu.c 	void __iomem *reg_usbpcr1	= cgu->base + CGU_REG_USBPCR1;
cgu                70 drivers/clk/ingenic/jz4770-cgu.c 	void __iomem *reg_opcr		= cgu->base + CGU_REG_OPCR;
cgu                71 drivers/clk/ingenic/jz4770-cgu.c 	void __iomem *reg_usbpcr1	= cgu->base + CGU_REG_USBPCR1;
cgu               433 drivers/clk/ingenic/jz4770-cgu.c 	cgu = ingenic_cgu_new(jz4770_cgu_clocks,
cgu               435 drivers/clk/ingenic/jz4770-cgu.c 	if (!cgu) {
cgu               440 drivers/clk/ingenic/jz4770-cgu.c 	retval = ingenic_cgu_register_clocks(cgu);
cgu               444 drivers/clk/ingenic/jz4770-cgu.c 	ingenic_cgu_register_syscore_ops(cgu);
cgu                91 drivers/clk/ingenic/jz4780-cgu.c static struct ingenic_cgu *cgu;
cgu               107 drivers/clk/ingenic/jz4780-cgu.c 	spin_lock_irqsave(&cgu->lock, flags);
cgu               109 drivers/clk/ingenic/jz4780-cgu.c 	usbpcr1 = readl(cgu->base + CGU_REG_USBPCR1);
cgu               113 drivers/clk/ingenic/jz4780-cgu.c 	writel(usbpcr1, cgu->base + CGU_REG_USBPCR1);
cgu               115 drivers/clk/ingenic/jz4780-cgu.c 	spin_unlock_irqrestore(&cgu->lock, flags);
cgu               125 drivers/clk/ingenic/jz4780-cgu.c 	usbpcr1 = readl(cgu->base + CGU_REG_USBPCR1);
cgu               188 drivers/clk/ingenic/jz4780-cgu.c 	spin_lock_irqsave(&cgu->lock, flags);
cgu               190 drivers/clk/ingenic/jz4780-cgu.c 	usbpcr1 = readl(cgu->base + CGU_REG_USBPCR1);
cgu               193 drivers/clk/ingenic/jz4780-cgu.c 	writel(usbpcr1, cgu->base + CGU_REG_USBPCR1);
cgu               195 drivers/clk/ingenic/jz4780-cgu.c 	spin_unlock_irqrestore(&cgu->lock, flags);
cgu               713 drivers/clk/ingenic/jz4780-cgu.c 	cgu = ingenic_cgu_new(jz4780_cgu_clocks,
cgu               715 drivers/clk/ingenic/jz4780-cgu.c 	if (!cgu) {
cgu               720 drivers/clk/ingenic/jz4780-cgu.c 	retval = ingenic_cgu_register_clocks(cgu);
cgu               726 drivers/clk/ingenic/jz4780-cgu.c 	ingenic_cgu_register_syscore_ops(cgu);
cgu                39 drivers/clk/ingenic/pm.c void ingenic_cgu_register_syscore_ops(struct ingenic_cgu *cgu)
cgu                42 drivers/clk/ingenic/pm.c 		ingenic_cgu_base = cgu->base;
cgu                10 drivers/clk/ingenic/pm.h void ingenic_cgu_register_syscore_ops(struct ingenic_cgu *cgu);