diff options
author | Marco Schluessler <marco@lordzodiac.de> | 2007-01-21 17:43:38 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-02-21 10:34:47 -0500 |
commit | 4cbca185e9adf3d48205b60bf196ebb9882af043 (patch) | |
tree | 0f64c99188bf26c57c7a802247349aa57705e119 /drivers | |
parent | 9de271e66d1172e7fa68ba0a7ecec2f9fb8d78c1 (diff) |
V4L/DVB (5113): Adds video output routing
Nexus CA needs to use a different routing on saa7115 module.
Signed-off-by: Marco Schluessler <marco@lordzodiac.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/saa7115.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index c2374ed7ba9..389e518bc3e 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c | |||
@@ -71,6 +71,7 @@ I2C_CLIENT_INSMOD; | |||
71 | struct saa711x_state { | 71 | struct saa711x_state { |
72 | v4l2_std_id std; | 72 | v4l2_std_id std; |
73 | int input; | 73 | int input; |
74 | int output; | ||
74 | int enable; | 75 | int enable; |
75 | int radio; | 76 | int radio; |
76 | int bright; | 77 | int bright; |
@@ -1301,7 +1302,7 @@ static int saa711x_command(struct i2c_client *client, unsigned int cmd, void *ar | |||
1301 | struct v4l2_routing *route = arg; | 1302 | struct v4l2_routing *route = arg; |
1302 | 1303 | ||
1303 | route->input = state->input; | 1304 | route->input = state->input; |
1304 | route->output = 0; | 1305 | route->output = state->output; |
1305 | break; | 1306 | break; |
1306 | } | 1307 | } |
1307 | 1308 | ||
@@ -1309,7 +1310,7 @@ static int saa711x_command(struct i2c_client *client, unsigned int cmd, void *ar | |||
1309 | { | 1310 | { |
1310 | struct v4l2_routing *route = arg; | 1311 | struct v4l2_routing *route = arg; |
1311 | 1312 | ||
1312 | v4l_dbg(1, debug, client, "decoder set input %d\n", route->input); | 1313 | v4l_dbg(1, debug, client, "decoder set input %d output %d\n", route->input, route->output); |
1313 | /* saa7113 does not have these inputs */ | 1314 | /* saa7113 does not have these inputs */ |
1314 | if (state->ident == V4L2_IDENT_SAA7113 && | 1315 | if (state->ident == V4L2_IDENT_SAA7113 && |
1315 | (route->input == SAA7115_COMPOSITE4 || | 1316 | (route->input == SAA7115_COMPOSITE4 || |
@@ -1318,10 +1319,12 @@ static int saa711x_command(struct i2c_client *client, unsigned int cmd, void *ar | |||
1318 | } | 1319 | } |
1319 | if (route->input > SAA7115_SVIDEO3) | 1320 | if (route->input > SAA7115_SVIDEO3) |
1320 | return -EINVAL; | 1321 | return -EINVAL; |
1321 | if (state->input == route->input) | 1322 | if (route->output > SAA7115_IPORT_ON) |
1323 | return -EINVAL; | ||
1324 | if (state->input == route->input && state->output == route->output) | ||
1322 | break; | 1325 | break; |
1323 | v4l_dbg(1, debug, client, "now setting %s input\n", | 1326 | v4l_dbg(1, debug, client, "now setting %s input %s output\n", |
1324 | (route->input >= SAA7115_SVIDEO0) ? "S-Video" : "Composite"); | 1327 | (route->input >= SAA7115_SVIDEO0) ? "S-Video" : "Composite", (route->output == SAA7115_IPORT_ON) ? "iport on" : "iport off"); |
1325 | state->input = route->input; | 1328 | state->input = route->input; |
1326 | 1329 | ||
1327 | /* select mode */ | 1330 | /* select mode */ |
@@ -1333,6 +1336,14 @@ static int saa711x_command(struct i2c_client *client, unsigned int cmd, void *ar | |||
1333 | saa711x_write(client, R_09_LUMA_CNTL, | 1336 | saa711x_write(client, R_09_LUMA_CNTL, |
1334 | (saa711x_read(client, R_09_LUMA_CNTL) & 0x7f) | | 1337 | (saa711x_read(client, R_09_LUMA_CNTL) & 0x7f) | |
1335 | (state->input >= SAA7115_SVIDEO0 ? 0x80 : 0x0)); | 1338 | (state->input >= SAA7115_SVIDEO0 ? 0x80 : 0x0)); |
1339 | |||
1340 | state->output = route->output; | ||
1341 | if (state->ident == V4L2_IDENT_SAA7114 || | ||
1342 | state->ident == V4L2_IDENT_SAA7115) { | ||
1343 | saa711x_write(client, R_83_X_PORT_I_O_ENA_AND_OUT_CLK, | ||
1344 | (saa711x_read(client, R_83_X_PORT_I_O_ENA_AND_OUT_CLK) & 0xfe) | | ||
1345 | (state->output & 0x01)); | ||
1346 | } | ||
1336 | break; | 1347 | break; |
1337 | } | 1348 | } |
1338 | 1349 | ||
@@ -1492,6 +1503,7 @@ static int saa711x_attach(struct i2c_adapter *adapter, int address, int kind) | |||
1492 | return -ENOMEM; | 1503 | return -ENOMEM; |
1493 | } | 1504 | } |
1494 | state->input = -1; | 1505 | state->input = -1; |
1506 | state->output = SAA7115_IPORT_ON; | ||
1495 | state->enable = 1; | 1507 | state->enable = 1; |
1496 | state->radio = 0; | 1508 | state->radio = 0; |
1497 | state->bright = 128; | 1509 | state->bright = 128; |
@@ -1550,7 +1562,7 @@ static int saa711x_attach(struct i2c_adapter *adapter, int address, int kind) | |||
1550 | 1562 | ||
1551 | static int saa711x_probe(struct i2c_adapter *adapter) | 1563 | static int saa711x_probe(struct i2c_adapter *adapter) |
1552 | { | 1564 | { |
1553 | if (adapter->class & I2C_CLASS_TV_ANALOG) | 1565 | if (adapter->class & I2C_CLASS_TV_ANALOG || adapter->class & I2C_CLASS_TV_DIGITAL) |
1554 | return i2c_probe(adapter, &addr_data, &saa711x_attach); | 1566 | return i2c_probe(adapter, &addr_data, &saa711x_attach); |
1555 | return 0; | 1567 | return 0; |
1556 | } | 1568 | } |