blob: 4ab6586c0467529ea145452f2e534f30edeb2a73 [file] [log] [blame]
Ben Collinsfaa4fd22010-06-17 13:27:26 -04001/*
Hans Verkuildcae5da2013-03-25 05:35:17 -03002 * Copyright (C) 2010-2013 Bluecherry, LLC <http://www.bluecherrydvr.com>
3 *
4 * Original author:
5 * Ben Collins <bcollins@ubuntu.com>
6 *
7 * Additional work by:
8 * John Brooks <john.brooks@bluecherry.net>
Ben Collinsfaa4fd22010-06-17 13:27:26 -04009 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
Ben Collinsfaa4fd22010-06-17 13:27:26 -040019 */
20
Krzysztof Hałasadecebab2011-02-11 13:38:20 +010021#ifndef __SOLO6X10_H
22#define __SOLO6X10_H
Ben Collinsfaa4fd22010-06-17 13:27:26 -040023
Ben Collinsfaa4fd22010-06-17 13:27:26 -040024#include <linux/pci.h>
25#include <linux/i2c.h>
Ben Collinsfaa4fd22010-06-17 13:27:26 -040026#include <linux/mutex.h>
27#include <linux/list.h>
28#include <linux/wait.h>
Hans Verkuildcae5da2013-03-25 05:35:17 -030029#include <linux/stringify.h>
30#include <linux/io.h>
Arun Sharma600634972011-07-26 16:09:06 -070031#include <linux/atomic.h>
Hans Verkuildcae5da2013-03-25 05:35:17 -030032#include <linux/slab.h>
Ben Collinsfaa4fd22010-06-17 13:27:26 -040033#include <linux/videodev2.h>
Hans Verkuildcae5da2013-03-25 05:35:17 -030034
Ben Collinsfaa4fd22010-06-17 13:27:26 -040035#include <media/v4l2-dev.h>
Hans Verkuild9ebd622013-03-25 05:36:44 -030036#include <media/v4l2-device.h>
Hans Verkuilc813bd32013-03-25 05:38:14 -030037#include <media/v4l2-ctrls.h>
Junghak Sungc1399902015-09-22 10:30:29 -030038#include <media/videobuf2-v4l2.h>
Hans Verkuildcae5da2013-03-25 05:35:17 -030039
Hans Verkuildad7fab2013-03-25 05:42:46 -030040#include "solo6x10-regs.h"
Ben Collinsfaa4fd22010-06-17 13:27:26 -040041
42#ifndef PCI_VENDOR_ID_SOFTLOGIC
43#define PCI_VENDOR_ID_SOFTLOGIC 0x9413
44#define PCI_DEVICE_ID_SOLO6010 0x6010
Krzysztof Hałasa908113d2011-02-11 13:32:11 +010045#define PCI_DEVICE_ID_SOLO6110 0x6110
Ben Collinsfaa4fd22010-06-17 13:27:26 -040046#endif
47
48#ifndef PCI_VENDOR_ID_BLUECHERRY
49#define PCI_VENDOR_ID_BLUECHERRY 0x1BB3
50/* Neugent Softlogic 6010 based cards */
51#define PCI_DEVICE_ID_NEUSOLO_4 0x4304
52#define PCI_DEVICE_ID_NEUSOLO_9 0x4309
53#define PCI_DEVICE_ID_NEUSOLO_16 0x4310
Ben Collinsf62de9b2010-11-04 22:51:17 -040054/* Bluecherry Softlogic 6010 based cards */
55#define PCI_DEVICE_ID_BC_SOLO_4 0x4E04
56#define PCI_DEVICE_ID_BC_SOLO_9 0x4E09
57#define PCI_DEVICE_ID_BC_SOLO_16 0x4E10
58/* Bluecherry Softlogic 6110 based cards */
59#define PCI_DEVICE_ID_BC_6110_4 0x5304
60#define PCI_DEVICE_ID_BC_6110_8 0x5308
61#define PCI_DEVICE_ID_BC_6110_16 0x5310
Ben Collinsfaa4fd22010-06-17 13:27:26 -040062#endif /* Bluecherry */
63
Hans Verkuildcae5da2013-03-25 05:35:17 -030064/* Used in pci_device_id, and solo_dev->type */
65#define SOLO_DEV_6010 0
66#define SOLO_DEV_6110 1
67
Krzysztof Hałasadecebab2011-02-11 13:38:20 +010068#define SOLO6X10_NAME "solo6x10"
Ben Collinsfaa4fd22010-06-17 13:27:26 -040069
70#define SOLO_MAX_CHANNELS 16
71
Hans Verkuil20c5f492013-03-12 18:03:20 -030072#define SOLO6X10_VERSION "3.0.0"
Krzysztof Hałasa908113d2011-02-11 13:32:11 +010073
Ben Collinsfaa4fd22010-06-17 13:27:26 -040074/*
Krzysztof Hałasadecebab2011-02-11 13:38:20 +010075 * The SOLO6x10 actually has 8 i2c channels, but we only use 2.
Ben Collinsfaa4fd22010-06-17 13:27:26 -040076 * 0 - Techwell chip(s)
77 * 1 - SAA7128
78 */
79#define SOLO_I2C_ADAPTERS 2
80#define SOLO_I2C_TW 0
81#define SOLO_I2C_SAA 1
82
83/* DMA Engine setup */
84#define SOLO_NR_P2M 4
85#define SOLO_NR_P2M_DESC 256
Hans Verkuildcae5da2013-03-25 05:35:17 -030086#define SOLO_P2M_DESC_SIZE (SOLO_NR_P2M_DESC * 16)
Ben Collinsfaa4fd22010-06-17 13:27:26 -040087
88/* Encoder standard modes */
89#define SOLO_ENC_MODE_CIF 2
90#define SOLO_ENC_MODE_HD1 1
91#define SOLO_ENC_MODE_D1 9
92
Ben Collinsfaa4fd22010-06-17 13:27:26 -040093#define SOLO_DEFAULT_QP 3
94
Hans Verkuilc813bd32013-03-25 05:38:14 -030095#define SOLO_CID_CUSTOM_BASE (V4L2_CID_USER_BASE | 0xf000)
Hans Verkuilc813bd32013-03-25 05:38:14 -030096#define V4L2_CID_MOTION_TRACE (SOLO_CID_CUSTOM_BASE+2)
97#define V4L2_CID_OSD_TEXT (SOLO_CID_CUSTOM_BASE+3)
Ben Collinsfaa4fd22010-06-17 13:27:26 -040098
Hans Verkuilf5df0b72013-03-18 08:43:14 -030099/*
100 * Motion thresholds are in a table of 64x64 samples, with
101 * each sample representing 16x16 pixels of the source. In
102 * effect, 44x30 samples are used for NTSC, and 44x36 for PAL.
103 * The 5th sample on the 10th row is (10*64)+5 = 645.
Hans Verkuil9e7664e2013-03-29 07:20:36 -0300104 *
Hans Verkuil4063a3c2014-06-10 07:37:30 -0300105 * Internally it is stored as a 45x45 array (45*16 = 720, which is the
106 * maximum PAL/NTSC width).
Hans Verkuilf5df0b72013-03-18 08:43:14 -0300107 */
Hans Verkuil9e7664e2013-03-29 07:20:36 -0300108#define SOLO_MOTION_SZ (45)
Hans Verkuilf5df0b72013-03-18 08:43:14 -0300109
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400110enum SOLO_I2C_STATE {
111 IIC_STATE_IDLE,
112 IIC_STATE_START,
113 IIC_STATE_READ,
114 IIC_STATE_WRITE,
115 IIC_STATE_STOP
116};
117
Hans Verkuildcae5da2013-03-25 05:35:17 -0300118/* Defined in Table 4-16, Page 68-69 of the 6010 Datasheet */
119struct solo_p2m_desc {
120 u32 ctrl;
121 u32 cfg;
122 u32 dma_addr;
123 u32 ext_addr;
Ben Collinsf62de9b2010-11-04 22:51:17 -0400124};
125
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400126struct solo_p2m_dev {
Ben Collinsf62de9b2010-11-04 22:51:17 -0400127 struct mutex mutex;
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400128 struct completion completion;
Hans Verkuildcae5da2013-03-25 05:35:17 -0300129 int desc_count;
130 int desc_idx;
131 struct solo_p2m_desc *descs;
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400132 int error;
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400133};
134
Hans Verkuildcae5da2013-03-25 05:35:17 -0300135#define OSD_TEXT_MAX 44
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400136
Hans Verkuil382c31a2013-03-15 12:04:14 -0300137struct solo_vb2_buf {
Junghak Sung2d700712015-09-22 10:30:30 -0300138 struct vb2_v4l2_buffer vb;
Hans Verkuil382c31a2013-03-15 12:04:14 -0300139 struct list_head list;
140};
141
Hans Verkuila7eb9312013-03-18 08:41:13 -0300142enum solo_enc_types {
143 SOLO_ENC_TYPE_STD,
144 SOLO_ENC_TYPE_EXT,
145};
146
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400147struct solo_enc_dev {
Hans Verkuildcae5da2013-03-25 05:35:17 -0300148 struct solo_dev *solo_dev;
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400149 /* V4L2 Items */
Hans Verkuilc813bd32013-03-25 05:38:14 -0300150 struct v4l2_ctrl_handler hdl;
Hans Verkuil4063a3c2014-06-10 07:37:30 -0300151 struct v4l2_ctrl *md_thresholds;
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400152 struct video_device *vfd;
153 /* General accounting */
Hans Verkuil382c31a2013-03-15 12:04:14 -0300154 struct mutex lock;
Hans Verkuildcae5da2013-03-25 05:35:17 -0300155 spinlock_t motion_lock;
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400156 u8 ch;
157 u8 mode, gop, qp, interlaced, interval;
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400158 u8 bw_weight;
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400159 u16 motion_thresh;
Hans Verkuilf5df0b72013-03-18 08:43:14 -0300160 bool motion_global;
161 bool motion_enabled;
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400162 u16 width;
163 u16 height;
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400164
Hans Verkuildcae5da2013-03-25 05:35:17 -0300165 /* OSD buffers */
166 char osd_text[OSD_TEXT_MAX + 1];
167 u8 osd_buf[SOLO_EOSD_EXT_SIZE_MAX]
168 __aligned(4);
169
170 /* VOP stuff */
Ismael Luceno8a4d9a92014-12-24 08:35:59 -0300171 u8 vop[64];
Hans Verkuildcae5da2013-03-25 05:35:17 -0300172 int vop_len;
Ismael Luceno8a4d9a92014-12-24 08:35:59 -0300173 u8 jpeg_header[1024];
Hans Verkuildcae5da2013-03-25 05:35:17 -0300174 int jpeg_len;
175
Hans Verkuila7eb9312013-03-18 08:41:13 -0300176 u32 fmt;
Hans Verkuila7eb9312013-03-18 08:41:13 -0300177 enum solo_enc_types type;
Hans Verkuil15513c12013-03-15 13:16:49 -0300178 u32 sequence;
Hans Verkuil382c31a2013-03-15 12:04:14 -0300179 struct vb2_queue vidq;
Hans Verkuila7eb9312013-03-18 08:41:13 -0300180 struct list_head vidq_active;
Hans Verkuil0c3a14c2014-11-18 09:51:01 -0300181 void *alloc_ctx;
Hans Verkuila7eb9312013-03-18 08:41:13 -0300182 int desc_count;
183 int desc_nelts;
184 struct solo_p2m_desc *desc_items;
185 dma_addr_t desc_dma;
186 spinlock_t av_lock;
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400187};
188
Krzysztof Hałasadecebab2011-02-11 13:38:20 +0100189/* The SOLO6x10 PCI Device */
190struct solo_dev {
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400191 /* General stuff */
192 struct pci_dev *pdev;
Hans Verkuildcae5da2013-03-25 05:35:17 -0300193 int type;
194 unsigned int time_sync;
195 unsigned int usec_lsb;
196 unsigned int clock_mhz;
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400197 u8 __iomem *reg_base;
198 int nr_chans;
199 int nr_ext;
200 u32 irq_mask;
201 u32 motion_mask;
Hans Verkuild9ebd622013-03-25 05:36:44 -0300202 struct v4l2_device v4l2_dev;
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400203
204 /* tw28xx accounting */
Ben Collinsee6351f2010-06-22 22:32:01 -0400205 u8 tw2865, tw2864, tw2815;
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400206 u8 tw28_cnt;
207
208 /* i2c related items */
209 struct i2c_adapter i2c_adap[SOLO_I2C_ADAPTERS];
210 enum SOLO_I2C_STATE i2c_state;
Ben Collinsf62de9b2010-11-04 22:51:17 -0400211 struct mutex i2c_mutex;
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400212 int i2c_id;
213 wait_queue_head_t i2c_wait;
214 struct i2c_msg *i2c_msg;
215 unsigned int i2c_msg_num;
216 unsigned int i2c_msg_ptr;
217
218 /* P2M DMA Engine */
219 struct solo_p2m_dev p2m_dev[SOLO_NR_P2M];
Hans Verkuildcae5da2013-03-25 05:35:17 -0300220 atomic_t p2m_count;
221 int p2m_jiffies;
222 unsigned int p2m_timeouts;
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400223
224 /* V4L2 Display items */
225 struct video_device *vfd;
226 unsigned int erasing;
227 unsigned int frame_blank;
228 u8 cur_disp_ch;
229 wait_queue_head_t disp_thread_wait;
Hans Verkuilc813bd32013-03-25 05:38:14 -0300230 struct v4l2_ctrl_handler disp_hdl;
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400231
232 /* V4L2 Encoder items */
233 struct solo_enc_dev *v4l2_enc[SOLO_MAX_CHANNELS];
234 u16 enc_bw_remain;
235 /* IDX into hw mp4 encoder */
236 u8 enc_idx;
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400237
238 /* Current video settings */
facugaichafabbe62010-11-10 10:39:33 -0300239 u32 video_type;
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400240 u16 video_hsize, video_vsize;
241 u16 vout_hstart, vout_vstart;
242 u16 vin_hstart, vin_vstart;
243 u8 fps;
244
Hans Verkuildcae5da2013-03-25 05:35:17 -0300245 /* JPEG Qp setting */
246 spinlock_t jpeg_qp_lock;
247 u32 jpeg_qp[2];
248
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400249 /* Audio components */
250 struct snd_card *snd_card;
251 struct snd_pcm *snd_pcm;
252 atomic_t snd_users;
253 int g723_hw_idx;
Hans Verkuildcae5da2013-03-25 05:35:17 -0300254
255 /* sysfs stuffs */
256 struct device dev;
257 int sdram_size;
258 struct bin_attribute sdram_attr;
259 unsigned int sys_config;
260
261 /* Ring thread */
262 struct task_struct *ring_thread;
263 wait_queue_head_t ring_thread_wait;
Hans Verkuildcae5da2013-03-25 05:35:17 -0300264
265 /* VOP_HEADER handling */
266 void *vh_buf;
267 dma_addr_t vh_dma;
268 int vh_size;
Hans Verkuil6a2e65d2013-03-15 11:56:46 -0300269
270 /* Buffer handling */
Hans Verkuila4056c22013-03-15 12:11:17 -0300271 struct vb2_queue vidq;
272 struct vb2_alloc_ctx *alloc_ctx;
Hans Verkuil15513c12013-03-15 13:16:49 -0300273 u32 sequence;
Hans Verkuil6a2e65d2013-03-15 11:56:46 -0300274 struct task_struct *kthread;
Hans Verkuila4056c22013-03-15 12:11:17 -0300275 struct mutex lock;
Hans Verkuil6a2e65d2013-03-15 11:56:46 -0300276 spinlock_t slock;
277 int old_write;
278 struct list_head vidq_active;
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400279};
280
Krzysztof Hałasadecebab2011-02-11 13:38:20 +0100281static inline u32 solo_reg_read(struct solo_dev *solo_dev, int reg)
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400282{
Krzysztof Hałasae1ceb252015-06-08 10:42:24 -0300283 return readl(solo_dev->reg_base + reg);
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400284}
285
Hans Verkuildcae5da2013-03-25 05:35:17 -0300286static inline void solo_reg_write(struct solo_dev *solo_dev, int reg,
287 u32 data)
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400288{
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400289 writel(data, solo_dev->reg_base + reg);
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400290}
291
Hans Verkuildcae5da2013-03-25 05:35:17 -0300292static inline void solo_irq_on(struct solo_dev *dev, u32 mask)
293{
294 dev->irq_mask |= mask;
295 solo_reg_write(dev, SOLO_IRQ_MASK, dev->irq_mask);
296}
297
298static inline void solo_irq_off(struct solo_dev *dev, u32 mask)
299{
300 dev->irq_mask &= ~mask;
301 solo_reg_write(dev, SOLO_IRQ_MASK, dev->irq_mask);
302}
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400303
Hans Verkuil4c211ed2013-03-15 12:53:17 -0300304/* Init/exit routines for subsystems */
Krzysztof Hałasadecebab2011-02-11 13:38:20 +0100305int solo_disp_init(struct solo_dev *solo_dev);
306void solo_disp_exit(struct solo_dev *solo_dev);
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400307
Krzysztof Hałasadecebab2011-02-11 13:38:20 +0100308int solo_gpio_init(struct solo_dev *solo_dev);
309void solo_gpio_exit(struct solo_dev *solo_dev);
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400310
Krzysztof Hałasadecebab2011-02-11 13:38:20 +0100311int solo_i2c_init(struct solo_dev *solo_dev);
312void solo_i2c_exit(struct solo_dev *solo_dev);
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400313
Krzysztof Hałasadecebab2011-02-11 13:38:20 +0100314int solo_p2m_init(struct solo_dev *solo_dev);
315void solo_p2m_exit(struct solo_dev *solo_dev);
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400316
Hans Verkuildcae5da2013-03-25 05:35:17 -0300317int solo_v4l2_init(struct solo_dev *solo_dev, unsigned nr);
Krzysztof Hałasadecebab2011-02-11 13:38:20 +0100318void solo_v4l2_exit(struct solo_dev *solo_dev);
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400319
Krzysztof Hałasadecebab2011-02-11 13:38:20 +0100320int solo_enc_init(struct solo_dev *solo_dev);
321void solo_enc_exit(struct solo_dev *solo_dev);
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400322
Hans Verkuildcae5da2013-03-25 05:35:17 -0300323int solo_enc_v4l2_init(struct solo_dev *solo_dev, unsigned nr);
Krzysztof Hałasadecebab2011-02-11 13:38:20 +0100324void solo_enc_v4l2_exit(struct solo_dev *solo_dev);
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400325
Krzysztof Hałasadecebab2011-02-11 13:38:20 +0100326int solo_g723_init(struct solo_dev *solo_dev);
327void solo_g723_exit(struct solo_dev *solo_dev);
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400328
329/* ISR's */
Krzysztof Hałasadecebab2011-02-11 13:38:20 +0100330int solo_i2c_isr(struct solo_dev *solo_dev);
331void solo_p2m_isr(struct solo_dev *solo_dev, int id);
Hans Verkuildcae5da2013-03-25 05:35:17 -0300332void solo_p2m_error_isr(struct solo_dev *solo_dev);
Krzysztof Hałasadecebab2011-02-11 13:38:20 +0100333void solo_enc_v4l2_isr(struct solo_dev *solo_dev);
334void solo_g723_isr(struct solo_dev *solo_dev);
335void solo_motion_isr(struct solo_dev *solo_dev);
336void solo_video_in_isr(struct solo_dev *solo_dev);
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400337
338/* i2c read/write */
Krzysztof Hałasadecebab2011-02-11 13:38:20 +0100339u8 solo_i2c_readbyte(struct solo_dev *solo_dev, int id, u8 addr, u8 off);
340void solo_i2c_writebyte(struct solo_dev *solo_dev, int id, u8 addr, u8 off,
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400341 u8 data);
342
343/* P2M DMA */
Hans Verkuildcae5da2013-03-25 05:35:17 -0300344int solo_p2m_dma_t(struct solo_dev *solo_dev, int wr,
345 dma_addr_t dma_addr, u32 ext_addr, u32 size,
346 int repeat, u32 ext_size);
347int solo_p2m_dma(struct solo_dev *solo_dev, int wr,
348 void *sys_addr, u32 ext_addr, u32 size,
349 int repeat, u32 ext_size);
350void solo_p2m_fill_desc(struct solo_p2m_desc *desc, int wr,
351 dma_addr_t dma_addr, u32 ext_addr, u32 size,
352 int repeat, u32 ext_size);
353int solo_p2m_dma_desc(struct solo_dev *solo_dev,
354 struct solo_p2m_desc *desc, dma_addr_t desc_dma,
355 int desc_cnt);
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400356
Hans Verkuil4c211ed2013-03-15 12:53:17 -0300357/* Global s_std ioctl */
Hans Verkuil429df502014-01-13 06:58:12 -0300358int solo_set_video_type(struct solo_dev *solo_dev, bool is_50hz);
Hans Verkuil4c211ed2013-03-15 12:53:17 -0300359void solo_update_mode(struct solo_enc_dev *solo_enc);
360
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400361/* Set the threshold for motion detection */
Hans Verkuildcae5da2013-03-25 05:35:17 -0300362int solo_set_motion_threshold(struct solo_dev *solo_dev, u8 ch, u16 val);
Hans Verkuilf5df0b72013-03-18 08:43:14 -0300363int solo_set_motion_block(struct solo_dev *solo_dev, u8 ch,
Hans Verkuil4063a3c2014-06-10 07:37:30 -0300364 const u16 *thresholds);
Ben Collinsfaa4fd22010-06-17 13:27:26 -0400365#define SOLO_DEF_MOT_THRESH 0x0300
366
367/* Write text on OSD */
368int solo_osd_print(struct solo_enc_dev *solo_enc);
369
Hans Verkuildcae5da2013-03-25 05:35:17 -0300370/* EEPROM commands */
371unsigned int solo_eeprom_ewen(struct solo_dev *solo_dev, int w_en);
Hans Verkuilc44b6482014-08-20 16:27:38 -0300372__be16 solo_eeprom_read(struct solo_dev *solo_dev, int loc);
Hans Verkuildcae5da2013-03-25 05:35:17 -0300373int solo_eeprom_write(struct solo_dev *solo_dev, int loc,
Hans Verkuilc44b6482014-08-20 16:27:38 -0300374 __be16 data);
Hans Verkuildcae5da2013-03-25 05:35:17 -0300375
376/* JPEG Qp functions */
377void solo_s_jpeg_qp(struct solo_dev *solo_dev, unsigned int ch,
378 unsigned int qp);
379int solo_g_jpeg_qp(struct solo_dev *solo_dev, unsigned int ch);
380
381#define CHK_FLAGS(v, flags) (((v) & (flags)) == (flags))
382
Krzysztof Hałasadecebab2011-02-11 13:38:20 +0100383#endif /* __SOLO6X10_H */