Lines Matching refs:xvtc

165 static inline void xvtc_gen_write(struct xvtc_device *xvtc, u32 addr, u32 value)  in xvtc_gen_write()  argument
167 xvip_write(&xvtc->xvip, XVTC_GENERATOR_OFFSET + addr, value); in xvtc_gen_write()
174 int xvtc_generator_start(struct xvtc_device *xvtc, in xvtc_generator_start() argument
179 if (!xvtc->has_generator) in xvtc_generator_start()
182 ret = clk_prepare_enable(xvtc->xvip.clk); in xvtc_generator_start()
189 xvtc_gen_write(xvtc, XVTC_POLARITY, in xvtc_generator_start()
198 xvtc_gen_write(xvtc, XVTC_ENCODING, 0); in xvtc_generator_start()
203 xvtc_gen_write(xvtc, XVTC_ACTIVE_SIZE, in xvtc_generator_start()
206 xvtc_gen_write(xvtc, XVTC_HSIZE, config->hsize); in xvtc_generator_start()
207 xvtc_gen_write(xvtc, XVTC_VSIZE, config->vsize); in xvtc_generator_start()
208 xvtc_gen_write(xvtc, XVTC_HSYNC, in xvtc_generator_start()
211 xvtc_gen_write(xvtc, XVTC_F0_VBLANK_H, 0); in xvtc_generator_start()
212 xvtc_gen_write(xvtc, XVTC_F0_VSYNC_V, in xvtc_generator_start()
215 xvtc_gen_write(xvtc, XVTC_F0_VSYNC_H, 0); in xvtc_generator_start()
220 xvip_write(&xvtc->xvip, XVIP_CTRL_CONTROL, in xvtc_generator_start()
238 int xvtc_generator_stop(struct xvtc_device *xvtc) in xvtc_generator_stop() argument
240 if (!xvtc->has_generator) in xvtc_generator_stop()
243 xvip_write(&xvtc->xvip, XVIP_CTRL_CONTROL, 0); in xvtc_generator_stop()
245 clk_disable_unprepare(xvtc->xvip.clk); in xvtc_generator_stop()
255 struct xvtc_device *xvtc; in xvtc_of_get() local
265 list_for_each_entry(xvtc, &xvtc_list, list) { in xvtc_of_get()
266 if (xvtc->xvip.dev->of_node == xvtc_node) { in xvtc_of_get()
267 found = xvtc; in xvtc_of_get()
282 void xvtc_put(struct xvtc_device *xvtc) in xvtc_put() argument
291 static void xvtc_register_device(struct xvtc_device *xvtc) in xvtc_register_device() argument
294 list_add_tail(&xvtc->list, &xvtc_list); in xvtc_register_device()
298 static void xvtc_unregister_device(struct xvtc_device *xvtc) in xvtc_unregister_device() argument
301 list_del(&xvtc->list); in xvtc_unregister_device()
309 static int xvtc_parse_of(struct xvtc_device *xvtc) in xvtc_parse_of() argument
311 struct device_node *node = xvtc->xvip.dev->of_node; in xvtc_parse_of()
313 xvtc->has_detector = of_property_read_bool(node, "xlnx,detector"); in xvtc_parse_of()
314 xvtc->has_generator = of_property_read_bool(node, "xlnx,generator"); in xvtc_parse_of()
321 struct xvtc_device *xvtc; in xvtc_probe() local
324 xvtc = devm_kzalloc(&pdev->dev, sizeof(*xvtc), GFP_KERNEL); in xvtc_probe()
325 if (!xvtc) in xvtc_probe()
328 xvtc->xvip.dev = &pdev->dev; in xvtc_probe()
330 ret = xvtc_parse_of(xvtc); in xvtc_probe()
334 ret = xvip_init_resources(&xvtc->xvip); in xvtc_probe()
338 platform_set_drvdata(pdev, xvtc); in xvtc_probe()
340 xvip_print_version(&xvtc->xvip); in xvtc_probe()
342 xvtc_register_device(xvtc); in xvtc_probe()
349 struct xvtc_device *xvtc = platform_get_drvdata(pdev); in xvtc_remove() local
351 xvtc_unregister_device(xvtc); in xvtc_remove()
353 xvip_cleanup_resources(&xvtc->xvip); in xvtc_remove()