Skip to content

Commit

Permalink
media: adv748x: afe: Select input port when initializing AFE
Browse files Browse the repository at this point in the history
[ Upstream commit 23ddb85 ]

When moving the input selection to adv748x_reset() it was missed that
during probe the device is reset _before_ the initialization and parsing
of DT by the AFE subdevice. This can lead to the wrong input port (in
case it's not port 0) being selected until the device is reset for the
first time.

Fix this by restoring the call to adv748x_afe_s_input() in the AFE
initialization while also keeping it in the adv748x_reset().

Fixes: c30ed81 ("media: adv748x: afe: Select input port when device is reset")
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Niklas Söderlund authored and gregkh committed Dec 31, 2022
1 parent fc6579f commit 5d1a2d2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/media/i2c/adv748x/adv748x-afe.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,10 @@ int adv748x_afe_init(struct adv748x_afe *afe)
}
}

adv748x_afe_s_input(afe, afe->input);

adv_dbg(state, "AFE Default input set to %d\n", afe->input);

/* Entity pads and sinks are 0-indexed to match the pads */
for (i = ADV748X_AFE_SINK_AIN0; i <= ADV748X_AFE_SINK_AIN7; i++)
afe->pads[i].flags = MEDIA_PAD_FL_SINK;
Expand Down

0 comments on commit 5d1a2d2

Please sign in to comment.