Lines Matching +full:detector +full:- +full:enable
1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2013-2015 Ideas on Board
6 * Copyright (C) 2013-2015 Xilinx, Inc.
18 #include "xilinx-vip.h"
19 #include "xilinx-vtc.h"
66 * The following registers exist in two blocks, one at 0x0020 for the detector
145 * struct xvtc_device - Xilinx Video Timing Controller device structure
148 * @has_detector: the VTC has a timing detector
167 xvip_write(&xvtc->xvip, XVTC_GENERATOR_OFFSET + addr, value); in xvtc_gen_write()
170 /* -----------------------------------------------------------------------------
179 if (!xvtc->has_generator) in xvtc_generator_start()
180 return -ENXIO; in xvtc_generator_start()
182 ret = clk_prepare_enable(xvtc->xvip.clk); in xvtc_generator_start()
196 * AXI4-stream core. in xvtc_generator_start()
204 (config->vblank_start << XVTC_ACTIVE_VSIZE_SHIFT) | in xvtc_generator_start()
205 (config->hblank_start << XVTC_ACTIVE_HSIZE_SHIFT)); 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()
209 (config->hsync_end << XVTC_HSYNC_END_SHIFT) | in xvtc_generator_start()
210 (config->hsync_start << XVTC_HSYNC_START_SHIFT)); in xvtc_generator_start()
213 (config->vsync_end << XVTC_F0_VSYNC_VEND_SHIFT) | in xvtc_generator_start()
214 (config->vsync_start << XVTC_F0_VSYNC_VSTART_SHIFT)); in xvtc_generator_start()
217 /* Enable the generator. Set the source of all generator parameters to in xvtc_generator_start()
220 xvip_write(&xvtc->xvip, XVIP_CTRL_CONTROL, in xvtc_generator_start()
240 if (!xvtc->has_generator) in xvtc_generator_stop()
241 return -ENXIO; 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()
262 return ERR_PTR(-EINVAL); in xvtc_of_get()
266 if (xvtc->xvip.dev->of_node == xvtc_node) { in xvtc_of_get()
276 return ERR_PTR(-EPROBE_DEFER); in xvtc_of_get()
287 /* -----------------------------------------------------------------------------
294 list_add_tail(&xvtc->list, &xvtc_list); in xvtc_register_device()
301 list_del(&xvtc->list); in xvtc_unregister_device()
305 /* -----------------------------------------------------------------------------
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()
324 xvtc = devm_kzalloc(&pdev->dev, sizeof(*xvtc), GFP_KERNEL); in xvtc_probe()
326 return -ENOMEM; in xvtc_probe()
328 xvtc->xvip.dev = &pdev->dev; in xvtc_probe()
334 ret = xvip_init_resources(&xvtc->xvip); in xvtc_probe()
340 xvip_print_version(&xvtc->xvip); in xvtc_probe()
353 xvip_cleanup_resources(&xvtc->xvip); in xvtc_remove()
359 { .compatible = "xlnx,v-tc-6.1" },
366 .name = "xilinx-vtc",