diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 09:35:11 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 09:35:11 -0700 |
commit | 0851668fdd97e526b2a41f794b785c204dd3d3e0 (patch) | |
tree | 4ef7c20a8be8393006c6fe9627eb29dd30877d61 /drivers/staging/go7007 | |
parent | 00ebb6382b8d9c7c15b5f8ad230670d8161d38dd (diff) | |
parent | 7655e594945289b418af39f6669fea4666a7b520 (diff) | |
download | op-kernel-dev-0851668fdd97e526b2a41f794b785c204dd3d3e0.zip op-kernel-dev-0851668fdd97e526b2a41f794b785c204dd3d3e0.tar.gz |
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (505 commits)
[media] af9015: Fix max I2C message size when used with tda18271
[media] IR: initialize ir_raw_event in few more drivers
[media] Guard a divide in v4l1 compat layer
[media] imon: fix nomouse modprobe option
[media] imon: remove redundant change_protocol call
[media] imon: fix my egregious brown paper bag w/rdev/idev split
[media] cafe_ccic: Configure ov7670 correctly
[media] ov7670: allow configuration of image size, clock speed, and I/O method
[media] af9015: support for DigitalNow TinyTwin v3 [1f4d:9016]
[media] af9015: map DigitalNow TinyTwin v2 remote
[media] DigitalNow TinyTwin remote controller
[media] af9015: RC fixes and improvements
videodev2.h.xml: Update to reflect the latest changes at videodev2.h
[media] v4l: document new Bayer and monochrome pixel formats
[media] DocBook/v4l: Add missing formats used on gspca cpia1 and sn9c2028
[media] firedtv: add parameter to fake ca_system_ids in CA_INFO
[media] tm6000: fix a macro coding style issue
tm6000: Remove some ugly debug code
[media] Nova-S-Plus audio line input
[media] [RFC,1/1] V4L2: Use new CAP bits in existing RDS capable drivers
...
Diffstat (limited to 'drivers/staging/go7007')
-rw-r--r-- | drivers/staging/go7007/Kconfig | 2 | ||||
-rw-r--r-- | drivers/staging/go7007/go7007-driver.c | 55 | ||||
-rw-r--r-- | drivers/staging/go7007/go7007-usb.c | 2 | ||||
-rw-r--r-- | drivers/staging/go7007/go7007-v4l2.c | 19 | ||||
-rw-r--r-- | drivers/staging/go7007/s2250-board.c | 34 | ||||
-rw-r--r-- | drivers/staging/go7007/wis-ov7640.c | 1 | ||||
-rw-r--r-- | drivers/staging/go7007/wis-saa7113.c | 1 | ||||
-rw-r--r-- | drivers/staging/go7007/wis-saa7115.c | 1 | ||||
-rw-r--r-- | drivers/staging/go7007/wis-sony-tuner.c | 1 | ||||
-rw-r--r-- | drivers/staging/go7007/wis-tw2804.c | 1 | ||||
-rw-r--r-- | drivers/staging/go7007/wis-tw9903.c | 1 | ||||
-rw-r--r-- | drivers/staging/go7007/wis-uda1342.c | 1 |
12 files changed, 57 insertions, 62 deletions
diff --git a/drivers/staging/go7007/Kconfig b/drivers/staging/go7007/Kconfig index 75fa468..3aecd30 100644 --- a/drivers/staging/go7007/Kconfig +++ b/drivers/staging/go7007/Kconfig @@ -4,7 +4,7 @@ config VIDEO_GO7007 depends on BKL # please fix depends on SND select VIDEOBUF_DMA_SG - select VIDEO_IR + depends on VIDEO_IR select VIDEO_TUNER select VIDEO_TVEEPROM select SND_PCM diff --git a/drivers/staging/go7007/go7007-driver.c b/drivers/staging/go7007/go7007-driver.c index 372a7c6..b3f42f3 100644 --- a/drivers/staging/go7007/go7007-driver.c +++ b/drivers/staging/go7007/go7007-driver.c @@ -194,51 +194,15 @@ int go7007_reset_encoder(struct go7007 *go) * Attempt to instantiate an I2C client by ID, probably loading a module. */ static int init_i2c_module(struct i2c_adapter *adapter, const char *type, - int id, int addr) + int addr) { struct go7007 *go = i2c_get_adapdata(adapter); struct v4l2_device *v4l2_dev = &go->v4l2_dev; - char *modname; - switch (id) { - case I2C_DRIVERID_WIS_SAA7115: - modname = "wis-saa7115"; - break; - case I2C_DRIVERID_WIS_SAA7113: - modname = "wis-saa7113"; - break; - case I2C_DRIVERID_WIS_UDA1342: - modname = "wis-uda1342"; - break; - case I2C_DRIVERID_WIS_SONY_TUNER: - modname = "wis-sony-tuner"; - break; - case I2C_DRIVERID_WIS_TW9903: - modname = "wis-tw9903"; - break; - case I2C_DRIVERID_WIS_TW2804: - modname = "wis-tw2804"; - break; - case I2C_DRIVERID_WIS_OV7640: - modname = "wis-ov7640"; - break; - case I2C_DRIVERID_S2250: - modname = "s2250"; - break; - default: - modname = NULL; - break; - } - - if (v4l2_i2c_new_subdev(v4l2_dev, adapter, modname, type, addr, NULL)) + if (v4l2_i2c_new_subdev(v4l2_dev, adapter, NULL, type, addr, NULL)) return 0; - if (modname != NULL) - printk(KERN_INFO - "go7007: probing for module %s failed\n", modname); - else - printk(KERN_INFO - "go7007: sensor %u seems to be unsupported!\n", id); + printk(KERN_INFO "go7007: probing for module i2c:%s failed\n", type); return -1; } @@ -277,7 +241,6 @@ int go7007_register_encoder(struct go7007 *go) for (i = 0; i < go->board_info->num_i2c_devs; ++i) init_i2c_module(&go->i2c_adapter, go->board_info->i2c_devs[i].type, - go->board_info->i2c_devs[i].id, go->board_info->i2c_devs[i].addr); if (go->board_id == GO7007_BOARDID_ADLINK_MPG24) i2c_clients_command(&go->i2c_adapter, @@ -393,7 +356,8 @@ static void write_bitmap_word(struct go7007 *go) for (i = 0; i < 16; ++i) { y = (((go->parse_length - 1) << 3) + i) / (go->width >> 4); x = (((go->parse_length - 1) << 3) + i) % (go->width >> 4); - go->active_map[stride * y + (x >> 3)] |= + if (stride * y + (x >> 3) < sizeof(go->active_map)) + go->active_map[stride * y + (x >> 3)] |= (go->modet_word & 1) << (x & 0x7); go->modet_word >>= 1; } @@ -485,6 +449,15 @@ void go7007_parse_video_stream(struct go7007 *go, u8 *buf, int length) } break; case STATE_00_00_01: + if (buf[i] == 0xF8 && go->modet_enable == 0) { + /* MODET start code, but MODET not enabled */ + store_byte(go->active_buf, 0x00); + store_byte(go->active_buf, 0x00); + store_byte(go->active_buf, 0x01); + store_byte(go->active_buf, 0xF8); + go->state = STATE_DATA; + break; + } /* If this is the start of a new MPEG frame, * get a new buffer */ if ((go->format == GO7007_FORMAT_MPEG1 || diff --git a/drivers/staging/go7007/go7007-usb.c b/drivers/staging/go7007/go7007-usb.c index 20ed930..bea9f4d 100644 --- a/drivers/staging/go7007/go7007-usb.c +++ b/drivers/staging/go7007/go7007-usb.c @@ -394,7 +394,7 @@ static struct go7007_usb_board board_adlink_mpg24 = { .num_i2c_devs = 1, .i2c_devs = { { - .type = "wis_twTW2804", + .type = "wis_tw2804", .id = I2C_DRIVERID_WIS_TW2804, .addr = 0x00, /* yes, really */ }, diff --git a/drivers/staging/go7007/go7007-v4l2.c b/drivers/staging/go7007/go7007-v4l2.c index 46b4b9f..2b27d8d 100644 --- a/drivers/staging/go7007/go7007-v4l2.c +++ b/drivers/staging/go7007/go7007-v4l2.c @@ -252,23 +252,22 @@ static int set_capture_size(struct go7007 *go, struct v4l2_format *fmt, int try) go->modet_map[i] = 0; if (go->board_info->sensor_flags & GO7007_SENSOR_SCALING) { - struct v4l2_format res; + struct v4l2_mbus_framefmt mbus_fmt; - if (fmt != NULL) { - res = *fmt; - } else { - res.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - res.fmt.pix.width = width; - } + mbus_fmt.code = V4L2_MBUS_FMT_FIXED; + if (fmt != NULL) + mbus_fmt.width = fmt->fmt.pix.width; + else + mbus_fmt.width = width; if (height > sensor_height / 2) { - res.fmt.pix.height = height / 2; + mbus_fmt.height = height / 2; go->encoder_v_halve = 0; } else { - res.fmt.pix.height = height; + mbus_fmt.height = height; go->encoder_v_halve = 1; } - call_all(&go->v4l2_dev, video, s_fmt, &res); + call_all(&go->v4l2_dev, video, s_mbus_fmt, &mbus_fmt); } else { if (width <= sensor_width / 4) { go->encoder_h_halve = 1; diff --git a/drivers/staging/go7007/s2250-board.c b/drivers/staging/go7007/s2250-board.c index 93f2604..e7736a9 100644 --- a/drivers/staging/go7007/s2250-board.c +++ b/drivers/staging/go7007/s2250-board.c @@ -23,7 +23,6 @@ #include <linux/slab.h> #include <media/v4l2-device.h> #include <media/v4l2-common.h> -#include <media/v4l2-i2c-drv.h> #include <media/v4l2-subdev.h> #include "go7007-priv.h" @@ -479,12 +478,13 @@ static int s2250_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) return 0; } -static int s2250_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt) +static int s2250_s_mbus_fmt(struct v4l2_subdev *sd, + struct v4l2_mbus_framefmt *fmt) { struct s2250 *state = to_state(sd); struct i2c_client *client = v4l2_get_subdevdata(sd); - if (fmt->fmt.pix.height < 640) { + if (fmt->height < 640) { write_reg_fp(client, 0x12b, state->reg12b_val | 0x400); write_reg_fp(client, 0x140, 0x060); } else { @@ -555,7 +555,7 @@ static const struct v4l2_subdev_audio_ops s2250_audio_ops = { static const struct v4l2_subdev_video_ops s2250_video_ops = { .s_routing = s2250_s_video_routing, - .s_fmt = s2250_s_fmt, + .s_mbus_fmt = s2250_s_mbus_fmt, }; static const struct v4l2_subdev_ops s2250_ops = { @@ -674,9 +674,25 @@ static const struct i2c_device_id s2250_id[] = { }; MODULE_DEVICE_TABLE(i2c, s2250_id); -static struct v4l2_i2c_driver_data v4l2_i2c_data = { - .name = "s2250", - .probe = s2250_probe, - .remove = s2250_remove, - .id_table = s2250_id, +static struct i2c_driver s2250_driver = { + .driver = { + .owner = THIS_MODULE, + .name = "s2250", + }, + .probe = s2250_probe, + .remove = s2250_remove, + .id_table = s2250_id, }; + +static __init int init_s2250(void) +{ + return i2c_add_driver(&s2250_driver); +} + +static __exit void exit_s2250(void) +{ + i2c_del_driver(&s2250_driver); +} + +module_init(init_s2250); +module_exit(exit_s2250); diff --git a/drivers/staging/go7007/wis-ov7640.c b/drivers/staging/go7007/wis-ov7640.c index 4f0cbdd..6bc9470 100644 --- a/drivers/staging/go7007/wis-ov7640.c +++ b/drivers/staging/go7007/wis-ov7640.c @@ -81,6 +81,7 @@ static const struct i2c_device_id wis_ov7640_id[] = { { "wis_ov7640", 0 }, { } }; +MODULE_DEVICE_TABLE(i2c, wis_ov7640_id); static struct i2c_driver wis_ov7640_driver = { .driver = { diff --git a/drivers/staging/go7007/wis-saa7113.c b/drivers/staging/go7007/wis-saa7113.c index 72f5c1f..05e0e10 100644 --- a/drivers/staging/go7007/wis-saa7113.c +++ b/drivers/staging/go7007/wis-saa7113.c @@ -308,6 +308,7 @@ static const struct i2c_device_id wis_saa7113_id[] = { { "wis_saa7113", 0 }, { } }; +MODULE_DEVICE_TABLE(i2c, wis_saa7113_id); static struct i2c_driver wis_saa7113_driver = { .driver = { diff --git a/drivers/staging/go7007/wis-saa7115.c b/drivers/staging/go7007/wis-saa7115.c index cd950b6..46cff59 100644 --- a/drivers/staging/go7007/wis-saa7115.c +++ b/drivers/staging/go7007/wis-saa7115.c @@ -441,6 +441,7 @@ static const struct i2c_device_id wis_saa7115_id[] = { { "wis_saa7115", 0 }, { } }; +MODULE_DEVICE_TABLE(i2c, wis_saa7115_id); static struct i2c_driver wis_saa7115_driver = { .driver = { diff --git a/drivers/staging/go7007/wis-sony-tuner.c b/drivers/staging/go7007/wis-sony-tuner.c index 981c9b3..8f1b7d4 100644 --- a/drivers/staging/go7007/wis-sony-tuner.c +++ b/drivers/staging/go7007/wis-sony-tuner.c @@ -692,6 +692,7 @@ static const struct i2c_device_id wis_sony_tuner_id[] = { { "wis_sony_tuner", 0 }, { } }; +MODULE_DEVICE_TABLE(i2c, wis_sony_tuner_id); static struct i2c_driver wis_sony_tuner_driver = { .driver = { diff --git a/drivers/staging/go7007/wis-tw2804.c b/drivers/staging/go7007/wis-tw2804.c index ee28a99..5b218c5 100644 --- a/drivers/staging/go7007/wis-tw2804.c +++ b/drivers/staging/go7007/wis-tw2804.c @@ -331,6 +331,7 @@ static const struct i2c_device_id wis_tw2804_id[] = { { "wis_tw2804", 0 }, { } }; +MODULE_DEVICE_TABLE(i2c, wis_tw2804_id); static struct i2c_driver wis_tw2804_driver = { .driver = { diff --git a/drivers/staging/go7007/wis-tw9903.c b/drivers/staging/go7007/wis-tw9903.c index 80d4726..9230f4a 100644 --- a/drivers/staging/go7007/wis-tw9903.c +++ b/drivers/staging/go7007/wis-tw9903.c @@ -313,6 +313,7 @@ static const struct i2c_device_id wis_tw9903_id[] = { { "wis_tw9903", 0 }, { } }; +MODULE_DEVICE_TABLE(i2c, wis_tw9903_id); static struct i2c_driver wis_tw9903_driver = { .driver = { diff --git a/drivers/staging/go7007/wis-uda1342.c b/drivers/staging/go7007/wis-uda1342.c index 5c4eb49..0127be2 100644 --- a/drivers/staging/go7007/wis-uda1342.c +++ b/drivers/staging/go7007/wis-uda1342.c @@ -86,6 +86,7 @@ static const struct i2c_device_id wis_uda1342_id[] = { { "wis_uda1342", 0 }, { } }; +MODULE_DEVICE_TABLE(i2c, wis_uda1342_id); static struct i2c_driver wis_uda1342_driver = { .driver = { |