Lines Matching refs:softrst
25 struct rockchip_softrst *softrst = container_of(rcdev, in rockchip_softrst_assert() local
28 int bank = id / softrst->num_per_reg; in rockchip_softrst_assert()
29 int offset = id % softrst->num_per_reg; in rockchip_softrst_assert()
31 if (softrst->flags & ROCKCHIP_SOFTRST_HIWORD_MASK) { in rockchip_softrst_assert()
33 softrst->reg_base + (bank * 4)); in rockchip_softrst_assert()
38 spin_lock_irqsave(&softrst->lock, flags); in rockchip_softrst_assert()
40 reg = readl(softrst->reg_base + (bank * 4)); in rockchip_softrst_assert()
41 writel(reg | BIT(offset), softrst->reg_base + (bank * 4)); in rockchip_softrst_assert()
43 spin_unlock_irqrestore(&softrst->lock, flags); in rockchip_softrst_assert()
52 struct rockchip_softrst *softrst = container_of(rcdev, in rockchip_softrst_deassert() local
55 int bank = id / softrst->num_per_reg; in rockchip_softrst_deassert()
56 int offset = id % softrst->num_per_reg; in rockchip_softrst_deassert()
58 if (softrst->flags & ROCKCHIP_SOFTRST_HIWORD_MASK) { in rockchip_softrst_deassert()
59 writel((BIT(offset) << 16), softrst->reg_base + (bank * 4)); in rockchip_softrst_deassert()
64 spin_lock_irqsave(&softrst->lock, flags); in rockchip_softrst_deassert()
66 reg = readl(softrst->reg_base + (bank * 4)); in rockchip_softrst_deassert()
67 writel(reg & ~BIT(offset), softrst->reg_base + (bank * 4)); in rockchip_softrst_deassert()
69 spin_unlock_irqrestore(&softrst->lock, flags); in rockchip_softrst_deassert()
84 struct rockchip_softrst *softrst; in rockchip_register_softrst() local
87 softrst = kzalloc(sizeof(*softrst), GFP_KERNEL); in rockchip_register_softrst()
88 if (!softrst) in rockchip_register_softrst()
91 spin_lock_init(&softrst->lock); in rockchip_register_softrst()
93 softrst->reg_base = base; in rockchip_register_softrst()
94 softrst->flags = flags; in rockchip_register_softrst()
95 softrst->num_regs = num_regs; in rockchip_register_softrst()
96 softrst->num_per_reg = (flags & ROCKCHIP_SOFTRST_HIWORD_MASK) ? 16 in rockchip_register_softrst()
99 softrst->rcdev.owner = THIS_MODULE; in rockchip_register_softrst()
100 softrst->rcdev.nr_resets = num_regs * softrst->num_per_reg; in rockchip_register_softrst()
101 softrst->rcdev.ops = &rockchip_softrst_ops; in rockchip_register_softrst()
102 softrst->rcdev.of_node = np; in rockchip_register_softrst()
103 ret = reset_controller_register(&softrst->rcdev); in rockchip_register_softrst()
107 kfree(softrst); in rockchip_register_softrst()