Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29837
b: refs/heads/master
c: c7c0b34
h: refs/heads/master
i:
  29835: c9f9ed7
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Jun 25, 2006
1 parent 44d27c2 commit c1c17d0
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 80 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: b7f8292c96463810edfecff70dd4631d47e5a36b
refs/heads/master: c7c0b34c27bbf0671807e902fbfea6270c8f138d
58 changes: 30 additions & 28 deletions trunk/drivers/media/video/em28xx/em28xx-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <linux/usb.h>
#include <media/tuner.h>
#include <media/msp3400.h>
#include <media/saa7115.h>
#include <media/tvp5150.h>
#include <media/tveeprom.h>
#include <media/audiochip.h>
#include <media/v4l2-common.h>
Expand All @@ -46,11 +48,11 @@ struct em28xx_board em28xx_boards[] = {
.decoder = EM28XX_SAA7113,
.input = {{
.type = EM28XX_VMUX_COMPOSITE1,
.vmux = 0,
.vmux = SAA7115_COMPOSITE0,
.amux = 1,
},{
.type = EM28XX_VMUX_SVIDEO,
.vmux = 9,
.vmux = SAA7115_SVIDEO3,
.amux = 1,
}},
},
Expand All @@ -64,11 +66,11 @@ struct em28xx_board em28xx_boards[] = {
.decoder = EM28XX_SAA7113,
.input = {{
.type = EM28XX_VMUX_COMPOSITE1,
.vmux = 0,
.vmux = SAA7115_COMPOSITE0,
.amux = 1,
},{
.type = EM28XX_VMUX_SVIDEO,
.vmux = 9,
.vmux = SAA7115_SVIDEO3,
.amux = 1,
}},
},
Expand All @@ -82,11 +84,11 @@ struct em28xx_board em28xx_boards[] = {
.decoder = EM28XX_SAA7113,
.input = {{
.type = EM28XX_VMUX_COMPOSITE1,
.vmux = 0,
.vmux = SAA7115_COMPOSITE0,
.amux = 1,
},{
.type = EM28XX_VMUX_SVIDEO,
.vmux = 9,
.vmux = SAA7115_SVIDEO3,
.amux = 1,
}},
},
Expand All @@ -100,15 +102,15 @@ struct em28xx_board em28xx_boards[] = {
.decoder = EM28XX_SAA7113,
.input = {{
.type = EM28XX_VMUX_TELEVISION,
.vmux = 2,
.vmux = SAA7115_COMPOSITE2,
.amux = 1,
},{
.type = EM28XX_VMUX_COMPOSITE1,
.vmux = 0,
.vmux = SAA7115_COMPOSITE0,
.amux = 1,
},{
.type = EM28XX_VMUX_SVIDEO,
.vmux = 9,
.vmux = SAA7115_SVIDEO3,
.amux = 1,
}},
},
Expand All @@ -122,15 +124,15 @@ struct em28xx_board em28xx_boards[] = {
.decoder = EM28XX_SAA7113,
.input = {{
.type = EM28XX_VMUX_TELEVISION,
.vmux = 2,
.vmux = SAA7115_COMPOSITE2,
.amux = 0,
},{
.type = EM28XX_VMUX_COMPOSITE1,
.vmux = 0,
.vmux = SAA7115_COMPOSITE0,
.amux = 1,
},{
.type = EM28XX_VMUX_SVIDEO,
.vmux = 9,
.vmux = SAA7115_SVIDEO3,
.amux = 1,
}},
},
Expand All @@ -146,11 +148,11 @@ struct em28xx_board em28xx_boards[] = {
/*FIXME: S-Video not tested */
.input = {{
.type = EM28XX_VMUX_TELEVISION,
.vmux = 0,
.vmux = TVP5150_COMPOSITE0,
.amux = MSP_INPUT_DEFAULT,
},{
.type = EM28XX_VMUX_SVIDEO,
.vmux = 2,
.vmux = TVP5150_SVIDEO,
.amux = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1,
MSP_DSP_IN_SCART, MSP_DSP_IN_SCART),
}},
Expand All @@ -165,15 +167,15 @@ struct em28xx_board em28xx_boards[] = {
.decoder = EM28XX_SAA7114,
.input = {{
.type = EM28XX_VMUX_TELEVISION,
.vmux = 4,
.vmux = SAA7115_COMPOSITE4,
.amux = 0,
},{
.type = EM28XX_VMUX_COMPOSITE1,
.vmux = 0,
.vmux = SAA7115_COMPOSITE0,
.amux = 1,
},{
.type = EM28XX_VMUX_SVIDEO,
.vmux = 9,
.vmux = SAA7115_SVIDEO3,
.amux = 1,
}},
},
Expand All @@ -188,15 +190,15 @@ struct em28xx_board em28xx_boards[] = {
.decoder = EM28XX_SAA7113,
.input = {{
.type = EM28XX_VMUX_TELEVISION,
.vmux = 2,
.vmux = SAA7115_COMPOSITE2,
.amux = 0,
},{
.type = EM28XX_VMUX_COMPOSITE1,
.vmux = 0,
.vmux = SAA7115_COMPOSITE0,
.amux = 1,
},{
.type = EM28XX_VMUX_SVIDEO,
.vmux = 9,
.vmux = SAA7115_SVIDEO3,
.amux = 1,
}},
},
Expand All @@ -211,15 +213,15 @@ struct em28xx_board em28xx_boards[] = {
.decoder = EM28XX_SAA7113,
.input = {{
.type = EM28XX_VMUX_TELEVISION,
.vmux = 2,
.vmux = SAA7115_COMPOSITE2,
.amux = 0,
},{
.type = EM28XX_VMUX_COMPOSITE1,
.vmux = 0,
.vmux = SAA7115_COMPOSITE0,
.amux = 1,
},{
.type = EM28XX_VMUX_SVIDEO,
.vmux = 9,
.vmux = SAA7115_SVIDEO3,
.amux = 1,
}},
},
Expand All @@ -234,15 +236,15 @@ struct em28xx_board em28xx_boards[] = {
.decoder = EM28XX_SAA7113,
.input = {{
.type = EM28XX_VMUX_TELEVISION,
.vmux = 2,
.vmux = SAA7115_COMPOSITE2,
.amux = 0,
},{
.type = EM28XX_VMUX_COMPOSITE1,
.vmux = 0,
.vmux = SAA7115_COMPOSITE0,
.amux = 1,
},{
.type = EM28XX_VMUX_SVIDEO,
.vmux = 9,
.vmux = SAA7115_SVIDEO3,
.amux = 1,
}},
},
Expand All @@ -254,11 +256,11 @@ struct em28xx_board em28xx_boards[] = {
.decoder = EM28XX_SAA7113,
.input = {{
.type = EM28XX_VMUX_COMPOSITE1,
.vmux = 0,
.vmux = SAA7115_COMPOSITE0,
.amux = 1,
},{
.type = EM28XX_VMUX_SVIDEO,
.vmux = 9,
.vmux = SAA7115_SVIDEO3,
.amux = 1,
}},
},
Expand Down
18 changes: 11 additions & 7 deletions trunk/drivers/media/video/em28xx/em28xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,12 @@ static int em28xx_config(struct em28xx *dev)
static void em28xx_config_i2c(struct em28xx *dev)
{
struct v4l2_frequency f;
struct v4l2_routing route;

route.input = INPUT(dev->ctl_input)->vmux;
route.output = 0;
em28xx_i2c_call_clients(dev, VIDIOC_INT_RESET, NULL);
em28xx_i2c_call_clients(dev, VIDIOC_S_INPUT, &dev->ctl_input);
em28xx_i2c_call_clients(dev, VIDIOC_INT_S_VIDEO_ROUTING, &route);
em28xx_i2c_call_clients(dev, VIDIOC_STREAMON, NULL);

/* configure tuner */
Expand Down Expand Up @@ -206,19 +210,19 @@ static void em28xx_empty_framequeues(struct em28xx *dev)

static void video_mux(struct em28xx *dev, int index)
{
int input, ainput;
int ainput;
struct v4l2_routing route;

input = INPUT(index)->vmux;
route.input = INPUT(index)->vmux;
route.output = 0;
dev->ctl_input = index;
dev->ctl_ainput = INPUT(index)->amux;

em28xx_i2c_call_clients(dev, VIDIOC_S_INPUT, &input);
em28xx_i2c_call_clients(dev, VIDIOC_INT_S_VIDEO_ROUTING, &route);

em28xx_videodbg("Setting input index=%d, vmux=%d, amux=%d\n",index,input,dev->ctl_ainput);
em28xx_videodbg("Setting input index=%d, vmux=%d, amux=%d\n",index,route.input,dev->ctl_ainput);

if (dev->has_msp34xx) {
struct v4l2_routing route;

if (dev->i2s_speed)
em28xx_i2c_call_clients(dev, VIDIOC_INT_I2S_CLOCK_FREQ, &dev->i2s_speed);
route.input = dev->ctl_ainput;
Expand Down
28 changes: 0 additions & 28 deletions trunk/drivers/media/video/saa7115.c
Original file line number Diff line number Diff line change
Expand Up @@ -1238,34 +1238,6 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
break;
}

case VIDIOC_G_INPUT:
*(int *)arg = state->input;
break;

case VIDIOC_S_INPUT:
v4l_dbg(1, debug, client, "decoder set input %d\n", *iarg);
/* inputs from 0-9 are available */
if (*iarg < 0 || *iarg > 9) {
return -EINVAL;
}

if (state->input == *iarg)
break;
v4l_dbg(1, debug, client, "now setting %s input\n",
*iarg >= 6 ? "S-Video" : "Composite");
state->input = *iarg;

/* select mode */
saa7115_write(client, 0x02,
(saa7115_read(client, 0x02) & 0xf0) |
state->input);

/* bypass chrominance trap for modes 6..9 */
saa7115_write(client, 0x09,
(saa7115_read(client, 0x09) & 0x7f) |
(state->input < 6 ? 0x0 : 0x80));
break;

case VIDIOC_STREAMON:
case VIDIOC_STREAMOFF:
v4l_dbg(1, debug, client, "%s output\n",
Expand Down
45 changes: 29 additions & 16 deletions trunk/drivers/media/video/tvp5150.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <linux/delay.h>
#include <linux/video_decoder.h>
#include <media/v4l2-common.h>
#include <media/tvp5150.h>

#include "tvp5150_reg.h"

Expand Down Expand Up @@ -89,7 +90,7 @@ struct tvp5150 {
struct i2c_client *client;

v4l2_std_id norm; /* Current set standard */
int input;
struct v4l2_routing route;
int enable;
int bright;
int contrast;
Expand Down Expand Up @@ -283,29 +284,26 @@ static void dump_reg(struct i2c_client *c)
/****************************************************************************
Basic functions
****************************************************************************/
enum tvp5150_input {
TVP5150_ANALOG_CH0 = 0,
TVP5150_SVIDEO = 1,
TVP5150_ANALOG_CH1 = 2,
TVP5150_BLACK_SCREEN = 8
};

static inline void tvp5150_selmux(struct i2c_client *c,
enum tvp5150_input input)
static inline void tvp5150_selmux(struct i2c_client *c)
{
int opmode=0;

struct tvp5150 *decoder = i2c_get_clientdata(c);
int input = 0;

if (!decoder->enable)
input |= TVP5150_BLACK_SCREEN;
if ((decoder->route.output & TVP5150_BLACK_SCREEN) || !decoder->enable)
input = 8;

switch (input) {
case TVP5150_ANALOG_CH0:
case TVP5150_ANALOG_CH1:
case TVP5150_COMPOSITE1:
input |= 2;
/* fall through */
case TVP5150_COMPOSITE0:
opmode=0x30; /* TV Mode */
break;
case TVP5150_SVIDEO:
default:
input |= 1;
opmode=0; /* Auto Mode */
break;
}
Expand Down Expand Up @@ -790,7 +788,7 @@ static inline void tvp5150_reset(struct i2c_client *c)
tvp5150_vdp_init(c, vbi_ram_default);

/* Selects decoder input */
tvp5150_selmux(c, decoder->input);
tvp5150_selmux(c);

/* Initializes TVP5150 to stream enabled values */
tvp5150_write_inittab(c, tvp5150_init_enable);
Expand Down Expand Up @@ -860,6 +858,21 @@ static int tvp5150_command(struct i2c_client *c,
case VIDIOC_INT_RESET:
tvp5150_reset(c);
break;
case VIDIOC_INT_G_VIDEO_ROUTING:
{
struct v4l2_routing *route = arg;

*route = decoder->route;
break;
}
case VIDIOC_INT_S_VIDEO_ROUTING:
{
struct v4l2_routing *route = arg;

decoder->route = *route;
tvp5150_selmux(c);
break;
}
case VIDIOC_S_STD:
if (decoder->norm == *(v4l2_std_id *)arg)
break;
Expand Down Expand Up @@ -1063,7 +1076,7 @@ static int tvp5150_detect_client(struct i2c_adapter *adapter,
rv = i2c_attach_client(c);

core->norm = V4L2_STD_ALL; /* Default is autodetect */
core->input = 2;
core->route.input = TVP5150_COMPOSITE1;
core->enable = 1;
core->bright = 32768;
core->contrast = 32768;
Expand Down
Loading

0 comments on commit c1c17d0

Please sign in to comment.