Lines Matching +full:video +full:- +full:related

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2021-2023 Digiteq Automotive
7 * for event triggers that can be used to record events related to the video
10 * clock source as the video frames.
37 return -EBUSY; in trigger_read_raw()
38 *val = mgb4_read_reg(&st->mgbdev->video, 0xA0); in trigger_read_raw()
43 return -EINVAL; in trigger_read_raw()
50 int irq = xdma_get_user_irq(st->mgbdev->xdev, 11); in trigger_set_state()
53 xdma_enable_user_irq(st->mgbdev->xdev, irq); in trigger_set_state()
55 xdma_disable_user_irq(st->mgbdev->xdev, irq); in trigger_set_state()
89 struct iio_dev *indio_dev = pf->indio_dev; in trigger_handler()
96 scan.data = mgb4_read_reg(&st->mgbdev->video, 0xA0); in trigger_handler()
97 mgb4_write_reg(&st->mgbdev->video, 0xA0, scan.data); in trigger_handler()
99 iio_push_to_buffers_with_timestamp(indio_dev, &scan, pf->timestamp); in trigger_handler()
100 iio_trigger_notify_done(indio_dev->trig); in trigger_handler()
102 mgb4_write_reg(&st->mgbdev->video, 0xB4, 1U << 11); in trigger_handler()
112 st->trig = iio_trigger_alloc(&st->mgbdev->pdev->dev, "%s-dev%d", in probe_trigger()
113 indio_dev->name, iio_device_id(indio_dev)); in probe_trigger()
114 if (!st->trig) in probe_trigger()
115 return -ENOMEM; in probe_trigger()
118 "mgb4-trigger", st->trig); in probe_trigger()
122 st->trig->ops = &trigger_ops; in probe_trigger()
123 iio_trigger_set_drvdata(st->trig, indio_dev); in probe_trigger()
124 ret = iio_trigger_register(st->trig); in probe_trigger()
128 indio_dev->trig = iio_trigger_get(st->trig); in probe_trigger()
133 free_irq(irq, st->trig); in probe_trigger()
135 iio_trigger_free(st->trig); in probe_trigger()
144 iio_trigger_unregister(st->trig); in remove_trigger()
145 free_irq(irq, st->trig); in remove_trigger()
146 iio_trigger_free(st->trig); in remove_trigger()
153 struct pci_dev *pdev = mgbdev->pdev; in mgb4_trigger_create()
154 struct device *dev = &pdev->dev; in mgb4_trigger_create()
161 indio_dev->info = &trigger_info; in mgb4_trigger_create()
162 indio_dev->name = "mgb4"; in mgb4_trigger_create()
163 indio_dev->modes = INDIO_DIRECT_MODE; in mgb4_trigger_create()
164 indio_dev->channels = trigger_channels; in mgb4_trigger_create()
165 indio_dev->num_channels = ARRAY_SIZE(trigger_channels); in mgb4_trigger_create()
168 data->mgbdev = mgbdev; in mgb4_trigger_create()
170 irq = xdma_get_user_irq(mgbdev->xdev, 11); in mgb4_trigger_create()
206 remove_trigger(indio_dev, xdma_get_user_irq(st->mgbdev->xdev, 11)); in mgb4_trigger_free()