cprman 333 drivers/clk/bcm/clk-bcm2835.c static inline void cprman_write(struct bcm2835_cprman *cprman, u32 reg, u32 val) cprman 335 drivers/clk/bcm/clk-bcm2835.c writel(CM_PASSWORD | val, cprman->regs + reg); cprman 338 drivers/clk/bcm/clk-bcm2835.c static inline u32 cprman_read(struct bcm2835_cprman *cprman, u32 reg) cprman 340 drivers/clk/bcm/clk-bcm2835.c return readl(cprman->regs + reg); cprman 346 drivers/clk/bcm/clk-bcm2835.c static unsigned long bcm2835_measure_tcnt_mux(struct bcm2835_cprman *cprman, cprman 353 drivers/clk/bcm/clk-bcm2835.c spin_lock(&cprman->regs_lock); cprman 355 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, CM_TCNTCTL, CM_KILL); cprman 357 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, CM_TCNTCTL, cprman 361 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, CM_OSCCOUNT, osccount); cprman 368 drivers/clk/bcm/clk-bcm2835.c while (cprman_read(cprman, CM_OSCCOUNT)) { cprman 370 drivers/clk/bcm/clk-bcm2835.c dev_err(cprman->dev, "timeout waiting for OSCCOUNT\n"); cprman 379 drivers/clk/bcm/clk-bcm2835.c while (cprman_read(cprman, CM_TCNTCTL) & CM_BUSY) { cprman 381 drivers/clk/bcm/clk-bcm2835.c dev_err(cprman->dev, "timeout waiting for !BUSY\n"); cprman 388 drivers/clk/bcm/clk-bcm2835.c count = cprman_read(cprman, CM_TCNTCNT); cprman 390 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, CM_TCNTCTL, 0); cprman 393 drivers/clk/bcm/clk-bcm2835.c spin_unlock(&cprman->regs_lock); cprman 398 drivers/clk/bcm/clk-bcm2835.c static void bcm2835_debugfs_regset(struct bcm2835_cprman *cprman, u32 base, cprman 404 drivers/clk/bcm/clk-bcm2835.c regset = devm_kzalloc(cprman->dev, sizeof(*regset), GFP_KERNEL); cprman 410 drivers/clk/bcm/clk-bcm2835.c regset->base = cprman->regs + base; cprman 514 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman; cprman 521 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = pll->cprman; cprman 524 drivers/clk/bcm/clk-bcm2835.c return cprman_read(cprman, data->a2w_ctrl_reg) & cprman 572 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = pll->cprman; cprman 574 drivers/clk/bcm/clk-bcm2835.c u32 a2wctrl = cprman_read(cprman, data->a2w_ctrl_reg); cprman 581 drivers/clk/bcm/clk-bcm2835.c fdiv = cprman_read(cprman, data->frac_reg) & A2W_PLL_FRAC_MASK; cprman 584 drivers/clk/bcm/clk-bcm2835.c using_prediv = cprman_read(cprman, data->ana_reg_base + 4) & cprman 598 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = pll->cprman; cprman 601 drivers/clk/bcm/clk-bcm2835.c spin_lock(&cprman->regs_lock); cprman 602 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, data->cm_ctrl_reg, CM_PLL_ANARST); cprman 603 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, data->a2w_ctrl_reg, cprman 604 drivers/clk/bcm/clk-bcm2835.c cprman_read(cprman, data->a2w_ctrl_reg) | cprman 606 drivers/clk/bcm/clk-bcm2835.c spin_unlock(&cprman->regs_lock); cprman 612 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = pll->cprman; cprman 616 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, data->a2w_ctrl_reg, cprman 617 drivers/clk/bcm/clk-bcm2835.c cprman_read(cprman, data->a2w_ctrl_reg) & cprman 621 drivers/clk/bcm/clk-bcm2835.c spin_lock(&cprman->regs_lock); cprman 622 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, data->cm_ctrl_reg, cprman 623 drivers/clk/bcm/clk-bcm2835.c cprman_read(cprman, data->cm_ctrl_reg) & ~CM_PLL_ANARST); cprman 624 drivers/clk/bcm/clk-bcm2835.c spin_unlock(&cprman->regs_lock); cprman 628 drivers/clk/bcm/clk-bcm2835.c while (!(cprman_read(cprman, CM_LOCK) & data->lock_mask)) { cprman 630 drivers/clk/bcm/clk-bcm2835.c dev_err(cprman->dev, "%s: couldn't lock PLL\n", cprman 638 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, data->a2w_ctrl_reg, cprman 639 drivers/clk/bcm/clk-bcm2835.c cprman_read(cprman, data->a2w_ctrl_reg) | cprman 646 drivers/clk/bcm/clk-bcm2835.c bcm2835_pll_write_ana(struct bcm2835_cprman *cprman, u32 ana_reg_base, u32 *ana) cprman 659 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, ana_reg_base + i * 4, ana[i]); cprman 666 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = pll->cprman; cprman 683 drivers/clk/bcm/clk-bcm2835.c ana[i] = cprman_read(cprman, data->ana_reg_base + i * 4); cprman 705 drivers/clk/bcm/clk-bcm2835.c spin_lock(&cprman->regs_lock); cprman 706 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, A2W_XOSC_CTRL, cprman 707 drivers/clk/bcm/clk-bcm2835.c cprman_read(cprman, A2W_XOSC_CTRL) | cprman 709 drivers/clk/bcm/clk-bcm2835.c spin_unlock(&cprman->regs_lock); cprman 712 drivers/clk/bcm/clk-bcm2835.c bcm2835_pll_write_ana(cprman, data->ana_reg_base, ana); cprman 715 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, data->frac_reg, fdiv); cprman 717 drivers/clk/bcm/clk-bcm2835.c a2w_ctl = cprman_read(cprman, data->a2w_ctrl_reg); cprman 722 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, data->a2w_ctrl_reg, a2w_ctl); cprman 725 drivers/clk/bcm/clk-bcm2835.c bcm2835_pll_write_ana(cprman, data->ana_reg_base, ana); cprman 734 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = pll->cprman; cprman 738 drivers/clk/bcm/clk-bcm2835.c regs = devm_kcalloc(cprman->dev, 7, sizeof(*regs), GFP_KERNEL); cprman 757 drivers/clk/bcm/clk-bcm2835.c bcm2835_debugfs_regset(cprman, 0, regs, 7, dentry); cprman 772 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman; cprman 785 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = divider->cprman; cprman 788 drivers/clk/bcm/clk-bcm2835.c return !(cprman_read(cprman, data->a2w_reg) & A2W_PLL_CHANNEL_DISABLE); cprman 807 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = divider->cprman; cprman 810 drivers/clk/bcm/clk-bcm2835.c spin_lock(&cprman->regs_lock); cprman 811 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, data->cm_reg, cprman 812 drivers/clk/bcm/clk-bcm2835.c (cprman_read(cprman, data->cm_reg) & cprman 814 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, data->a2w_reg, cprman 815 drivers/clk/bcm/clk-bcm2835.c cprman_read(cprman, data->a2w_reg) | cprman 817 drivers/clk/bcm/clk-bcm2835.c spin_unlock(&cprman->regs_lock); cprman 823 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = divider->cprman; cprman 826 drivers/clk/bcm/clk-bcm2835.c spin_lock(&cprman->regs_lock); cprman 827 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, data->a2w_reg, cprman 828 drivers/clk/bcm/clk-bcm2835.c cprman_read(cprman, data->a2w_reg) & cprman 831 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, data->cm_reg, cprman 832 drivers/clk/bcm/clk-bcm2835.c cprman_read(cprman, data->cm_reg) & ~data->hold_mask); cprman 833 drivers/clk/bcm/clk-bcm2835.c spin_unlock(&cprman->regs_lock); cprman 843 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = divider->cprman; cprman 853 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, data->a2w_reg, div); cprman 854 drivers/clk/bcm/clk-bcm2835.c cm = cprman_read(cprman, data->cm_reg); cprman 855 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, data->cm_reg, cm | data->load_mask); cprman 856 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, data->cm_reg, cm & ~data->load_mask); cprman 865 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = divider->cprman; cprman 869 drivers/clk/bcm/clk-bcm2835.c regs = devm_kcalloc(cprman->dev, 7, sizeof(*regs), GFP_KERNEL); cprman 878 drivers/clk/bcm/clk-bcm2835.c bcm2835_debugfs_regset(cprman, 0, regs, 2, dentry); cprman 899 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman; cprman 911 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = clock->cprman; cprman 914 drivers/clk/bcm/clk-bcm2835.c return (cprman_read(cprman, data->ctl_reg) & CM_ENABLE) != 0; cprman 990 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = clock->cprman; cprman 997 drivers/clk/bcm/clk-bcm2835.c div = cprman_read(cprman, data->div_reg); cprman 1004 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = clock->cprman; cprman 1008 drivers/clk/bcm/clk-bcm2835.c while (cprman_read(cprman, data->ctl_reg) & CM_BUSY) { cprman 1010 drivers/clk/bcm/clk-bcm2835.c dev_err(cprman->dev, "%s: couldn't lock PLL\n", cprman 1021 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = clock->cprman; cprman 1024 drivers/clk/bcm/clk-bcm2835.c spin_lock(&cprman->regs_lock); cprman 1025 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, data->ctl_reg, cprman 1026 drivers/clk/bcm/clk-bcm2835.c cprman_read(cprman, data->ctl_reg) & ~CM_ENABLE); cprman 1027 drivers/clk/bcm/clk-bcm2835.c spin_unlock(&cprman->regs_lock); cprman 1036 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = clock->cprman; cprman 1039 drivers/clk/bcm/clk-bcm2835.c spin_lock(&cprman->regs_lock); cprman 1040 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, data->ctl_reg, cprman 1041 drivers/clk/bcm/clk-bcm2835.c cprman_read(cprman, data->ctl_reg) | cprman 1044 drivers/clk/bcm/clk-bcm2835.c spin_unlock(&cprman->regs_lock); cprman 1050 drivers/clk/bcm/clk-bcm2835.c dev_info(cprman->dev, cprman 1054 drivers/clk/bcm/clk-bcm2835.c bcm2835_measure_tcnt_mux(cprman, data->tcnt_mux)); cprman 1064 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = clock->cprman; cprman 1069 drivers/clk/bcm/clk-bcm2835.c spin_lock(&cprman->regs_lock); cprman 1079 drivers/clk/bcm/clk-bcm2835.c ctl = cprman_read(cprman, data->ctl_reg) & ~CM_FRAC; cprman 1081 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, data->ctl_reg, ctl); cprman 1083 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, data->div_reg, div); cprman 1085 drivers/clk/bcm/clk-bcm2835.c spin_unlock(&cprman->regs_lock); cprman 1107 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = clock->cprman; cprman 1141 drivers/clk/bcm/clk-bcm2835.c dev_warn(cprman->dev, cprman 1225 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = clock->cprman; cprman 1229 drivers/clk/bcm/clk-bcm2835.c cprman_write(cprman, data->ctl_reg, src); cprman 1236 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = clock->cprman; cprman 1238 drivers/clk/bcm/clk-bcm2835.c u32 src = cprman_read(cprman, data->ctl_reg); cprman 1258 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman = clock->cprman; cprman 1261 drivers/clk/bcm/clk-bcm2835.c bcm2835_debugfs_regset(cprman, data->ctl_reg, cprman 1298 drivers/clk/bcm/clk-bcm2835.c static struct clk_hw *bcm2835_register_pll(struct bcm2835_cprman *cprman, cprman 1308 drivers/clk/bcm/clk-bcm2835.c init.parent_names = &cprman->real_parent_names[0]; cprman 1318 drivers/clk/bcm/clk-bcm2835.c pll->cprman = cprman; cprman 1322 drivers/clk/bcm/clk-bcm2835.c ret = devm_clk_hw_register(cprman->dev, &pll->hw); cprman 1329 drivers/clk/bcm/clk-bcm2835.c bcm2835_register_pll_divider(struct bcm2835_cprman *cprman, cprman 1338 drivers/clk/bcm/clk-bcm2835.c divider_name = devm_kasprintf(cprman->dev, GFP_KERNEL, cprman 1354 drivers/clk/bcm/clk-bcm2835.c divider = devm_kzalloc(cprman->dev, sizeof(*divider), GFP_KERNEL); cprman 1358 drivers/clk/bcm/clk-bcm2835.c divider->div.reg = cprman->regs + data->a2w_reg; cprman 1362 drivers/clk/bcm/clk-bcm2835.c divider->div.lock = &cprman->regs_lock; cprman 1366 drivers/clk/bcm/clk-bcm2835.c divider->cprman = cprman; cprman 1369 drivers/clk/bcm/clk-bcm2835.c ret = devm_clk_hw_register(cprman->dev, ÷r->div.hw); cprman 1378 drivers/clk/bcm/clk-bcm2835.c return clk_hw_register_fixed_factor(cprman->dev, data->name, cprman 1388 drivers/clk/bcm/clk-bcm2835.c static struct clk_hw *bcm2835_register_clock(struct bcm2835_cprman *cprman, cprman 1408 drivers/clk/bcm/clk-bcm2835.c parents[i] = cprman->real_parent_names[ret]; cprman 1433 drivers/clk/bcm/clk-bcm2835.c if (!(cprman_read(cprman, data->ctl_reg) & CM_ENABLE)) cprman 1437 drivers/clk/bcm/clk-bcm2835.c clock = devm_kzalloc(cprman->dev, sizeof(*clock), GFP_KERNEL); cprman 1441 drivers/clk/bcm/clk-bcm2835.c clock->cprman = cprman; cprman 1445 drivers/clk/bcm/clk-bcm2835.c ret = devm_clk_hw_register(cprman->dev, &clock->hw); cprman 1451 drivers/clk/bcm/clk-bcm2835.c static struct clk *bcm2835_register_gate(struct bcm2835_cprman *cprman, cprman 1454 drivers/clk/bcm/clk-bcm2835.c return clk_register_gate(cprman->dev, data->name, data->parent, cprman 1456 drivers/clk/bcm/clk-bcm2835.c cprman->regs + data->ctl_reg, cprman 1457 drivers/clk/bcm/clk-bcm2835.c CM_GATE_BIT, 0, &cprman->regs_lock); cprman 2194 drivers/clk/bcm/clk-bcm2835.c struct bcm2835_cprman *cprman; cprman 2206 drivers/clk/bcm/clk-bcm2835.c cprman = devm_kzalloc(dev, cprman 2207 drivers/clk/bcm/clk-bcm2835.c struct_size(cprman, onecell.hws, asize), cprman 2209 drivers/clk/bcm/clk-bcm2835.c if (!cprman) cprman 2212 drivers/clk/bcm/clk-bcm2835.c spin_lock_init(&cprman->regs_lock); cprman 2213 drivers/clk/bcm/clk-bcm2835.c cprman->dev = dev; cprman 2215 drivers/clk/bcm/clk-bcm2835.c cprman->regs = devm_ioremap_resource(dev, res); cprman 2216 drivers/clk/bcm/clk-bcm2835.c if (IS_ERR(cprman->regs)) cprman 2217 drivers/clk/bcm/clk-bcm2835.c return PTR_ERR(cprman->regs); cprman 2219 drivers/clk/bcm/clk-bcm2835.c memcpy(cprman->real_parent_names, cprman_parent_names, cprman 2221 drivers/clk/bcm/clk-bcm2835.c of_clk_parent_fill(dev->of_node, cprman->real_parent_names, cprman 2231 drivers/clk/bcm/clk-bcm2835.c if (!cprman->real_parent_names[0]) cprman 2234 drivers/clk/bcm/clk-bcm2835.c platform_set_drvdata(pdev, cprman); cprman 2236 drivers/clk/bcm/clk-bcm2835.c cprman->onecell.num = asize; cprman 2237 drivers/clk/bcm/clk-bcm2835.c hws = cprman->onecell.hws; cprman 2243 drivers/clk/bcm/clk-bcm2835.c hws[i] = desc->clk_register(cprman, desc->data); cprman 2252 drivers/clk/bcm/clk-bcm2835.c &cprman->onecell);