[media] cx25840: fill the media controller entity

Instead of keeping the media controller entity not initialized,
fill it and create the pads for cx25840.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
Mauro Carvalho Chehab 2015-01-03 13:10:08 -03:00
parent 00a5a4bf7b
commit 8cd61969c8
2 changed files with 21 additions and 0 deletions

View File

@ -5137,6 +5137,9 @@ static int cx25840_probe(struct i2c_client *client,
int default_volume; int default_volume;
u32 id; u32 id;
u16 device_id; u16 device_id;
#if defined(CONFIG_MEDIA_CONTROLLER)
int ret;
#endif
/* Check if the adapter supports the needed features */ /* Check if the adapter supports the needed features */
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
@ -5178,6 +5181,21 @@ static int cx25840_probe(struct i2c_client *client,
sd = &state->sd; sd = &state->sd;
v4l2_i2c_subdev_init(sd, client, &cx25840_ops); v4l2_i2c_subdev_init(sd, client, &cx25840_ops);
#if defined(CONFIG_MEDIA_CONTROLLER)
/* TODO: need to represent analog inputs too */
state->pads[0].flags = MEDIA_PAD_FL_SINK; /* Tuner or input */
state->pads[1].flags = MEDIA_PAD_FL_SOURCE; /* Video */
state->pads[2].flags = MEDIA_PAD_FL_SOURCE; /* VBI */
sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_DECODER;
ret = media_entity_init(&sd->entity, ARRAY_SIZE(state->pads),
state->pads, 0);
if (ret < 0) {
v4l_info(client, "failed to initialize media entity!\n");
kfree(state);
return -ENODEV;
}
#endif
switch (id) { switch (id) {
case CX23885_AV: case CX23885_AV:

View File

@ -64,6 +64,9 @@ struct cx25840_state {
wait_queue_head_t fw_wait; /* wake up when the fw load is finished */ wait_queue_head_t fw_wait; /* wake up when the fw load is finished */
struct work_struct fw_work; /* work entry for fw load */ struct work_struct fw_work; /* work entry for fw load */
struct cx25840_ir_state *ir_state; struct cx25840_ir_state *ir_state;
#if defined(CONFIG_MEDIA_CONTROLLER)
struct media_pad pads[3];
#endif
}; };
static inline struct cx25840_state *to_state(struct v4l2_subdev *sd) static inline struct cx25840_state *to_state(struct v4l2_subdev *sd)