Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 333854
b: refs/heads/master
c: 56a960b
h: refs/heads/master
v: v3
  • Loading branch information
Ezequiel Garcia authored and Mauro Carvalho Chehab committed Oct 10, 2012
1 parent e965212 commit 7f644b5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d6d022e7382343b57184c83f5fea0532be240b98
refs/heads/master: 56a960bf3fedc7dcf72ae072a64ffffe584e1f0e
15 changes: 11 additions & 4 deletions trunk/drivers/media/usb/stk1160/stk1160-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,21 @@ int stk1160_write_reg(struct stk1160 *dev, u16 reg, u16 value)

void stk1160_select_input(struct stk1160 *dev)
{
int route;
static const u8 gctrl[] = {
0x98, 0x90, 0x88, 0x80
0x98, 0x90, 0x88, 0x80, 0x98
};

if (dev->ctl_input < ARRAY_SIZE(gctrl))
if (dev->ctl_input == STK1160_SVIDEO_INPUT)
route = SAA7115_SVIDEO3;
else
route = SAA7115_COMPOSITE0;

if (dev->ctl_input < ARRAY_SIZE(gctrl)) {
v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_routing,
route, 0, 0);
stk1160_write_reg(dev, STK1160_GCTRL, gctrl[dev->ctl_input]);
}
}

/* TODO: We should break this into pieces */
Expand Down Expand Up @@ -351,8 +360,6 @@ static int stk1160_probe(struct usb_interface *interface,

/* i2c reset saa711x */
v4l2_device_call_all(&dev->v4l2_dev, 0, core, reset, 0);
v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_routing,
0, 0, 0);
v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_stream, 0);

/* reset stk1160 to default values */
Expand Down
7 changes: 6 additions & 1 deletion trunk/drivers/media/usb/stk1160/stk1160-v4l.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,12 @@ static int vidioc_enum_input(struct file *file, void *priv,
if (i->index > STK1160_MAX_INPUT)
return -EINVAL;

sprintf(i->name, "Composite%d", i->index);
/* S-Video special handling */
if (i->index == STK1160_SVIDEO_INPUT)
sprintf(i->name, "S-Video");
else
sprintf(i->name, "Composite%d", i->index);

i->type = V4L2_INPUT_TYPE_CAMERA;
i->std = dev->vdev.tvnorms;
return 0;
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/media/usb/stk1160/stk1160.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@

#define STK1160_MIN_PKT_SIZE 3072

#define STK1160_MAX_INPUT 3
#define STK1160_MAX_INPUT 4
#define STK1160_SVIDEO_INPUT 4

#define STK1160_I2C_TIMEOUT 100

Expand Down

0 comments on commit 7f644b5

Please sign in to comment.