aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/sn9c20x.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-15 15:49:56 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-15 15:49:56 -0500
commit122804ecb59493fbb4d31b3ba9ac59faaf45276f (patch)
treecff4d8a158c412e4a8d3abc8d91bb0eb52b01c9a /drivers/media/video/gspca/sn9c20x.c
parent16008d641670571ff4cd750b416c7caf2d89f467 (diff)
parent126400033940afb658123517a2e80eb68259fbd7 (diff)
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (655 commits) [media] revert patch: HDIC HD29L2 DMB-TH USB2.0 reference design driver mb86a20s: Add a few more register settings at the init seq mb86a20s: Group registers into the same line [media] [PATCH] don't reset the delivery system on DTV_CLEAR [media] [BUG] it913x-fe fix typo error making SNR levels unstable [media] cx23885: Query the CX25840 during enum_input for status [media] cx25840: Add support for g_input_status [media] rc-videomate-m1f.c Rename to match remote controler name [media] drivers: media: au0828: Fix dependency for VIDEO_AU0828 [media] convert drivers/media/* to use module_platform_driver() [media] drivers: video: cx231xx: Fix dependency for VIDEO_CX231XX_DVB [media] Exynos4 JPEG codec v4l2 driver [media] doc: v4l: selection: choose pixels as units for selection rectangles [media] v4l: s5p-tv: mixer: fix setup of VP scaling [media] v4l: s5p-tv: mixer: add support for selection API [media] v4l: emulate old crop API using extended crop/compose API [media] doc: v4l: add documentation for selection API [media] doc: v4l: add binary images for selection API [media] v4l: add support for selection api [media] hd29l2: fix review findings ...
Diffstat (limited to 'drivers/media/video/gspca/sn9c20x.c')
-rw-r--r--drivers/media/video/gspca/sn9c20x.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/media/video/gspca/sn9c20x.c b/drivers/media/video/gspca/sn9c20x.c
index 33cabc342dcf..9e198b45c3c8 100644
--- a/drivers/media/video/gspca/sn9c20x.c
+++ b/drivers/media/video/gspca/sn9c20x.c
@@ -2048,6 +2048,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
2048 struct cam *cam; 2048 struct cam *cam;
2049 2049
2050 cam = &gspca_dev->cam; 2050 cam = &gspca_dev->cam;
2051 cam->needs_full_bandwidth = 1;
2051 2052
2052 sd->sensor = (id->driver_info >> 8) & 0xff; 2053 sd->sensor = (id->driver_info >> 8) & 0xff;
2053 sd->i2c_addr = id->driver_info & 0xff; 2054 sd->i2c_addr = id->driver_info & 0xff;
@@ -2233,6 +2234,42 @@ static void configure_sensor_output(struct gspca_dev *gspca_dev, int mode)
2233 } 2234 }
2234} 2235}
2235 2236
2237static int sd_isoc_init(struct gspca_dev *gspca_dev)
2238{
2239 struct usb_interface *intf;
2240 u32 flags = gspca_dev->cam.cam_mode[(int)gspca_dev->curr_mode].priv;
2241
2242 /*
2243 * When using the SN9C20X_I420 fmt the sn9c20x needs more bandwidth
2244 * than our regular bandwidth calculations reserve, so we force the
2245 * use of a specific altsetting when using the SN9C20X_I420 fmt.
2246 */
2247 if (!(flags & (MODE_RAW | MODE_JPEG))) {
2248 intf = usb_ifnum_to_if(gspca_dev->dev, gspca_dev->iface);
2249
2250 if (intf->num_altsetting != 9) {
2251 pr_warn("sn9c20x camera with unknown number of alt "
2252 "settings (%d), please report!\n",
2253 intf->num_altsetting);
2254 gspca_dev->alt = intf->num_altsetting;
2255 return 0;
2256 }
2257
2258 switch (gspca_dev->width) {
2259 case 160: /* 160x120 */
2260 gspca_dev->alt = 2;
2261 break;
2262 case 320: /* 320x240 */
2263 gspca_dev->alt = 6;
2264 break;
2265 default: /* >= 640x480 */
2266 gspca_dev->alt = 9;
2267 }
2268 }
2269
2270 return 0;
2271}
2272
2236#define HW_WIN(mode, hstart, vstart) \ 2273#define HW_WIN(mode, hstart, vstart) \
2237((const u8 []){hstart, 0, vstart, 0, \ 2274((const u8 []){hstart, 0, vstart, 0, \
2238(mode & MODE_SXGA ? 1280 >> 4 : 640 >> 4), \ 2275(mode & MODE_SXGA ? 1280 >> 4 : 640 >> 4), \
@@ -2473,6 +2510,7 @@ static const struct sd_desc sd_desc = {
2473 .nctrls = ARRAY_SIZE(sd_ctrls), 2510 .nctrls = ARRAY_SIZE(sd_ctrls),
2474 .config = sd_config, 2511 .config = sd_config,
2475 .init = sd_init, 2512 .init = sd_init,
2513 .isoc_init = sd_isoc_init,
2476 .start = sd_start, 2514 .start = sd_start,
2477 .stopN = sd_stopN, 2515 .stopN = sd_stopN,
2478 .pkt_scan = sd_pkt_scan, 2516 .pkt_scan = sd_pkt_scan,