aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/stk1160
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/usb/stk1160')
-rw-r--r--drivers/media/usb/stk1160/stk1160-core.c15
-rw-r--r--drivers/media/usb/stk1160/stk1160-v4l.c7
-rw-r--r--drivers/media/usb/stk1160/stk1160.h3
3 files changed, 19 insertions, 6 deletions
diff --git a/drivers/media/usb/stk1160/stk1160-core.c b/drivers/media/usb/stk1160/stk1160-core.c
index b62740846061..34a26e0cfe77 100644
--- a/drivers/media/usb/stk1160/stk1160-core.c
+++ b/drivers/media/usb/stk1160/stk1160-core.c
@@ -100,12 +100,21 @@ int stk1160_write_reg(struct stk1160 *dev, u16 reg, u16 value)
100 100
101void stk1160_select_input(struct stk1160 *dev) 101void stk1160_select_input(struct stk1160 *dev)
102{ 102{
103 int route;
103 static const u8 gctrl[] = { 104 static const u8 gctrl[] = {
104 0x98, 0x90, 0x88, 0x80 105 0x98, 0x90, 0x88, 0x80, 0x98
105 }; 106 };
106 107
107 if (dev->ctl_input < ARRAY_SIZE(gctrl)) 108 if (dev->ctl_input == STK1160_SVIDEO_INPUT)
109 route = SAA7115_SVIDEO3;
110 else
111 route = SAA7115_COMPOSITE0;
112
113 if (dev->ctl_input < ARRAY_SIZE(gctrl)) {
114 v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_routing,
115 route, 0, 0);
108 stk1160_write_reg(dev, STK1160_GCTRL, gctrl[dev->ctl_input]); 116 stk1160_write_reg(dev, STK1160_GCTRL, gctrl[dev->ctl_input]);
117 }
109} 118}
110 119
111/* TODO: We should break this into pieces */ 120/* TODO: We should break this into pieces */
@@ -351,8 +360,6 @@ static int stk1160_probe(struct usb_interface *interface,
351 360
352 /* i2c reset saa711x */ 361 /* i2c reset saa711x */
353 v4l2_device_call_all(&dev->v4l2_dev, 0, core, reset, 0); 362 v4l2_device_call_all(&dev->v4l2_dev, 0, core, reset, 0);
354 v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_routing,
355 0, 0, 0);
356 v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_stream, 0); 363 v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_stream, 0);
357 364
358 /* reset stk1160 to default values */ 365 /* reset stk1160 to default values */
diff --git a/drivers/media/usb/stk1160/stk1160-v4l.c b/drivers/media/usb/stk1160/stk1160-v4l.c
index fe6e857969ca..6694f9e2ca57 100644
--- a/drivers/media/usb/stk1160/stk1160-v4l.c
+++ b/drivers/media/usb/stk1160/stk1160-v4l.c
@@ -419,7 +419,12 @@ static int vidioc_enum_input(struct file *file, void *priv,
419 if (i->index > STK1160_MAX_INPUT) 419 if (i->index > STK1160_MAX_INPUT)
420 return -EINVAL; 420 return -EINVAL;
421 421
422 sprintf(i->name, "Composite%d", i->index); 422 /* S-Video special handling */
423 if (i->index == STK1160_SVIDEO_INPUT)
424 sprintf(i->name, "S-Video");
425 else
426 sprintf(i->name, "Composite%d", i->index);
427
423 i->type = V4L2_INPUT_TYPE_CAMERA; 428 i->type = V4L2_INPUT_TYPE_CAMERA;
424 i->std = dev->vdev.tvnorms; 429 i->std = dev->vdev.tvnorms;
425 return 0; 430 return 0;
diff --git a/drivers/media/usb/stk1160/stk1160.h b/drivers/media/usb/stk1160/stk1160.h
index 3feba0033f98..68c8707d36ab 100644
--- a/drivers/media/usb/stk1160/stk1160.h
+++ b/drivers/media/usb/stk1160/stk1160.h
@@ -46,7 +46,8 @@
46 46
47#define STK1160_MIN_PKT_SIZE 3072 47#define STK1160_MIN_PKT_SIZE 3072
48 48
49#define STK1160_MAX_INPUT 3 49#define STK1160_MAX_INPUT 4
50#define STK1160_SVIDEO_INPUT 4
50 51
51#define STK1160_I2C_TIMEOUT 100 52#define STK1160_I2C_TIMEOUT 100
52 53