Lines Matching refs:vtg

154 static void vtg_reset(struct sti_vtg *vtg)  in vtg_reset()  argument
156 writel(1, vtg->regs + VTG_DRST_AUTOC); in vtg_reset()
238 static void vtg_set_mode(struct sti_vtg *vtg, in vtg_set_mode() argument
246 writel(mode->htotal, vtg->regs + VTG_CLKLN); in vtg_set_mode()
249 writel(mode->vtotal * 2, vtg->regs + VTG_HLFLN); in vtg_set_mode()
252 vtg_set_output_window(vtg->regs, mode); in vtg_set_mode()
269 vtg->regs + vtg_regs_offs[i].h_hd); in vtg_set_mode()
271 vtg->regs + vtg_regs_offs[i].top_v_vd); in vtg_set_mode()
273 vtg->regs + vtg_regs_offs[i].bot_v_vd); in vtg_set_mode()
275 vtg->regs + vtg_regs_offs[i].top_v_hd); in vtg_set_mode()
277 vtg->regs + vtg_regs_offs[i].bot_v_hd); in vtg_set_mode()
281 writel(type, vtg->regs + VTG_MODE); in vtg_set_mode()
284 static void vtg_enable_irq(struct sti_vtg *vtg) in vtg_enable_irq() argument
287 writel(0xFFFF, vtg->regs + VTG_HOST_ITS_BCLR); in vtg_enable_irq()
288 writel(0xFFFF, vtg->regs + VTG_HOST_ITM_BCLR); in vtg_enable_irq()
289 writel(VTG_IRQ_MASK, vtg->regs + VTG_HOST_ITM_BSET); in vtg_enable_irq()
292 void sti_vtg_set_config(struct sti_vtg *vtg, in sti_vtg_set_config() argument
296 vtg_set_mode(vtg, VTG_MODE_MASTER, vtg->sync_params, mode); in sti_vtg_set_config()
298 vtg_reset(vtg); in sti_vtg_set_config()
300 vtg_enable_irq(vtg); in sti_vtg_set_config()
340 int sti_vtg_register_client(struct sti_vtg *vtg, struct notifier_block *nb, in sti_vtg_register_client() argument
343 vtg->crtc = crtc; in sti_vtg_register_client()
344 return raw_notifier_chain_register(&vtg->notifier_list, nb); in sti_vtg_register_client()
347 int sti_vtg_unregister_client(struct sti_vtg *vtg, struct notifier_block *nb) in sti_vtg_unregister_client() argument
349 return raw_notifier_chain_unregister(&vtg->notifier_list, nb); in sti_vtg_unregister_client()
354 struct sti_vtg *vtg = arg; in vtg_irq_thread() local
357 event = (vtg->irq_status & VTG_IRQ_TOP) ? in vtg_irq_thread()
360 raw_notifier_call_chain(&vtg->notifier_list, event, vtg->crtc); in vtg_irq_thread()
367 struct sti_vtg *vtg = arg; in vtg_irq() local
369 vtg->irq_status = readl(vtg->regs + VTG_HOST_ITS); in vtg_irq()
371 writel(vtg->irq_status, vtg->regs + VTG_HOST_ITS_BCLR); in vtg_irq()
374 readl(vtg->regs + VTG_HOST_ITS); in vtg_irq()
382 struct sti_vtg *vtg; in vtg_probe() local
386 vtg = devm_kzalloc(dev, sizeof(*vtg), GFP_KERNEL); in vtg_probe()
387 if (!vtg) in vtg_probe()
396 vtg->regs = devm_ioremap(dev, res->start, resource_size(res)); in vtg_probe()
397 if (!vtg->regs) { in vtg_probe()
402 vtg->irq = platform_get_irq(pdev, 0); in vtg_probe()
403 if (vtg->irq < 0) { in vtg_probe()
405 return vtg->irq; in vtg_probe()
408 RAW_INIT_NOTIFIER_HEAD(&vtg->notifier_list); in vtg_probe()
410 ret = devm_request_threaded_irq(dev, vtg->irq, vtg_irq, in vtg_probe()
412 dev_name(dev), vtg); in vtg_probe()
418 platform_set_drvdata(pdev, vtg); in vtg_probe()