diff options
author | Peter Gielda <pgielda@antmicro.com> | 2013-07-25 14:28:11 +0200 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2013-07-31 15:31:03 +0200 |
commit | 9e9456a2d3197302e4f8501aae38eb40aa06fa01 (patch) | |
tree | 3644260deb305db9582fe7c8f2f1298f0aa3dd5a | |
parent | 3e3245f2638d9763b7b0b8a6cc30ac4055e44731 (diff) |
media: adv7180: small cleanup of the input selection
-rw-r--r-- | drivers/media/video/adv7180.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/video/adv7180.c b/drivers/media/video/adv7180.c index 4721aedf9140..fa08ea32a37c 100644 --- a/drivers/media/video/adv7180.c +++ b/drivers/media/video/adv7180.c @@ -233,14 +233,14 @@ static int adv7180_s_std(struct v4l2_subdev *sd, v4l2_std_id std) if (std == V4L2_STD_ALL) { ret = i2c_smbus_write_byte_data(client, ADV7180_INPUT_CONTROL_REG, - ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM | state->active_input); + ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM | (ADV7180_INPUT_CONTROL_COMPOSITE_IN1 + state->active_input)); if (ret < 0) goto out; __adv7180_status(client, NULL, &state->curr_norm); state->autodetect = true; } else { - ret = v4l2_std_to_adv7180(std) | state->active_input; + ret = v4l2_std_to_adv7180(std) | (ADV7180_INPUT_CONTROL_COMPOSITE_IN1 + state->active_input); if (ret < 0) goto out; @@ -391,7 +391,7 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int i) { struct v4l2_subdev *sd = soc_camera_to_subdev(icd); struct adv7180_state *state = to_state(sd); if (i < 6) { - state->active_input = ADV7180_INPUT_CONTROL_COMPOSITE_IN1 + i; + state->active_input = i; return 0; } return -EINVAL; @@ -437,7 +437,7 @@ static __devinit int adv7180_probe(struct i2c_client *client, WARN_ON((ident != ADV7180_ID_7180) && (ident != ADV7180_ID2_7180)); v4l_info(client, "ident reg is 0x%02x\n", ident); - state->active_input = ADV7180_INPUT_CONTROL_COMPOSITE_IN1; + state->active_input = 0; state->irq = client->irq; INIT_WORK(&state->work, adv7180_work); mutex_init(&state->mutex); @@ -449,7 +449,7 @@ static __devinit int adv7180_probe(struct i2c_client *client, /* Initialize adv7180 */ /* Enable autodetection */ ret = i2c_smbus_write_byte_data(client, ADV7180_INPUT_CONTROL_REG, - ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM | state->active_input); + ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM | (ADV7180_INPUT_CONTROL_COMPOSITE_IN1 + state->active_input)); if (ret < 0) goto err_unreg_subdev; |