summaryrefslogtreecommitdiff
path: root/drivers/staging/media/go7007/go7007-priv.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 16:58:16 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 16:58:16 (GMT)
commit240c3c3424366c8109babd2a0fe80855de511b35 (patch)
tree72eb8652c8e513715efee1e254644b4b670333fd /drivers/staging/media/go7007/go7007-priv.h
parent19b344efa35dbc253e2d10403dafe6aafda73c56 (diff)
parentdf90e2258950fd631cdbf322c1ee1f22068391aa (diff)
downloadlinux-fsl-qoriq-240c3c3424366c8109babd2a0fe80855de511b35.tar.xz
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media update from Mauro Carvalho Chehab: - OF documentation and patches at core and drivers, to be used by for embedded media systems - some I2C drivers used on go7007 were rewritten/promoted from staging: sony-btf-mpx, tw2804, tw9903, tw9906, wis-ov7640, wis-uda1342 - add fimc-is driver (Exynos) - add a new radio driver: radio-si476x - add a two new tuners: r820t and tuner_it913x - split camera code on em28xx driver and add more models - the cypress firmware load is used outside dvb usb drivers. So, move it to a common directory to make easier to re-use it - siano media driver updated to work with sms2270 devices - several work done in order to promote go7007 and solo6x1x out of staging (still, there are some pending issues) - several API compliance fixes at v4l2 drivers that don't behave as expected - as usual, lots of driver fixes, improvements, cleanups and new device addition at the existing drivers. * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (831 commits) [media] cx88: make core less verbose [media] em28xx: fix oops at em28xx_dvb_bus_ctrl() [media] s5c73m3: fix indentation of the help section in Kconfig [media] cx25821-alsa: get rid of a __must_check warning [media] cx25821-video: declare cx25821_vidioc_s_std as static [media] cx25821-video: remove maxw from cx25821_vidioc_try_fmt_vid_cap [media] r820t: Remove a warning for an unused value [media] dib0090: Fix a warning at dib0090_set_EFUSE [media] dib8000: fix a warning [media] dib8000: Fix sub-channel range [media] dib8000: store dtv_property_cache in a temp var [media] dib8000: warning fix: declare internal functions as static [media] r820t: quiet gcc warning on n_ring [media] r820t: memory leak in release() [media] r820t: precendence bug in r820t_xtal_check() [media] videodev2.h: Remove the unused old V4L1 buffer types [media] anysee: Grammar s/report the/report to/ [media] anysee: Initialize ret = 0 in anysee_frontend_attach() [media] media: videobuf2: fix the length check for mmap [media] em28xx: save isoc endpoint number for DVB only if endpoint has alt settings with xMaxPacketSize != 0 ...
Diffstat (limited to 'drivers/staging/media/go7007/go7007-priv.h')
-rw-r--r--drivers/staging/media/go7007/go7007-priv.h104
1 files changed, 54 insertions, 50 deletions
diff --git a/drivers/staging/media/go7007/go7007-priv.h b/drivers/staging/media/go7007/go7007-priv.h
index b58c394..6e16af7 100644
--- a/drivers/staging/media/go7007/go7007-priv.h
+++ b/drivers/staging/media/go7007/go7007-priv.h
@@ -22,6 +22,9 @@
*/
#include <media/v4l2-device.h>
+#include <media/v4l2-ctrls.h>
+#include <media/v4l2-fh.h>
+#include <media/videobuf2-core.h>
struct go7007;
@@ -34,15 +37,13 @@ struct go7007;
#define GO7007_BOARDID_XMEN_II 5
#define GO7007_BOARDID_XMEN_III 6
#define GO7007_BOARDID_MATRIX_REV 7
-#define GO7007_BOARDID_PX_M402U 16
-#define GO7007_BOARDID_PX_TV402U_ANY 17 /* need to check tuner model */
-#define GO7007_BOARDID_PX_TV402U_NA 18 /* detected NTSC tuner */
-#define GO7007_BOARDID_PX_TV402U_EU 19 /* detected PAL tuner */
-#define GO7007_BOARDID_PX_TV402U_JP 20 /* detected NTSC-J tuner */
-#define GO7007_BOARDID_LIFEVIEW_LR192 21 /* TV Walker Ultra */
-#define GO7007_BOARDID_ENDURA 22
-#define GO7007_BOARDID_ADLINK_MPG24 23
-#define GO7007_BOARDID_SENSORAY_2250 24 /* Sensoray 2250/2251 */
+#define GO7007_BOARDID_PX_M402U 8
+#define GO7007_BOARDID_PX_TV402U 9
+#define GO7007_BOARDID_LIFEVIEW_LR192 10 /* TV Walker Ultra */
+#define GO7007_BOARDID_ENDURA 11
+#define GO7007_BOARDID_ADLINK_MPG24 12
+#define GO7007_BOARDID_SENSORAY_2250 13 /* Sensoray 2250/2251 */
+#define GO7007_BOARDID_ADS_USBAV_709 14
/* Various characteristics of each board */
#define GO7007_BOARD_HAS_AUDIO (1<<0)
@@ -61,6 +62,7 @@ struct go7007;
#define GO7007_SENSOR_TV (1<<7)
#define GO7007_SENSOR_VBI (1<<8)
#define GO7007_SENSOR_SCALING (1<<9)
+#define GO7007_SENSOR_SAA7115 (1<<10)
/* Characteristics of audio sensor devices */
#define GO7007_AUDIO_I2S_MODE_1 (1)
@@ -74,7 +76,6 @@ struct go7007;
#define GO7007_AUDIO_OKI_MODE (1<<17)
struct go7007_board_info {
- char *firmware;
unsigned int flags;
int hpi_buffer_cap;
unsigned int sensor_flags;
@@ -88,17 +89,25 @@ struct go7007_board_info {
int audio_bclk_div;
int audio_main_div;
int num_i2c_devs;
- struct {
+ struct go_i2c {
const char *type;
- int id;
+ unsigned int is_video:1;
+ unsigned int is_audio:1;
int addr;
- } i2c_devs[4];
+ u32 flags;
+ } i2c_devs[5];
int num_inputs;
struct {
int video_input;
- int audio_input;
+ int audio_index;
char *name;
} inputs[4];
+ int video_config;
+ int num_aud_inputs;
+ struct {
+ int audio_input;
+ char *name;
+ } aud_inputs[3];
};
struct go7007_hpi_ops {
@@ -109,6 +118,7 @@ struct go7007_hpi_ops {
int (*stream_stop)(struct go7007 *go);
int (*send_firmware)(struct go7007 *go, u8 *data, int len);
int (*send_command)(struct go7007 *go, unsigned int cmd, void *arg);
+ void (*release)(struct go7007 *go);
};
/* The video buffer size must be a multiple of PAGE_SIZE */
@@ -116,35 +126,12 @@ struct go7007_hpi_ops {
#define GO7007_BUF_SIZE (GO7007_BUF_PAGES << PAGE_SHIFT)
struct go7007_buffer {
- struct go7007 *go; /* Reverse reference for VMA ops */
- int index; /* Reverse reference for DQBUF */
- enum { BUF_STATE_IDLE, BUF_STATE_QUEUED, BUF_STATE_DONE } state;
- u32 seq;
- struct timeval timestamp;
- struct list_head stream;
- struct page *pages[GO7007_BUF_PAGES + 1]; /* extra for straddling */
- unsigned long user_addr;
- unsigned int page_count;
- unsigned int offset;
- unsigned int bytesused;
+ struct vb2_buffer vb;
+ struct list_head list;
unsigned int frame_offset;
u32 modet_active;
- int mapped;
};
-struct go7007_file {
- struct go7007 *go;
- struct mutex lock;
- int buf_count;
- struct go7007_buffer *bufs;
-};
-
-#define GO7007_FORMAT_MJPEG 0
-#define GO7007_FORMAT_MPEG4 1
-#define GO7007_FORMAT_MPEG1 2
-#define GO7007_FORMAT_MPEG2 3
-#define GO7007_FORMAT_H263 4
-
#define GO7007_RATIO_1_1 0
#define GO7007_RATIO_4_3 1
#define GO7007_RATIO_16_9 2
@@ -163,24 +150,38 @@ enum go7007_parser_state {
struct go7007 {
struct device *dev;
- struct go7007_board_info *board_info;
+ u8 bus_info[32];
+ const struct go7007_board_info *board_info;
unsigned int board_id;
int tuner_type;
int channel_number; /* for multi-channel boards like Adlink PCI-MPG24 */
char name[64];
- struct video_device *video_dev;
+ struct video_device vdev;
+ void *boot_fw;
+ unsigned boot_fw_len;
struct v4l2_device v4l2_dev;
- int ref_count;
+ struct v4l2_ctrl_handler hdl;
+ struct v4l2_ctrl *mpeg_video_encoding;
+ struct v4l2_ctrl *mpeg_video_gop_size;
+ struct v4l2_ctrl *mpeg_video_gop_closure;
+ struct v4l2_ctrl *mpeg_video_bitrate;
+ struct v4l2_ctrl *mpeg_video_aspect_ratio;
+ struct v4l2_ctrl *mpeg_video_b_frames;
+ struct v4l2_ctrl *mpeg_video_rep_seqheader;
enum { STATUS_INIT, STATUS_ONLINE, STATUS_SHUTDOWN } status;
spinlock_t spinlock;
struct mutex hw_lock;
- int streaming;
- int in_use;
+ struct mutex serialize_lock;
int audio_enabled;
+ struct v4l2_subdev *sd_video;
+ struct v4l2_subdev *sd_audio;
+ u8 usb_buf[16];
/* Video input */
int input;
+ int aud_input;
enum { GO7007_STD_NTSC, GO7007_STD_PAL, GO7007_STD_OTHER } standard;
+ v4l2_std_id std;
int sensor_framerate;
int width;
int height;
@@ -191,7 +192,7 @@ struct go7007 {
unsigned int encoder_subsample:1;
/* Encoder config */
- int format;
+ u32 format;
int bitrate;
int fps_scale;
int pali;
@@ -217,14 +218,16 @@ struct go7007 {
unsigned char active_map[216];
/* Video streaming */
- struct go7007_buffer *active_buf;
+ struct mutex queue_lock;
+ struct vb2_queue vidq;
enum go7007_parser_state state;
int parse_length;
u16 modet_word;
int seen_frame;
u32 next_seq;
- struct list_head stream;
+ struct list_head vidq_active;
wait_queue_head_t frame_waitq;
+ struct go7007_buffer *active_buf;
/* Audio streaming */
void (*audio_deliver)(struct go7007 *go, u8 *buf, int length);
@@ -267,12 +270,12 @@ int go7007_read_addr(struct go7007 *go, u16 addr, u16 *data);
int go7007_read_interrupt(struct go7007 *go, u16 *value, u16 *data);
int go7007_boot_encoder(struct go7007 *go, int init_i2c);
int go7007_reset_encoder(struct go7007 *go);
-int go7007_register_encoder(struct go7007 *go);
+int go7007_register_encoder(struct go7007 *go, unsigned num_i2c_devs);
int go7007_start_encoder(struct go7007 *go);
void go7007_parse_video_stream(struct go7007 *go, u8 *buf, int length);
-struct go7007 *go7007_alloc(struct go7007_board_info *board,
+struct go7007 *go7007_alloc(const struct go7007_board_info *board,
struct device *dev);
-void go7007_remove(struct go7007 *go);
+void go7007_update_board(struct go7007 *go);
/* go7007-fw.c */
int go7007_construct_fw_image(struct go7007 *go, u8 **fw, int *fwlen);
@@ -283,6 +286,7 @@ int go7007_i2c_remove(struct go7007 *go);
/* go7007-v4l2.c */
int go7007_v4l2_init(struct go7007 *go);
+int go7007_v4l2_ctrl_init(struct go7007 *go);
void go7007_v4l2_remove(struct go7007 *go);
/* snd-go7007.c */