diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-01-03 11:10:08 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-02-13 18:10:14 -0500 |
commit | 8cd61969c8a9b564435f4f903bddc09dfd39f944 (patch) | |
tree | ffa6e758ec0e6c22fd32cc74241399edd6371121 /drivers/media/i2c | |
parent | 00a5a4bf7bb40fe8cd5de042948b925c54b016de (diff) |
[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>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r-- | drivers/media/i2c/cx25840/cx25840-core.c | 18 | ||||
-rw-r--r-- | drivers/media/i2c/cx25840/cx25840-core.h | 3 |
2 files changed, 21 insertions, 0 deletions
diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c index 573e08826b9b..bdb5bb6b58da 100644 --- a/drivers/media/i2c/cx25840/cx25840-core.c +++ b/drivers/media/i2c/cx25840/cx25840-core.c | |||
@@ -5137,6 +5137,9 @@ static int cx25840_probe(struct i2c_client *client, | |||
5137 | int default_volume; | 5137 | int default_volume; |
5138 | u32 id; | 5138 | u32 id; |
5139 | u16 device_id; | 5139 | u16 device_id; |
5140 | #if defined(CONFIG_MEDIA_CONTROLLER) | ||
5141 | int ret; | ||
5142 | #endif | ||
5140 | 5143 | ||
5141 | /* Check if the adapter supports the needed features */ | 5144 | /* Check if the adapter supports the needed features */ |
5142 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 5145 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
@@ -5178,6 +5181,21 @@ static int cx25840_probe(struct i2c_client *client, | |||
5178 | 5181 | ||
5179 | sd = &state->sd; | 5182 | sd = &state->sd; |
5180 | v4l2_i2c_subdev_init(sd, client, &cx25840_ops); | 5183 | v4l2_i2c_subdev_init(sd, client, &cx25840_ops); |
5184 | #if defined(CONFIG_MEDIA_CONTROLLER) | ||
5185 | /* TODO: need to represent analog inputs too */ | ||
5186 | state->pads[0].flags = MEDIA_PAD_FL_SINK; /* Tuner or input */ | ||
5187 | state->pads[1].flags = MEDIA_PAD_FL_SOURCE; /* Video */ | ||
5188 | state->pads[2].flags = MEDIA_PAD_FL_SOURCE; /* VBI */ | ||
5189 | sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_DECODER; | ||
5190 | |||
5191 | ret = media_entity_init(&sd->entity, ARRAY_SIZE(state->pads), | ||
5192 | state->pads, 0); | ||
5193 | if (ret < 0) { | ||
5194 | v4l_info(client, "failed to initialize media entity!\n"); | ||
5195 | kfree(state); | ||
5196 | return -ENODEV; | ||
5197 | } | ||
5198 | #endif | ||
5181 | 5199 | ||
5182 | switch (id) { | 5200 | switch (id) { |
5183 | case CX23885_AV: | 5201 | case CX23885_AV: |
diff --git a/drivers/media/i2c/cx25840/cx25840-core.h b/drivers/media/i2c/cx25840/cx25840-core.h index 37bc04217c44..17b409f55445 100644 --- a/drivers/media/i2c/cx25840/cx25840-core.h +++ b/drivers/media/i2c/cx25840/cx25840-core.h | |||
@@ -64,6 +64,9 @@ struct cx25840_state { | |||
64 | wait_queue_head_t fw_wait; /* wake up when the fw load is finished */ | 64 | wait_queue_head_t fw_wait; /* wake up when the fw load is finished */ |
65 | struct work_struct fw_work; /* work entry for fw load */ | 65 | struct work_struct fw_work; /* work entry for fw load */ |
66 | struct cx25840_ir_state *ir_state; | 66 | struct cx25840_ir_state *ir_state; |
67 | #if defined(CONFIG_MEDIA_CONTROLLER) | ||
68 | struct media_pad pads[3]; | ||
69 | #endif | ||
67 | }; | 70 | }; |
68 | 71 | ||
69 | static inline struct cx25840_state *to_state(struct v4l2_subdev *sd) | 72 | static inline struct cx25840_state *to_state(struct v4l2_subdev *sd) |