/* * Copyright (C) 2015 Industrial Research Institute for Automation * and Measurements PIAP * * Written by Krzysztof Ha?asa. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License * as published by the Free Software Foundation. */ #include <linux/delay.h> #include <linux/freezer.h> #include <linux/interrupt.h> #include <linux/kthread.h> #include <linux/mutex.h> #include <linux/pci.h> #include <media/videobuf2-dma-sg.h> #include <linux/videodev2.h> #include <media/v4l2-common.h> #include <media/v4l2-ctrls.h> #include <media/v4l2-device.h> #include <media/v4l2-ioctl.h> #define TYPE_MAX_CHANNELS 0x0F #define TYPE_SECOND_GEN 0x10 struct tw686x_format { char *name; unsigned int fourcc; unsigned int depth; unsigned int mode; }; struct dma_desc { dma_addr_t phys; void *virt; unsigned int size; }; struct vdma_desc { __le32 flags_length; /* 3 MSBits for flags, 13 LSBits for length */ __le32 phys; }; struct tw686x_vb2_buf { struct vb2_v4l2_buffer vb; struct list_head list; }; struct tw686x_video_channel { struct tw686x_dev *dev; struct vb2_queue vidq; struct list_head vidq_queued; struct video_device *device; struct dma_desc sg_tables[2]; struct tw686x_vb2_buf *curr_bufs[2]; void *alloc_ctx; struct vdma_desc *sg_descs[2]; struct v4l2_ctrl_handler ctrl_handler; const struct tw686x_format *format; struct mutex vb_mutex; spinlock_t qlock; v4l2_std_id video_standard; unsigned int width, height; enum v4l2_field field; /* supported TOP, BOTTOM, SEQ_TB and SEQ_BT */ unsigned int seq; /* video field or frame counter */ unsigned int ch; }; /* global device status */ struct tw686x_dev { spinlock_t irq_lock; struct v4l2_device v4l2_dev; struct snd_card *card; /* sound card */ unsigned int video_active; /* active video channel mask */ char name[32]; unsigned int type; struct pci_dev *pci_dev; __u32 __iomem *mmio; struct task_struct *video_thread; wait_queue_head_t video_thread_wait; u32 dma_requests; struct tw686x_video_channel video_channels[0]; };
static inline uint32_t reg_read(struct tw686x_dev *dev, unsigned int reg) { return readl(dev->mmio + reg); }Contributors
Person | Tokens | Prop | Commits | CommitProp | |
krzysztof halasa | krzysztof halasa | 26 | 100.00% | 1 | 100.00% |
Total | 26 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
krzysztof halasa | krzysztof halasa | 30 | 100.00% | 1 | 100.00% |
Total | 30 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
krzysztof halasa | krzysztof halasa | 21 | 100.00% | 1 | 100.00% |
Total | 21 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
krzysztof halasa | krzysztof halasa | 21 | 100.00% | 1 | 100.00% |
Total | 21 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
krzysztof halasa | krzysztof halasa | 381 | 99.22% | 1 | 50.00% |
hans verkuil | hans verkuil | 3 | 0.78% | 1 | 50.00% |
Total | 384 | 100.00% | 2 | 100.00% |