Lines Matching refs:softrst

26 	struct rockchip_softrst *softrst = container_of(rcdev,  in rockchip_softrst_assert()  local
31 if (softrst->lut) in rockchip_softrst_assert()
32 id = softrst->lut[id]; in rockchip_softrst_assert()
34 bank = id / softrst->num_per_reg; in rockchip_softrst_assert()
35 offset = id % softrst->num_per_reg; in rockchip_softrst_assert()
37 if (softrst->flags & ROCKCHIP_SOFTRST_HIWORD_MASK) { in rockchip_softrst_assert()
39 softrst->reg_base + (bank * 4)); in rockchip_softrst_assert()
44 spin_lock_irqsave(&softrst->lock, flags); in rockchip_softrst_assert()
46 reg = readl(softrst->reg_base + (bank * 4)); in rockchip_softrst_assert()
47 writel(reg | BIT(offset), softrst->reg_base + (bank * 4)); in rockchip_softrst_assert()
49 spin_unlock_irqrestore(&softrst->lock, flags); in rockchip_softrst_assert()
58 struct rockchip_softrst *softrst = container_of(rcdev, in rockchip_softrst_deassert() local
63 if (softrst->lut) in rockchip_softrst_deassert()
64 id = softrst->lut[id]; in rockchip_softrst_deassert()
66 bank = id / softrst->num_per_reg; in rockchip_softrst_deassert()
67 offset = id % softrst->num_per_reg; in rockchip_softrst_deassert()
69 if (softrst->flags & ROCKCHIP_SOFTRST_HIWORD_MASK) { in rockchip_softrst_deassert()
70 writel((BIT(offset) << 16), softrst->reg_base + (bank * 4)); in rockchip_softrst_deassert()
75 spin_lock_irqsave(&softrst->lock, flags); in rockchip_softrst_deassert()
77 reg = readl(softrst->reg_base + (bank * 4)); in rockchip_softrst_deassert()
78 writel(reg & ~BIT(offset), softrst->reg_base + (bank * 4)); in rockchip_softrst_deassert()
80 spin_unlock_irqrestore(&softrst->lock, flags); in rockchip_softrst_deassert()
96 struct rockchip_softrst *softrst; in rockchip_register_softrst_lut() local
99 softrst = kzalloc(sizeof(*softrst), GFP_KERNEL); in rockchip_register_softrst_lut()
100 if (!softrst) in rockchip_register_softrst_lut()
103 spin_lock_init(&softrst->lock); in rockchip_register_softrst_lut()
105 softrst->reg_base = base; in rockchip_register_softrst_lut()
106 softrst->lut = lookup_table; in rockchip_register_softrst_lut()
107 softrst->flags = flags; in rockchip_register_softrst_lut()
108 softrst->num_regs = num_regs; in rockchip_register_softrst_lut()
109 softrst->num_per_reg = (flags & ROCKCHIP_SOFTRST_HIWORD_MASK) ? 16 in rockchip_register_softrst_lut()
112 softrst->rcdev.owner = THIS_MODULE; in rockchip_register_softrst_lut()
114 softrst->rcdev.nr_resets = num_regs; in rockchip_register_softrst_lut()
116 softrst->rcdev.nr_resets = num_regs * softrst->num_per_reg; in rockchip_register_softrst_lut()
117 softrst->rcdev.ops = &rockchip_softrst_ops; in rockchip_register_softrst_lut()
118 softrst->rcdev.of_node = np; in rockchip_register_softrst_lut()
119 ret = reset_controller_register(&softrst->rcdev); in rockchip_register_softrst_lut()
123 kfree(softrst); in rockchip_register_softrst_lut()