From b183fccc0b8f2abf39f6bf310de483f2066a5ab2 Mon Sep 17 00:00:00 2001 From: Mats Randgaard Date: Thu, 5 Dec 2013 10:24:05 -0300 Subject: [PATCH] upstream: [media] adv7604: return immediately if the new input is equal to what is configured Signed-off-by: Mats Randgaard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/adv7604.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index 5576b79..28d9ced 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -1485,7 +1485,11 @@ static int adv7604_s_routing(struct v4l2_subdev *sd, { struct adv7604_state *state = to_state(sd); - v4l2_dbg(2, debug, sd, "%s: input %d", __func__, input); + v4l2_dbg(2, debug, sd, "%s: input %d, selected input %d", + __func__, input, state->selected_input); + + if (input == state->selected_input) + return 0; state->selected_input = input; @@ -1530,6 +1534,8 @@ static int adv7604_isr(struct v4l2_subdev *sd, u32 status, bool *handled) u8 fmt_change, fmt_change_digital, tx_5v; u32 input_status; + v4l2_dbg(2, debug, sd, "%s: ", __func__); + /* format change */ fmt_change = io_read(sd, 0x43) & 0x98; if (fmt_change) @@ -2130,6 +2136,7 @@ static int adv7604_probe(struct i2c_client *client, /* initialize variables */ state->restart_stdi_once = true; state->prev_input_status = ~0; + state->selected_input = ~0; /* platform data */ if (!pdata) { -- 2.7.4