Commit 515432aa authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

V4L/DVB (3191): Fix CC output

- CC data was swapped the wrong way around.
- Enabling CC disabled XDS and vice versa: these two should
be independent from one another.
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@brturbo.com.br>
parent 7bb95296
...@@ -389,7 +389,7 @@ static int saa7127_set_vps(struct i2c_client *client, struct v4l2_sliced_vbi_dat ...@@ -389,7 +389,7 @@ static int saa7127_set_vps(struct i2c_client *client, struct v4l2_sliced_vbi_dat
static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data *data) static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data *data)
{ {
struct saa7127_state *state = i2c_get_clientdata(client); struct saa7127_state *state = i2c_get_clientdata(client);
u16 cc = data->data[0] << 8 | data->data[1]; u16 cc = data->data[1] << 8 | data->data[0];
int enable = (data->line != 0); int enable = (data->line != 0);
if (enable && (data->field != 0 || data->line != 21)) if (enable && (data->field != 0 || data->line != 21))
...@@ -397,7 +397,7 @@ static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data ...@@ -397,7 +397,7 @@ static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data
if (state->cc_enable != enable) { if (state->cc_enable != enable) {
saa7127_dbg("Turn CC %s\n", enable ? "on" : "off"); saa7127_dbg("Turn CC %s\n", enable ? "on" : "off");
saa7127_write(client, SAA7127_REG_CLOSED_CAPTION, saa7127_write(client, SAA7127_REG_CLOSED_CAPTION,
(enable << 6) | 0x11); (state->xds_enable << 7) | (enable << 6) | 0x11);
state->cc_enable = enable; state->cc_enable = enable;
} }
if (!enable) if (!enable)
...@@ -423,7 +423,7 @@ static int saa7127_set_xds(struct i2c_client *client, struct v4l2_sliced_vbi_dat ...@@ -423,7 +423,7 @@ static int saa7127_set_xds(struct i2c_client *client, struct v4l2_sliced_vbi_dat
if (state->xds_enable != enable) { if (state->xds_enable != enable) {
saa7127_dbg("Turn XDS %s\n", enable ? "on" : "off"); saa7127_dbg("Turn XDS %s\n", enable ? "on" : "off");
saa7127_write(client, SAA7127_REG_CLOSED_CAPTION, saa7127_write(client, SAA7127_REG_CLOSED_CAPTION,
(enable << 7) | 0x11); (enable << 7) | (state->cc_enable << 6) | 0x11);
state->xds_enable = enable; state->xds_enable = enable;
} }
if (!enable) if (!enable)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment