[media] au0828: use standard demod pads struct
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 2 Mar 2016 12:48:36 +0000 (09:48 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 3 Mar 2016 09:18:17 +0000 (06:18 -0300)
As we want au0828 to use the core function to create the MC
graphs, use enum demod_pad_index instead of
enum au8522_media_pads.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/dvb-frontends/au8522.h
drivers/media/dvb-frontends/au8522_decoder.c
drivers/media/dvb-frontends/au8522_priv.h
drivers/media/usb/au0828/au0828-core.c
drivers/media/usb/au0828/au0828-video.c
include/media/v4l2-mc.h

index d7a997fada7fe510c7a9c148d6450d40fcb5ea7a..78bf3f73e58d4759c2d479b5e42285a18b33bfc8 100644 (file)
@@ -89,13 +89,4 @@ enum au8522_audio_input {
        AU8522_AUDIO_NONE,
        AU8522_AUDIO_SIF,
 };
-
-enum au8522_media_pads {
-       AU8522_PAD_INPUT,
-       AU8522_PAD_VID_OUT,
-       AU8522_PAD_VBI_OUT,
-       AU8522_PAD_AUDIO_OUT,
-
-       AU8522_NUM_PADS
-};
 #endif /* __AU8522_H__ */
index 0ab9f1eb8a29853a7f5efbf86ac6cd48df25f35d..add2463828061d4feccc4a8a335c49f4fa81f942 100644 (file)
@@ -763,10 +763,10 @@ static int au8522_probe(struct i2c_client *client,
        v4l2_i2c_subdev_init(sd, client, &au8522_ops);
 #if defined(CONFIG_MEDIA_CONTROLLER)
 
-       state->pads[AU8522_PAD_INPUT].flags = MEDIA_PAD_FL_SINK;
-       state->pads[AU8522_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE;
-       state->pads[AU8522_PAD_VBI_OUT].flags = MEDIA_PAD_FL_SOURCE;
-       state->pads[AU8522_PAD_AUDIO_OUT].flags = MEDIA_PAD_FL_SOURCE;
+       state->pads[DEMOD_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK;
+       state->pads[DEMOD_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE;
+       state->pads[DEMOD_PAD_VBI_OUT].flags = MEDIA_PAD_FL_SOURCE;
+       state->pads[DEMOD_PAD_AUDIO_OUT].flags = MEDIA_PAD_FL_SOURCE;
        sd->entity.function = MEDIA_ENT_F_ATV_DECODER;
 
        ret = media_entity_pads_init(&sd->entity, ARRAY_SIZE(state->pads),
index 505215a21dddf73449ac2d71d20d5de058d88d09..f5a9438f6ce5da75ad7184f3f5b924ffdedc21c3 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/videodev2.h>
 #include <media/v4l2-device.h>
 #include <media/v4l2-ctrls.h>
+#include <media/v4l2-mc.h>
 #include <linux/i2c.h>
 #include "dvb_frontend.h"
 #include "au8522.h"
@@ -70,7 +71,7 @@ struct au8522_state {
        struct v4l2_ctrl_handler hdl;
 
 #ifdef CONFIG_MEDIA_CONTROLLER
-       struct media_pad pads[AU8522_NUM_PADS];
+       struct media_pad pads[DEMOD_NUM_PADS];
 #endif
 };
 
index ca1e5ebf3b6b6c3df07e126bd87ee2c8a77b10eb..6da4e5749f3ae4192a3ccf32b26e30b0ac221fe7 100644 (file)
@@ -218,7 +218,7 @@ static void au0828_media_graph_notify(struct media_entity *new,
        switch (new->function) {
        case MEDIA_ENT_F_AUDIO_MIXER:
                ret = media_create_pad_link(dev->decoder,
-                                           AU8522_PAD_AUDIO_OUT,
+                                           DEMOD_PAD_AUDIO_OUT,
                                            new, 0,
                                            MEDIA_LNK_FL_ENABLED);
                if (ret)
index 1958de192608b3a2e8f80c2c27a9df66d425f180..b82deda0264347cedc51367c51fce69a88d829a4 100644 (file)
@@ -686,16 +686,16 @@ static int au0828_create_media_graph(struct au0828_dev *dev)
        if (tuner) {
                dev->tuner = tuner;
                ret = media_create_pad_link(tuner, TUNER_PAD_OUTPUT,
-                                           decoder, AU8522_PAD_INPUT, 0);
+                                           decoder, DEMOD_PAD_IF_INPUT, 0);
                if (ret)
                        return ret;
        }
-       ret = media_create_pad_link(decoder, AU8522_PAD_VID_OUT,
+       ret = media_create_pad_link(decoder, DEMOD_PAD_VID_OUT,
                                    &dev->vdev.entity, 0,
                                    MEDIA_LNK_FL_ENABLED);
        if (ret)
                return ret;
-       ret = media_create_pad_link(decoder, AU8522_PAD_VBI_OUT,
+       ret = media_create_pad_link(decoder, DEMOD_PAD_VBI_OUT,
                                    &dev->vbi_dev.entity, 0,
                                    MEDIA_LNK_FL_ENABLED);
        if (ret)
@@ -723,7 +723,7 @@ static int au0828_create_media_graph(struct au0828_dev *dev)
                case AU0828_VMUX_SVIDEO:
                        /* FIXME: fix the decoder PAD */
                        ret = media_create_pad_link(ent, 0, decoder,
-                                                   AU8522_PAD_INPUT, 0);
+                                                   DEMOD_PAD_IF_INPUT, 0);
                        if (ret)
                                return ret;
                        break;
index 5cbc20923faf1a00dab74008d6e5c20a4862f370..9dff7adff64c070d471d3815d121c73d711e5021 100644 (file)
@@ -87,12 +87,14 @@ enum if_aud_dec_pad_index {
  * @DEMOD_PAD_IF_INPUT:        IF input sink pad.
  * @DEMOD_PAD_VID_OUT: Video output source pad.
  * @DEMOD_PAD_VBI_OUT: Vertical Blank Interface (VBI) output source pad.
+ * @DEMOD_PAD_AUDIO_OUT: Audio output source pad.
  * @DEMOD_NUM_PADS:    Maximum number of output pads.
  */
 enum demod_pad_index {
        DEMOD_PAD_IF_INPUT,
        DEMOD_PAD_VID_OUT,
        DEMOD_PAD_VBI_OUT,
+       DEMOD_PAD_AUDIO_OUT,
        DEMOD_NUM_PADS
 };