diff options
Diffstat (limited to 'linux/drivers/media')
-rw-r--r-- | linux/drivers/media/common/saa7146.h | 22 | ||||
-rw-r--r-- | linux/drivers/media/common/saa7146_core.c | 14 | ||||
-rw-r--r-- | linux/drivers/media/common/saa7146_hlp.c | 21 | ||||
-rw-r--r-- | linux/drivers/media/common/saa7146_i2c.c | 10 | ||||
-rw-r--r-- | linux/drivers/media/common/saa7146_vbi.c | 27 | ||||
-rw-r--r-- | linux/drivers/media/common/saa7146_video.c | 72 | ||||
-rw-r--r-- | linux/drivers/media/video/mxb.c | 108 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7111.c | 2 |
8 files changed, 148 insertions, 128 deletions
diff --git a/linux/drivers/media/common/saa7146.h b/linux/drivers/media/common/saa7146.h index 67f1c5793..090281eb5 100644 --- a/linux/drivers/media/common/saa7146.h +++ b/linux/drivers/media/common/saa7146.h @@ -1,7 +1,8 @@ #ifndef __SAA7146__ #define __SAA7146__ -/* fixme: this triggers bugs in video_read() */ +/* fixme: this triggers bugs in video_read(), resulting +from flaws in video-buf.c => Gerd Knorr */ //#define DEBUG_SPINLOCKS 1 #include <linux/module.h> /* for module-version */ @@ -35,17 +36,17 @@ #define BOARD_CAN_DO_VBI(dev) (dev->revision != 0 && 0 != dev->ext->vbi) -extern int debug; +extern unsigned int saa7146_debug; //#define DEBUG_PROLOG printk("(0x%08x) %s: %s(): ",(dev==0?-1:(dev->mem==0?-1:saa7146_read(dev,IER))),__stringify(KBUILD_MODNAME),__FUNCTION__) -#define DEBUG_PROLOG printk("%s: %s(): ",__stringify(KBUILD_MODNAME),__FUNCTION__) +#define DEBUG_PROLOG printk("%d: %s: %s(): ",saa7146_debug,__stringify(KBUILD_MODNAME),__FUNCTION__) -#define DEB_S(x) if (0!=(debug&0x01)) { DEBUG_PROLOG; printk x; } /* simple debug messages */ -#define DEB_D(x) if (0!=(debug&0x02)) { DEBUG_PROLOG; printk x; } /* more detailed debug messages */ -#define DEB_EE(x) if (0!=(debug&0x04)) { DEBUG_PROLOG; printk x; } /* print enter and exit of functions */ -#define DEB_I2C(x) if (0!=(debug&0x08)) { DEBUG_PROLOG; printk x; } /* i2c debug messages */ -#define DEB_VBI(x) if (0!=(debug&0x10)) { DEBUG_PROLOG; printk x; } /* vbi debug messages */ -#define DEB_INT(x) if (0!=(debug&0x20)) { DEBUG_PROLOG; printk x; } /* interrupt debug messages */ -#define DEB_CAP(x) if (0!=(debug&0x40)) { DEBUG_PROLOG; printk x; } /* capture debug messages */ +#define DEB_S(x) if (0!=(saa7146_debug&0x01)) { DEBUG_PROLOG; printk x; } /* simple debug messages */ +#define DEB_D(x) if (0!=(saa7146_debug&0x02)) { DEBUG_PROLOG; printk x; } /* more detailed debug messages */ +#define DEB_EE(x) if (0!=(saa7146_debug&0x04)) { DEBUG_PROLOG; printk x; } /* print enter and exit of functions */ +#define DEB_I2C(x) if (0!=(saa7146_debug&0x08)) { DEBUG_PROLOG; printk x; } /* i2c debug messages */ +#define DEB_VBI(x) if (0!=(saa7146_debug&0x10)) { DEBUG_PROLOG; printk x; } /* vbi debug messages */ +#define DEB_INT(x) if (0!=(saa7146_debug&0x20)) { DEBUG_PROLOG; printk x; } /* interrupt debug messages */ +#define DEB_CAP(x) if (0!=(saa7146_debug&0x40)) { DEBUG_PROLOG; printk x; } /* capture debug messages */ #define ERR(x) { DEBUG_PROLOG; printk x; } #define INFO(x) { printk("%s: ",__stringify(KBUILD_MODNAME)); printk x; } @@ -296,7 +297,6 @@ void saa7146_set_hps_source_and_sync(struct saa7146_dev *saa, int source, int sy void saa7146_set_gpio(struct saa7146_dev *saa, u8 pin, u8 data); /* from saa7146_core.c */ -extern struct list_head devices; int saa7146_register_extension(struct saa7146_extension*); int saa7146_unregister_extension(struct saa7146_extension*); struct saa7146_format* format_by_fourcc(struct saa7146_dev *dev, int fourcc); diff --git a/linux/drivers/media/common/saa7146_core.c b/linux/drivers/media/common/saa7146_core.c index a99992429..e81b7340e 100644 --- a/linux/drivers/media/common/saa7146_core.c +++ b/linux/drivers/media/common/saa7146_core.c @@ -31,14 +31,12 @@ static struct list_head devices; static struct semaphore devices_lock; static struct list_head extensions; static int initialized = 0; - static int saa7146_num = 0; -static int debug = 0; -#ifdef MODULE -MODULE_PARM(debug,"i"); -MODULE_PARM_DESC(debug, "debug level (default: 0)"); -#endif +unsigned int saa7146_debug = 247; + +MODULE_PARM(saa7146_debug,"i"); +MODULE_PARM_DESC(saa7146_debug, "debug level (default: 0)"); static void dump_registers(struct saa7146_dev* dev) { @@ -947,7 +945,7 @@ struct pci_driver saa7146_driver = { static int __init saa7146_init_module(void) { - DEB_EE((".")); + DEB_EE((".\n")); if( 0 == initialized ) { INIT_LIST_HEAD(&devices); @@ -963,7 +961,7 @@ int __init saa7146_init_module(void) static void __exit saa7146_cleanup_module(void) { - DEB_EE((".")); + DEB_EE((".\n")); pci_unregister_driver(&saa7146_driver); } diff --git a/linux/drivers/media/common/saa7146_hlp.c b/linux/drivers/media/common/saa7146_hlp.c index fd7a9033f..4ebbfa2ff 100644 --- a/linux/drivers/media/common/saa7146_hlp.c +++ b/linux/drivers/media/common/saa7146_hlp.c @@ -8,6 +8,7 @@ #define my_max(type,x,y) \ ({ type __x = (x), __y = (y); __x > __y ? __x: __y; }) +static void calculate_output_format_register(struct saa7146_dev* saa, u32 palette, u32* clip_format) { /* clear out the necessary bits */ @@ -16,17 +17,20 @@ void calculate_output_format_register(struct saa7146_dev* saa, u32 palette, u32* *clip_format |= (( ((palette&0xf00)>>8) << 30) | ((palette&0x00f) << 24) | (((palette&0x0f0)>>4) << 16)); } +static void calculate_bcs_ctrl_register(struct saa7146_dev *dev, int brightness, int contrast, int colour, u32 *bcs_ctrl) { *bcs_ctrl = ((brightness << 24) | (contrast << 16) | (colour << 0)); } +static void calculate_hps_source_and_sync(struct saa7146_dev *dev, int source, int sync, u32* hps_ctrl) { *hps_ctrl &= ~(MASK_30 | MASK_31 | MASK_28); *hps_ctrl |= (source << 30) | (sync << 28); } +static void calculate_hxo_and_hyo(struct saa7146_dev *dev, u32* hps_h_scale, u32* hps_ctrl) { int hyo = 0, hxo = 0; @@ -49,7 +53,7 @@ void calculate_hxo_and_hyo(struct saa7146_dev *dev, u32* hps_h_scale, u32* hps_c */ /* hps_coeff used for CXY and CXUV; scale 1/1 -> scale 1/64 */ -struct { +static struct { u16 hps_coeff; u16 weight_sum; } hps_h_coeff_tab [] = { @@ -72,6 +76,7 @@ struct { u8 h_attenuation[] = { 1, 2, 4, 8, 2, 4, 8, 16, 0}; /* calculate horizontal scale registers */ +static int calculate_h_scale_registers(struct saa7146_dev *dev, int in_x, int out_x, int flip_lr, u32* hps_ctrl, u32* hps_v_gain, u32* hps_h_prescale, u32* hps_h_scale) @@ -196,7 +201,7 @@ int calculate_h_scale_registers(struct saa7146_dev *dev, return 0; } -struct { +static struct { u16 hps_coeff; u16 weight_sum; } hps_v_coeff_tab [] = { @@ -219,6 +224,7 @@ struct { u16 v_attenuation[] = { 2, 4, 8, 16, 32, 64, 128, 256, 0}; /* calculate vertical scale registers */ +static int calculate_v_scale_registers(struct saa7146_dev *dev, enum v4l2_field field, int in_y, int out_y, u32* hps_v_scale, u32* hps_v_gain) { @@ -315,6 +321,7 @@ int calculate_v_scale_registers(struct saa7146_dev *dev, enum v4l2_field field, } /* simple bubble-sort algorithm with duplicate elimination */ +static int sort_and_eliminate(u32* values, int* count) { int low = 0, high = 0, top = 0, temp = 0; @@ -347,6 +354,7 @@ int sort_and_eliminate(u32* values, int* count) return 0; } +static void calculate_clipping_registers_rect(struct saa7146_dev *dev, struct saa7146_fh *fh, struct saa7146_video_dma *vdma2, u32* clip_format, u32* arbtr_ctrl, enum v4l2_field field) { @@ -479,6 +487,7 @@ void calculate_clipping_registers_rect(struct saa7146_dev *dev, struct saa7146_f } /* disable clipping */ +static void saa7146_disable_clipping(struct saa7146_dev *dev) { u32 clip_format = saa7146_read(dev, CLIP_FORMAT_CTRL); @@ -494,6 +503,7 @@ void saa7146_disable_clipping(struct saa7146_dev *dev) saa7146_write(dev, MC1, (MASK_21)); } +static void saa7146_set_clipping_rect(struct saa7146_dev *dev, struct saa7146_fh *fh) { enum v4l2_field field = fh->ov.win.field; @@ -536,6 +546,7 @@ void saa7146_set_clipping_rect(struct saa7146_dev *dev, struct saa7146_fh *fh) saa7146_write(dev, MC1, (MASK_05 | MASK_21)); } +static void saa7146_set_window(struct saa7146_dev *dev, int width, int height, enum v4l2_field field) { int flip_lr = dev->hflip; @@ -571,6 +582,7 @@ void saa7146_set_window(struct saa7146_dev *dev, int width, int height, enum v4l } /* calculate the new memory offsets for a desired position */ +static void saa7146_set_position(struct saa7146_dev *dev, int w_x, int w_y, int w_height, enum v4l2_field field) { int td_flip = dev->vflip; @@ -621,6 +633,7 @@ void saa7146_set_position(struct saa7146_dev *dev, int w_x, int w_y, int w_heigh saa7146_write(dev, MC2, (MASK_02 | MASK_18)); } +static void saa7146_set_output_format(struct saa7146_dev *dev, unsigned long palette) { u32 clip_format = saa7146_read(dev, CLIP_FORMAT_CTRL); @@ -730,7 +743,7 @@ void saa7146_write_out_dma(struct saa7146_dev* dev, int which, struct saa7146_vi printk("vdma%d.num_line_byte: 0x%08x\n", which,vdma->num_line_byte); */ } - +static int calculate_video_dma_grab_packed(struct saa7146_dev* dev, struct saa7146_buf *buf) { struct saa7146_video_dma vdma1; @@ -781,6 +794,7 @@ int calculate_video_dma_grab_packed(struct saa7146_dev* dev, struct saa7146_buf return 0; } +static int calculate_video_dma_grab_planar(struct saa7146_dev* dev, struct saa7146_buf *buf) { struct saa7146_video_dma vdma1; @@ -886,6 +900,7 @@ int calculate_video_dma_grab_planar(struct saa7146_dev* dev, struct saa7146_buf return 0; } +static void program_capture_engine(struct saa7146_dev *dev, int planar) { int count = 0; diff --git a/linux/drivers/media/common/saa7146_i2c.c b/linux/drivers/media/common/saa7146_i2c.c index d4c8446b8..fb876b03b 100644 --- a/linux/drivers/media/common/saa7146_i2c.c +++ b/linux/drivers/media/common/saa7146_i2c.c @@ -4,6 +4,7 @@ #endif /* helper function */ +static void my_wait(struct saa7146_dev *dev, long ms) { unsigned long timeout = jiffies + ((ms+9)/10); @@ -23,6 +24,7 @@ u32 saa7146_i2c_func(struct i2c_adapter *adapter) } /* this function returns the status-register of our i2c-device */ +static inline u32 saa7146_i2c_status(struct saa7146_dev *dev) { u32 iicsta = saa7146_read(dev, I2C_STATUS); @@ -36,6 +38,7 @@ u32 saa7146_i2c_status(struct saa7146_dev *dev) sent through the saa7146. have a look at the specifications p. 122 ff to understand this. it returns the number of u32s to send, or -1 in case of an error. */ +static int saa7146_i2c_msg_prepare(const struct i2c_msg m[], int num, u32 *op) { int h1, h2; @@ -100,6 +103,7 @@ int saa7146_i2c_msg_prepare(const struct i2c_msg m[], int num, u32 *op) which bytes were read through the adapter and write them back to the corresponding i2c-message. but instead, we simply write back all bytes. fixme: this could be improved. */ +static int saa7146_i2c_msg_cleanup(const struct i2c_msg m[], int num, u32 *op) { int i, j; @@ -122,6 +126,7 @@ int saa7146_i2c_msg_cleanup(const struct i2c_msg m[], int num, u32 *op) } /* this functions resets the i2c-device and returns 0 if everything was fine, otherwise -1 */ +static int saa7146_i2c_reset(struct saa7146_dev *dev) { /* get current status */ @@ -186,6 +191,7 @@ int saa7146_i2c_reset(struct saa7146_dev *dev) /* this functions writes out the data-byte 'dword' to the i2c-device. it returns 0 if ok, -1 if the transfer failed, -2 if the transfer failed badly (e.g. address error) */ +static int saa7146_i2c_writeout(struct saa7146_dev *dev, u32* dword) { int i = 0; @@ -345,6 +351,7 @@ out: } /* utility functions */ +static int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg msg[], int num) { struct saa7146_dev* dev = (struct saa7146_dev*)adapter->data; @@ -356,11 +363,13 @@ int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg msg[], int num) } /* these are just for completeness */ +static int saa7146_i2c_reg(struct i2c_client *client) { return 0; } +static int saa7146_i2c_unreg(struct i2c_client *client) { return 0; @@ -386,6 +395,7 @@ void saa7146_i2c_dec_use(struct i2c_adapter *adap) /* i2c-adapter helper functions */ /* exported algorithm data */ +static struct i2c_algorithm saa7146_algo = { "saa7146 i2c algorithm", I2C_ALGO_SAA7146, diff --git a/linux/drivers/media/common/saa7146_vbi.c b/linux/drivers/media/common/saa7146_vbi.c index d69049a7b..a6f4cb06f 100644 --- a/linux/drivers/media/common/saa7146_vbi.c +++ b/linux/drivers/media/common/saa7146_vbi.c @@ -5,6 +5,7 @@ static int vbi_pixel_to_capture = 720 * 2; +static int vbi_workaround(struct saa7146_dev *dev) { u32 *cpu; @@ -194,7 +195,8 @@ void saa7146_set_vbi_capture(struct saa7146_dev *dev, struct saa7146_buf *buf, s saa7146_write(dev, MC1, (MASK_13 | MASK_29)); } -static int buffer_activate(struct saa7146_dev *dev, +static +int buffer_activate(struct saa7146_dev *dev, struct saa7146_buf *buf, struct saa7146_buf *next) { @@ -207,7 +209,8 @@ static int buffer_activate(struct saa7146_dev *dev, return 0; } -static int buffer_prepare(struct file *file, struct videobuf_buffer *vb) +static +int buffer_prepare(struct file *file, struct videobuf_buffer *vb) { struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; @@ -254,12 +257,14 @@ static int buffer_prepare(struct file *file, struct videobuf_buffer *vb) return err; } + static int buffer_setup(struct file *file, int *count, int *size) { +/* struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; - +*/ int llength,lines; lines = 16 * 2 ; /* 2 fields */ @@ -273,7 +278,8 @@ buffer_setup(struct file *file, int *count, int *size) return 0; } -static void buffer_queue(struct file *file, struct videobuf_buffer *vb) +static +void buffer_queue(struct file *file, struct videobuf_buffer *vb) { struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; @@ -283,7 +289,8 @@ static void buffer_queue(struct file *file, struct videobuf_buffer *vb) saa7146_buffer_queue(dev,&dev->vbi_q,buf); } -static void buffer_release(struct file *file, struct videobuf_buffer *vb) +static +void buffer_release(struct file *file, struct videobuf_buffer *vb) { struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; @@ -293,6 +300,7 @@ static void buffer_release(struct file *file, struct videobuf_buffer *vb) saa7146_dma_free(dev,buf); } +static struct videobuf_queue_ops vbi_qops = { .buf_setup = buffer_setup, .buf_prepare = buffer_prepare, @@ -302,6 +310,7 @@ struct videobuf_queue_ops vbi_qops = { /* ------------------------------------------------------------------ */ +static void vbi_stop(struct saa7146_fh *fh) { struct saa7146_dev *dev = fh->dev; @@ -323,6 +332,7 @@ void vbi_stop(struct saa7146_fh *fh) spin_unlock_irqrestore(&dev->slock, flags); } +static void vbi_read_timeout(unsigned long data) { struct saa7146_fh *fh = (struct saa7146_fh *)data; @@ -333,6 +343,7 @@ void vbi_read_timeout(unsigned long data) vbi_stop(fh); } +static void vbi_init(struct saa7146_dev *dev) { INIT_LIST_HEAD(&dev->vbi_q.queue); @@ -345,6 +356,7 @@ void vbi_init(struct saa7146_dev *dev) init_waitqueue_head(&dev->vbi_wq); } +static void vbi_open(struct saa7146_dev *dev, struct saa7146_fh *fh) { memset(&fh->vbi_fmt,0,sizeof(fh->vbi_fmt)); @@ -373,6 +385,7 @@ void vbi_open(struct saa7146_dev *dev, struct saa7146_fh *fh) vbi_workaround(dev); } +static void vbi_close(struct saa7146_dev *dev, struct saa7146_fh *fh, struct file *file) { if( fh == dev->vbi_streaming ) { @@ -380,6 +393,7 @@ void vbi_close(struct saa7146_dev *dev, struct saa7146_fh *fh, struct file *file } } +static void vbi_irq_done(struct saa7146_dev *dev, unsigned long status) { spin_lock(&dev->slock); @@ -398,7 +412,8 @@ void vbi_irq_done(struct saa7146_dev *dev, unsigned long status) spin_unlock(&dev->slock); } -static ssize_t vbi_read(struct file *file, char *data, size_t count, loff_t *ppos) +static +ssize_t vbi_read(struct file *file, char *data, size_t count, loff_t *ppos) { struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c index cf3feda3f..c0c01e2bd 100644 --- a/linux/drivers/media/common/saa7146_video.c +++ b/linux/drivers/media/common/saa7146_video.c @@ -3,14 +3,14 @@ #define KBUILD_MODNAME saa7146 #endif +static int memory = 32; -#ifdef MODULE MODULE_PARM(memory,"i"); MODULE_PARM_DESC(memory, "maximum memory usage for capture buffers (default: 32Mb)"); -#endif /* format descriptions for capture and preview */ +static struct saa7146_format formats[] = { {"RGB-8 (3-3-2)", V4L2_PIX_FMT_RGB332, RGB08_COMPOSED, 8, 0}, @@ -28,6 +28,7 @@ struct saa7146_format formats[] = }; /* this is only true for saa7146a. for the saa7146 (without "a") this is NUM_CAPPVFMT-1 */ +static int NUM_FORMATS = sizeof(formats)/sizeof(struct saa7146_format); struct saa7146_format* format_by_fourcc(struct saa7146_dev *dev, int fourcc) @@ -48,7 +49,8 @@ struct saa7146_format* format_by_fourcc(struct saa7146_dev *dev, int fourcc) return NULL; } -static int g_fmt(struct saa7146_fh *fh, struct v4l2_format *f) +static +int g_fmt(struct saa7146_fh *fh, struct v4l2_format *f) { struct saa7146_dev *dev = fh->dev; DEB_EE(("dev:%p, fh:%p\n",dev,fh)); @@ -75,7 +77,8 @@ static int g_fmt(struct saa7146_fh *fh, struct v4l2_format *f) } } -static int try_win(struct saa7146_dev *dev, struct v4l2_window *win) +static +int try_win(struct saa7146_dev *dev, struct v4l2_window *win) { enum v4l2_field field; int maxw, maxh; @@ -130,7 +133,8 @@ static int try_win(struct saa7146_dev *dev, struct v4l2_window *win) return 0; } -static int try_fmt(struct saa7146_fh *fh, struct v4l2_format *f) +static +int try_fmt(struct saa7146_fh *fh, struct v4l2_format *f) { struct saa7146_dev *dev = fh->dev; int err; @@ -193,7 +197,8 @@ static int try_fmt(struct saa7146_fh *fh, struct v4l2_format *f) } } -static int start_preview(struct saa7146_fh *fh) +static +int start_preview(struct saa7146_fh *fh) { struct saa7146_dev *dev = fh->dev; int err = 0; @@ -238,7 +243,8 @@ static int start_preview(struct saa7146_fh *fh) return 0; } -static int stop_preview(struct saa7146_fh *fh) +static +int stop_preview(struct saa7146_fh *fh) { struct saa7146_dev *dev = fh->dev; DEB_EE(("saa7146.o: stop_preview()\n")); @@ -260,7 +266,8 @@ static int stop_preview(struct saa7146_fh *fh) return 0; } -static int s_fmt(struct saa7146_fh *fh, struct v4l2_format *f) +static +int s_fmt(struct saa7146_fh *fh, struct v4l2_format *f) { struct saa7146_dev *dev = fh->dev; @@ -318,7 +325,8 @@ static int s_fmt(struct saa7146_fh *fh, struct v4l2_format *f) /********************************************************************************/ /* device controls */ -static struct v4l2_queryctrl controls[] = { +static +struct v4l2_queryctrl controls[] = { { id: V4L2_CID_BRIGHTNESS, name: "Brightness", @@ -357,11 +365,13 @@ static struct v4l2_queryctrl controls[] = { type: V4L2_CTRL_TYPE_BOOLEAN, }, }; -static int NUM_CONTROLS = sizeof(controls)/sizeof(struct v4l2_queryctrl); +static +int NUM_CONTROLS = sizeof(controls)/sizeof(struct v4l2_queryctrl); #define V4L2_CID_PRIVATE_LASTP1 (V4L2_CID_PRIVATE_BASE + 0) -static struct v4l2_queryctrl* ctrl_by_id(int id) +static +struct v4l2_queryctrl* ctrl_by_id(int id) { int i; @@ -371,7 +381,8 @@ static struct v4l2_queryctrl* ctrl_by_id(int id) return NULL; } -static int get_control(struct saa7146_fh *fh, struct v4l2_control *c) +static +int get_control(struct saa7146_fh *fh, struct v4l2_control *c) { struct saa7146_dev *dev = fh->dev; const struct v4l2_queryctrl* ctrl; @@ -406,7 +417,8 @@ static int get_control(struct saa7146_fh *fh, struct v4l2_control *c) return 0; } -static int set_control(struct saa7146_fh *fh, struct v4l2_control *c) +static +int set_control(struct saa7146_fh *fh, struct v4l2_control *c) { struct saa7146_dev *dev = fh->dev; const struct v4l2_queryctrl* ctrl; @@ -494,6 +506,7 @@ static int set_control(struct saa7146_fh *fh, struct v4l2_control *c) /********************************************************************************/ /* common pagetable functions */ +static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *buf) { struct pci_dev *pci = dev->pci; @@ -593,6 +606,7 @@ int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *buf) /********************************************************************************/ /* file operations */ +static int video_begin(struct saa7146_fh *fh) { struct saa7146_dev *dev = fh->dev; @@ -625,6 +639,7 @@ int video_begin(struct saa7146_fh *fh) return 0; } +static int video_end(struct saa7146_fh *fh) { struct saa7146_dev *dev = fh->dev; @@ -1032,27 +1047,6 @@ int video_do_ioctl(struct inode *inode, struct file *file, video_do_ioctl); } return 0; -#ifdef axa - not supfhrted: - VIDIOC_RESERVED - VIDIOC_S_PARM - VIDIOC_G_OUTPUT - VIDIOC_S_OUTPUT - VIDIOC_CROPCAP - VIDIOC_G_CROP - VIDIOC_S_CROP - VIDIOC_G_JPEGCOMP - VIDIOC_S_JPEGCOMP - VIDIOC_ENUMOUTPUT - VIDIOC_G_AUDOUT - VIDIOC_S_AUDOUT - - VIDIOC_QUERYMENU - VIDIOC_G_MODULATOR - VIDIOC_S_MODULATOR - VIDIOC_QUERYSTD - /* --- control ioctls ---------------------------------------- */ -#endif } @@ -1151,8 +1145,9 @@ static int buffer_setup(struct file *file, int *count, int *size) { struct saa7146_fh *fh = file->private_data; +/* struct saa7146_dev *dev = fh->dev; - +*/ if (0 == *count || *count > MAX_SAA7146_CAPTURE_BUFFERS) *count = MAX_SAA7146_CAPTURE_BUFFERS; @@ -1172,7 +1167,9 @@ static void buffer_queue(struct file *file, struct videobuf_buffer *vb) { struct saa7146_fh *fh = file->private_data; +/* struct saa7146_dev *dev = fh->dev; +*/ struct saa7146_buf *buf = (struct saa7146_buf *)vb; DEB_CAP(("vbuf:%p\n",vb)); @@ -1191,7 +1188,8 @@ void buffer_release(struct file *file, struct videobuf_buffer *vb) saa7146_dma_free(dev,buf); } -static struct videobuf_queue_ops video_qops = { +static +struct videobuf_queue_ops video_qops = { .buf_setup = buffer_setup, .buf_prepare = buffer_prepare, .buf_queue = buffer_queue, @@ -1281,7 +1279,7 @@ void video_irq_done(struct saa7146_dev *dev, unsigned long st) static -static ssize_t video_read(struct file *file, char *data, size_t count, loff_t *ppos) +ssize_t video_read(struct file *file, char *data, size_t count, loff_t *ppos) { struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; diff --git a/linux/drivers/media/video/mxb.c b/linux/drivers/media/video/mxb.c index d7ad7cfd1..c9688cf9c 100644 --- a/linux/drivers/media/video/mxb.c +++ b/linux/drivers/media/video/mxb.c @@ -42,8 +42,7 @@ static int mxb_num = 0; static int freq = 4148; /* debug verbosity */ -/* fixme */ -static int debug = 247; +static int debug = 0; #ifdef MODULE MODULE_PARM(freq,"i"); @@ -52,8 +51,7 @@ MODULE_PARM(debug,"i"); MODULE_PARM_DESC(debug, "debug verbosity"); #endif - -#define MXB_INPUTS 4 +#define MXB_INPUTS 4 enum { TUNER, AUX1, AUX3, AUX3_YC }; static struct v4l2_input mxb_inputs[MXB_INPUTS] = { @@ -296,22 +294,26 @@ static int mxb_init_done(struct saa7146_dev* dev) 0x00, /* 17 - VBI */ }; - struct video_decoder_init saa7111a_init; struct i2c_msg msg; int i = 0, err = 0; struct tea6415c_video_multiplex vm; - memcpy(&saa7111a_init.data, &init, sizeof(init)); - saa7111a_init.count = sizeof(init); - /* write configuration to saa7111a */ - mxb->saa7111a->driver->command(mxb->saa7111a, DECODER_INIT, &saa7111a_init); + i = i2c_master_send(mxb->saa7111a, init, sizeof(init)); + if (i < 0) { + DEB_D(("failed to initialize saa7111a. this should never happen.\n")); + } + /* select tuner-output on saa7111a */ i = 0; mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_INPUT, &i); i = VIDEO_MODE_PAL; mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_NORM, &i); + + /* select a tuner type */ + i = 5; + mxb->tuner->driver->command(mxb->tuner,TUNER_SET_TYPE, &i); /* mute audio on tea6420s */ mxb->tea6420_1->driver->command(mxb->tea6420_1,TEA6420_SWITCH, &TEA6420_line[6][0]); @@ -934,76 +936,58 @@ static struct saa7146_sub_info sub_data[] = { { 0xffff, 0xffff }, }; -static struct saa7146_extension extension = { - MXB_IDENTIFIER, - MXB_INPUTS, - MXB_AUDIOS, - V4L2_CAP_TUNER, - - sub_data, - - THIS_MODULE, - +static +struct saa7146_extension extension = { + .name = MXB_IDENTIFIER, + .inputs = MXB_INPUTS, + .audios = MXB_AUDIOS, + .capabilities = V4L2_CAP_TUNER, + + .devices = &sub_data[0], + .module = THIS_MODULE, + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51) - mxb_inc_use, - mxb_dec_use, + .inc_use = mxb_inc_use, + .dec_use = mxb_dec_use, #endif - &standard[0], - sizeof(standard)/sizeof(struct saa7146_standard), - &std_callback, + .stds = &standard[0], + .num_stds = sizeof(standard)/sizeof(struct saa7146_standard), + .std_callback = &std_callback, - 1, - mxb_vbi_bypass, - - &ioctls[0], - - mxb_preinit, - mxb_probe, - mxb_attach, - mxb_detach, - - mxb_ioctl, + .use_kernel_i2c = 1, + .vbi = mxb_vbi_bypass, - 0, - NULL, -}; + .ioctls = &ioctls[0], + + .preinit = mxb_preinit, + .probe = mxb_probe, + .attach = mxb_attach, + .detach = mxb_detach, + .ioctl = mxb_ioctl, + + .irq_mask = 0, + .irq_func = NULL, +}; -static int mxb_init(void) +int __init mxb_init_module(void) { if( 0 != saa7146_register_extension(&extension)) { DEB_S(("failed to register extension.\n")); return -ENODEV; } - - /* mxb_num gets increased if the probe function is called successfully */ - - if( 0 == mxb_num ) { - INFO(("no mxb(s) found.\n")); - return -ENODEV; - } - - INFO(("%d mxb(s) found.\n", mxb_num)); + return 0; } -#ifdef MODULE -MODULE_AUTHOR("Michael Hunold <michael@mihu.de>"); -MODULE_DESCRIPTION("video4linux driver for the Siemens-Nixdorf 'Multimedia eXtension board'"); -MODULE_LICENSE("GPL"); - -EXPORT_NO_SYMBOLS; - -static int mxb_init_module(void) -{ - return mxb_init(); -} - -static void mxb_cleanup_module(void) +void __exit mxb_cleanup_module(void) { saa7146_unregister_extension(&extension); } module_init(mxb_init_module); module_exit(mxb_cleanup_module); -#endif + +MODULE_DESCRIPTION("video4linux driver for the Siemens-Nixdorf 'Multimedia eXtension board'"); +MODULE_AUTHOR("Michael Hunold <michael@mihu.de>"); +MODULE_LICENSE("GPL"); diff --git a/linux/drivers/media/video/saa7111.c b/linux/drivers/media/video/saa7111.c index 256654ad3..461e797cc 100644 --- a/linux/drivers/media/video/saa7111.c +++ b/linux/drivers/media/video/saa7111.c @@ -59,7 +59,7 @@ struct saa7111 { /* hmm, the saa7111(a) specs don't say anything about address 34>>1 (= 17 = 0x11), only for 0x24 and 0x25 ... */ -static unsigned short normal_i2c[] = { 34>>1, 0x24, 0x25, I2C_CLIENT_END }; +static unsigned short normal_i2c[] = { 0x24, 0x25, I2C_CLIENT_END }; static unsigned short normal_i2c_range[] = { I2C_CLIENT_END }; /* magic definition of all other variables and things */ |