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