Lines Matching refs:rstc
46 struct hisi_reset_controller *rstc = to_hisi_reset_controller(rcdev); in hisi_reset_assert() local
54 spin_lock_irqsave(&rstc->lock, flags); in hisi_reset_assert()
56 reg = readl(rstc->membase + offset); in hisi_reset_assert()
57 writel(reg | BIT(bit), rstc->membase + offset); in hisi_reset_assert()
59 spin_unlock_irqrestore(&rstc->lock, flags); in hisi_reset_assert()
67 struct hisi_reset_controller *rstc = to_hisi_reset_controller(rcdev); in hisi_reset_deassert() local
75 spin_lock_irqsave(&rstc->lock, flags); in hisi_reset_deassert()
77 reg = readl(rstc->membase + offset); in hisi_reset_deassert()
78 writel(reg & ~BIT(bit), rstc->membase + offset); in hisi_reset_deassert()
80 spin_unlock_irqrestore(&rstc->lock, flags); in hisi_reset_deassert()
92 struct hisi_reset_controller *rstc; in hisi_reset_init() local
94 rstc = devm_kmalloc(&pdev->dev, sizeof(*rstc), GFP_KERNEL); in hisi_reset_init()
95 if (!rstc) in hisi_reset_init()
98 rstc->membase = devm_platform_ioremap_resource(pdev, 0); in hisi_reset_init()
99 if (IS_ERR(rstc->membase)) in hisi_reset_init()
102 spin_lock_init(&rstc->lock); in hisi_reset_init()
103 rstc->rcdev.owner = THIS_MODULE; in hisi_reset_init()
104 rstc->rcdev.ops = &hisi_reset_ops; in hisi_reset_init()
105 rstc->rcdev.of_node = pdev->dev.of_node; in hisi_reset_init()
106 rstc->rcdev.of_reset_n_cells = 2; in hisi_reset_init()
107 rstc->rcdev.of_xlate = hisi_reset_of_xlate; in hisi_reset_init()
108 reset_controller_register(&rstc->rcdev); in hisi_reset_init()
110 return rstc; in hisi_reset_init()
114 void hisi_reset_exit(struct hisi_reset_controller *rstc) in hisi_reset_exit() argument
116 reset_controller_unregister(&rstc->rcdev); in hisi_reset_exit()