Lines Matching full:arb

13 #include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h>
64 struct meson_audio_arb_data *arb = in meson_audio_arb_update() local
67 spin_lock(&arb->lock); in meson_audio_arb_update()
68 val = readl(arb->regs); in meson_audio_arb_update()
71 val &= ~BIT(arb->reset_bits[id]); in meson_audio_arb_update()
73 val |= BIT(arb->reset_bits[id]); in meson_audio_arb_update()
75 writel(val, arb->regs); in meson_audio_arb_update()
76 spin_unlock(&arb->lock); in meson_audio_arb_update()
85 struct meson_audio_arb_data *arb = in meson_audio_arb_status() local
88 val = readl(arb->regs); in meson_audio_arb_status()
90 return !(val & BIT(arb->reset_bits[id])); in meson_audio_arb_status()
113 .compatible = "amlogic,meson-axg-audio-arb",
116 .compatible = "amlogic,meson-sm1-audio-arb",
125 struct meson_audio_arb_data *arb = platform_get_drvdata(pdev); in meson_audio_arb_remove() local
128 spin_lock(&arb->lock); in meson_audio_arb_remove()
129 writel(0, arb->regs); in meson_audio_arb_remove()
130 spin_unlock(&arb->lock); in meson_audio_arb_remove()
137 struct meson_audio_arb_data *arb; in meson_audio_arb_probe() local
144 arb = devm_kzalloc(dev, sizeof(*arb), GFP_KERNEL); in meson_audio_arb_probe()
145 if (!arb) in meson_audio_arb_probe()
147 platform_set_drvdata(pdev, arb); in meson_audio_arb_probe()
149 arb->clk = devm_clk_get_enabled(dev, NULL); in meson_audio_arb_probe()
150 if (IS_ERR(arb->clk)) in meson_audio_arb_probe()
151 return dev_err_probe(dev, PTR_ERR(arb->clk), "failed to get clock\n"); in meson_audio_arb_probe()
153 arb->regs = devm_platform_ioremap_resource(pdev, 0); in meson_audio_arb_probe()
154 if (IS_ERR(arb->regs)) in meson_audio_arb_probe()
155 return PTR_ERR(arb->regs); in meson_audio_arb_probe()
157 spin_lock_init(&arb->lock); in meson_audio_arb_probe()
158 arb->reset_bits = data->reset_bits; in meson_audio_arb_probe()
159 arb->rstc.nr_resets = data->reset_num; in meson_audio_arb_probe()
160 arb->rstc.ops = &meson_audio_arb_rstc_ops; in meson_audio_arb_probe()
161 arb->rstc.of_node = dev->of_node; in meson_audio_arb_probe()
162 arb->rstc.owner = THIS_MODULE; in meson_audio_arb_probe()
169 writel(BIT(ARB_GENERAL_BIT), arb->regs); in meson_audio_arb_probe()
172 ret = devm_reset_controller_register(dev, &arb->rstc); in meson_audio_arb_probe()
174 dev_err(dev, "failed to register arb reset controller\n"); in meson_audio_arb_probe()
185 .name = "meson-audio-arb-reset",