• Home
  • Raw
  • Download

Lines Matching refs:mmsys

181 static int mtk_mmsys_find_match_drvdata(struct mtk_mmsys *mmsys,  in mtk_mmsys_find_match_drvdata()  argument
187 if (mmsys->io_start == match->drv_data[i]->io_start) in mtk_mmsys_find_match_drvdata()
197 struct mtk_mmsys *mmsys = dev_get_drvdata(dev); in mtk_mmsys_ddp_connect() local
198 const struct mtk_mmsys_routes *routes = mmsys->data->routes; in mtk_mmsys_ddp_connect()
202 for (i = 0; i < mmsys->data->num_routes; i++) in mtk_mmsys_ddp_connect()
204 reg = readl_relaxed(mmsys->regs + routes[i].addr); in mtk_mmsys_ddp_connect()
207 writel_relaxed(reg, mmsys->regs + routes[i].addr); in mtk_mmsys_ddp_connect()
216 struct mtk_mmsys *mmsys = dev_get_drvdata(dev); in mtk_mmsys_ddp_disconnect() local
217 const struct mtk_mmsys_routes *routes = mmsys->data->routes; in mtk_mmsys_ddp_disconnect()
221 for (i = 0; i < mmsys->data->num_routes; i++) in mtk_mmsys_ddp_disconnect()
223 reg = readl_relaxed(mmsys->regs + routes[i].addr); in mtk_mmsys_ddp_disconnect()
225 writel_relaxed(reg, mmsys->regs + routes[i].addr); in mtk_mmsys_ddp_disconnect()
230 static void mtk_mmsys_update_bits(struct mtk_mmsys *mmsys, u32 offset, u32 mask, u32 val) in mtk_mmsys_update_bits() argument
234 tmp = readl_relaxed(mmsys->regs + offset); in mtk_mmsys_update_bits()
236 writel_relaxed(tmp, mmsys->regs + offset); in mtk_mmsys_update_bits()
253 struct mtk_mmsys *mmsys = container_of(rcdev, struct mtk_mmsys, rcdev); in mtk_mmsys_reset_update() local
257 spin_lock_irqsave(&mmsys->lock, flags); in mtk_mmsys_reset_update()
259 reg = readl_relaxed(mmsys->regs + mmsys->data->sw0_rst_offset); in mtk_mmsys_reset_update()
266 writel_relaxed(reg, mmsys->regs + mmsys->data->sw0_rst_offset); in mtk_mmsys_reset_update()
268 spin_unlock_irqrestore(&mmsys->lock, flags); in mtk_mmsys_reset_update()
308 struct mtk_mmsys *mmsys; in mtk_mmsys_probe() local
312 mmsys = devm_kzalloc(dev, sizeof(*mmsys), GFP_KERNEL); in mtk_mmsys_probe()
313 if (!mmsys) in mtk_mmsys_probe()
316 mmsys->regs = devm_platform_ioremap_resource(pdev, 0); in mtk_mmsys_probe()
317 if (IS_ERR(mmsys->regs)) { in mtk_mmsys_probe()
318 ret = PTR_ERR(mmsys->regs); in mtk_mmsys_probe()
323 spin_lock_init(&mmsys->lock); in mtk_mmsys_probe()
325 mmsys->rcdev.owner = THIS_MODULE; in mtk_mmsys_probe()
326 mmsys->rcdev.nr_resets = 32; in mtk_mmsys_probe()
327 mmsys->rcdev.ops = &mtk_mmsys_reset_ops; in mtk_mmsys_probe()
328 mmsys->rcdev.of_node = pdev->dev.of_node; in mtk_mmsys_probe()
329 ret = devm_reset_controller_register(&pdev->dev, &mmsys->rcdev); in mtk_mmsys_probe()
340 mmsys->io_start = res->start; in mtk_mmsys_probe()
345 ret = mtk_mmsys_find_match_drvdata(mmsys, match_data); in mtk_mmsys_probe()
350 mmsys->data = match_data->drv_data[ret]; in mtk_mmsys_probe()
353 mmsys->data = match_data->drv_data[0]; in mtk_mmsys_probe()
356 platform_set_drvdata(pdev, mmsys); in mtk_mmsys_probe()
358 clks = platform_device_register_data(&pdev->dev, mmsys->data->clk_driver, in mtk_mmsys_probe()