media: adv748x: Add is_txb()
authorJacopo Mondi <jacopo+renesas@jmondi.org>
Thu, 10 Jan 2019 14:02:08 +0000 (09:02 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 18 Feb 2019 15:59:54 +0000 (10:59 -0500)
Add small is_txb() macro to the existing is_txa() and use it where
appropriate.

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/i2c/adv748x/adv748x-csi2.c
drivers/media/i2c/adv748x/adv748x.h

index 6ce21542ed48581150c96e045f777657166e5ce2..b6b5d8c7ea7c548cf628b7572e699f63a6dd4d8b 100644 (file)
@@ -82,7 +82,7 @@ static int adv748x_csi2_registered(struct v4l2_subdev *sd)
                return adv748x_csi2_register_link(tx, sd->v4l2_dev,
                                                  &state->hdmi.sd,
                                                  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,
                                                  &state->afe.sd,
                                                  ADV748X_AFE_SOURCE);
index b482c7fe6957eb85985016fa0c453062f22ae84f..ab0c84adbea9f11e242d522806795c1b14bcc117 100644 (file)
@@ -89,8 +89,11 @@ struct adv748x_csi2 {
 
 #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 is_tx_enabled(_tx) ((_tx)->state->endpoints[(_tx)->port] != NULL)
 #define is_txa(_tx) ((_tx) == &(_tx)->state->txa)
+#define is_txb(_tx) ((_tx) == &(_tx)->state->txb)
+
 #define is_afe_enabled(_state)                                 \
        ((_state)->endpoints[ADV748X_PORT_AIN0] != NULL ||      \
         (_state)->endpoints[ADV748X_PORT_AIN1] != NULL ||      \