diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-01-28 11:51:01 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-02-01 10:25:31 +0100 |
commit | fb4932821731f58353d23f6673b55a9612a1cb57 (patch) | |
tree | 50fa464979248d7fcc843ea0a1459e4afbf54f0c /drivers/media/i2c/msp3400-driver.c | |
parent | [media] tvp5150: create the expected number of pads (diff) | |
download | linux-fb4932821731f58353d23f6673b55a9612a1cb57.tar.xz linux-fb4932821731f58353d23f6673b55a9612a1cb57.zip |
[media] msp3400: initialize MC data
Add pads and set the device type when used with the media
controller.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/i2c/msp3400-driver.c')
-rw-r--r-- | drivers/media/i2c/msp3400-driver.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/media/i2c/msp3400-driver.c b/drivers/media/i2c/msp3400-driver.c index a84561d0d4a8..e016626ebf89 100644 --- a/drivers/media/i2c/msp3400-driver.c +++ b/drivers/media/i2c/msp3400-driver.c @@ -688,6 +688,9 @@ static int msp_probe(struct i2c_client *client, const struct i2c_device_id *id) int msp_revision; int msp_product, msp_prod_hi, msp_prod_lo; int msp_rom; +#if defined(CONFIG_MEDIA_CONTROLLER) + int ret; +#endif if (!id) strlcpy(client->name, "msp3400", sizeof(client->name)); @@ -704,6 +707,17 @@ static int msp_probe(struct i2c_client *client, const struct i2c_device_id *id) sd = &state->sd; v4l2_i2c_subdev_init(sd, client, &msp_ops); +#if defined(CONFIG_MEDIA_CONTROLLER) + state->pads[IF_AUD_DEC_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; + state->pads[IF_AUD_DEC_PAD_OUT].flags = MEDIA_PAD_FL_SOURCE; + + sd->entity.function = MEDIA_ENT_F_IF_AUD_DECODER; + + ret = media_entity_pads_init(&sd->entity, 2, state->pads); + if (ret < 0) + return ret; +#endif + state->v4l2_std = V4L2_STD_NTSC; state->detected_std = V4L2_STD_ALL; state->audmode = V4L2_TUNER_MODE_STEREO; |