X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmedia%2Fvideo%2Ftvp5150.c;h=dab4973bcf8261f4e5cd3eac842bec218e76f388;hb=9464c7cf61b9433057924c36e6e02f303a00e768;hp=b167ffab25202106da0bc956b8304430a48634e8;hpb=41689045f6a3cbe0550e1d34e9cc20d2e8c432ba;p=linux-2.6.git diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c index b167ffab2..dab4973bc 100644 --- a/drivers/media/video/tvp5150.c +++ b/drivers/media/video/tvp5150.c @@ -10,7 +10,6 @@ #include #include #include -#include #include "tvp5150_reg.h" @@ -90,7 +89,7 @@ struct tvp5150 { struct i2c_client *client; v4l2_std_id norm; /* Current set standard */ - struct v4l2_routing route; + int input; int enable; int bright; int contrast; @@ -284,26 +283,29 @@ 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) +static inline void tvp5150_selmux(struct i2c_client *c, + enum tvp5150_input input) { int opmode=0; + struct tvp5150 *decoder = i2c_get_clientdata(c); - int input = 0; - if ((decoder->route.output & TVP5150_BLACK_SCREEN) || !decoder->enable) - input = 8; + if (!decoder->enable) + input |= TVP5150_BLACK_SCREEN; switch (input) { - case TVP5150_COMPOSITE1: - input |= 2; - /* fall through */ - case TVP5150_COMPOSITE0: + case TVP5150_ANALOG_CH0: + case TVP5150_ANALOG_CH1: opmode=0x30; /* TV Mode */ break; - case TVP5150_SVIDEO: default: - input |= 1; opmode=0; /* Auto Mode */ break; } @@ -788,7 +790,7 @@ static inline void tvp5150_reset(struct i2c_client *c) tvp5150_vdp_init(c, vbi_ram_default); /* Selects decoder input */ - tvp5150_selmux(c); + tvp5150_selmux(c, decoder->input); /* Initializes TVP5150 to stream enabled values */ tvp5150_write_inittab(c, tvp5150_init_enable); @@ -858,21 +860,6 @@ 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; @@ -1076,7 +1063,7 @@ static int tvp5150_detect_client(struct i2c_adapter *adapter, rv = i2c_attach_client(c); core->norm = V4L2_STD_ALL; /* Default is autodetect */ - core->route.input = TVP5150_COMPOSITE1; + core->input = 2; core->enable = 1; core->bright = 32768; core->contrast = 32768;