Commit bc2dea9e authored by Jacopo Mondi's avatar Jacopo Mondi Committed by Mauro Carvalho Chehab

media: adv748x: Add is_txb()

Add small is_txb() macro to the existing is_txa() and use it where
appropriate.
Reviewed-by: default avatarKieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarJacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 3d769df5
...@@ -82,7 +82,7 @@ static int adv748x_csi2_registered(struct v4l2_subdev *sd) ...@@ -82,7 +82,7 @@ static int adv748x_csi2_registered(struct v4l2_subdev *sd)
return adv748x_csi2_register_link(tx, sd->v4l2_dev, return adv748x_csi2_register_link(tx, sd->v4l2_dev,
&state->hdmi.sd, &state->hdmi.sd,
ADV748X_HDMI_SOURCE); ADV748X_HDMI_SOURCE);
if (!is_txa(tx) && is_afe_enabled(state)) if (is_txb(tx) && is_afe_enabled(state))
return adv748x_csi2_register_link(tx, sd->v4l2_dev, return adv748x_csi2_register_link(tx, sd->v4l2_dev,
&state->afe.sd, &state->afe.sd,
ADV748X_AFE_SOURCE); ADV748X_AFE_SOURCE);
......
...@@ -89,8 +89,11 @@ struct adv748x_csi2 { ...@@ -89,8 +89,11 @@ struct adv748x_csi2 {
#define notifier_to_csi2(n) container_of(n, struct adv748x_csi2, notifier) #define notifier_to_csi2(n) container_of(n, struct adv748x_csi2, notifier)
#define adv748x_sd_to_csi2(sd) container_of(sd, struct adv748x_csi2, sd) #define adv748x_sd_to_csi2(sd) container_of(sd, struct adv748x_csi2, sd)
#define is_tx_enabled(_tx) ((_tx)->state->endpoints[(_tx)->port] != NULL) #define is_tx_enabled(_tx) ((_tx)->state->endpoints[(_tx)->port] != NULL)
#define is_txa(_tx) ((_tx) == &(_tx)->state->txa) #define is_txa(_tx) ((_tx) == &(_tx)->state->txa)
#define is_txb(_tx) ((_tx) == &(_tx)->state->txb)
#define is_afe_enabled(_state) \ #define is_afe_enabled(_state) \
((_state)->endpoints[ADV748X_PORT_AIN0] != NULL || \ ((_state)->endpoints[ADV748X_PORT_AIN0] != NULL || \
(_state)->endpoints[ADV748X_PORT_AIN1] != NULL || \ (_state)->endpoints[ADV748X_PORT_AIN1] != NULL || \
......
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