Lines Matching refs:xvtc

168 static inline void xvtc_gen_write(struct xvtc_device *xvtc, u32 addr, u32 value)  in xvtc_gen_write()  argument
170 xvip_write(&xvtc->xvip, XVTC_GENERATOR_OFFSET + addr, value); in xvtc_gen_write()
177 int xvtc_generator_start(struct xvtc_device *xvtc, in xvtc_generator_start() argument
182 if (!xvtc->has_generator) in xvtc_generator_start()
185 ret = clk_prepare_enable(xvtc->xvip.clk); in xvtc_generator_start()
192 xvtc_gen_write(xvtc, XVTC_POLARITY, in xvtc_generator_start()
201 xvtc_gen_write(xvtc, XVTC_ENCODING, 0); in xvtc_generator_start()
206 xvtc_gen_write(xvtc, XVTC_ACTIVE_SIZE, in xvtc_generator_start()
209 xvtc_gen_write(xvtc, XVTC_HSIZE, config->hsize); in xvtc_generator_start()
210 xvtc_gen_write(xvtc, XVTC_VSIZE, config->vsize); in xvtc_generator_start()
211 xvtc_gen_write(xvtc, XVTC_HSYNC, in xvtc_generator_start()
214 xvtc_gen_write(xvtc, XVTC_F0_VBLANK_H, 0); in xvtc_generator_start()
215 xvtc_gen_write(xvtc, XVTC_F0_VSYNC_V, in xvtc_generator_start()
218 xvtc_gen_write(xvtc, XVTC_F0_VSYNC_H, 0); in xvtc_generator_start()
223 xvip_write(&xvtc->xvip, XVIP_CTRL_CONTROL, in xvtc_generator_start()
241 int xvtc_generator_stop(struct xvtc_device *xvtc) in xvtc_generator_stop() argument
243 if (!xvtc->has_generator) in xvtc_generator_stop()
246 xvip_write(&xvtc->xvip, XVIP_CTRL_CONTROL, 0); in xvtc_generator_stop()
248 clk_disable_unprepare(xvtc->xvip.clk); in xvtc_generator_stop()
258 struct xvtc_device *xvtc; in xvtc_of_get() local
268 list_for_each_entry(xvtc, &xvtc_list, list) { in xvtc_of_get()
269 if (xvtc->xvip.dev->of_node == xvtc_node) { in xvtc_of_get()
270 found = xvtc; in xvtc_of_get()
285 void xvtc_put(struct xvtc_device *xvtc) in xvtc_put() argument
294 static void xvtc_register_device(struct xvtc_device *xvtc) in xvtc_register_device() argument
297 list_add_tail(&xvtc->list, &xvtc_list); in xvtc_register_device()
301 static void xvtc_unregister_device(struct xvtc_device *xvtc) in xvtc_unregister_device() argument
304 list_del(&xvtc->list); in xvtc_unregister_device()
312 static int xvtc_parse_of(struct xvtc_device *xvtc) in xvtc_parse_of() argument
314 struct device_node *node = xvtc->xvip.dev->of_node; in xvtc_parse_of()
316 xvtc->has_detector = of_property_read_bool(node, "xlnx,detector"); in xvtc_parse_of()
317 xvtc->has_generator = of_property_read_bool(node, "xlnx,generator"); in xvtc_parse_of()
324 struct xvtc_device *xvtc; in xvtc_probe() local
327 xvtc = devm_kzalloc(&pdev->dev, sizeof(*xvtc), GFP_KERNEL); in xvtc_probe()
328 if (!xvtc) in xvtc_probe()
331 xvtc->xvip.dev = &pdev->dev; in xvtc_probe()
333 ret = xvtc_parse_of(xvtc); in xvtc_probe()
337 ret = xvip_init_resources(&xvtc->xvip); in xvtc_probe()
341 platform_set_drvdata(pdev, xvtc); in xvtc_probe()
343 xvip_print_version(&xvtc->xvip); in xvtc_probe()
345 xvtc_register_device(xvtc); in xvtc_probe()
352 struct xvtc_device *xvtc = platform_get_drvdata(pdev); in xvtc_remove() local
354 xvtc_unregister_device(xvtc); in xvtc_remove()
356 xvip_cleanup_resources(&xvtc->xvip); in xvtc_remove()