提交 00a5a4bf 编写于 作者: M Mauro Carvalho Chehab

[media] tuner-core: properly initialize media controller subdev

Properly initialize tuner core subdev at the media controller.

That requires a new subtype at the media controller API.
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 172e9d3c
...@@ -134,6 +134,9 @@ struct tuner { ...@@ -134,6 +134,9 @@ struct tuner {
unsigned int type; /* chip type id */ unsigned int type; /* chip type id */
void *config; void *config;
const char *name; const char *name;
#if defined(CONFIG_MEDIA_CONTROLLER)
struct media_pad pad;
#endif
}; };
/* /*
...@@ -434,6 +437,8 @@ static void set_type(struct i2c_client *c, unsigned int type, ...@@ -434,6 +437,8 @@ static void set_type(struct i2c_client *c, unsigned int type,
t->name = analog_ops->info.name; t->name = analog_ops->info.name;
} }
t->sd.entity.name = t->name;
tuner_dbg("type set to %s\n", t->name); tuner_dbg("type set to %s\n", t->name);
t->mode_mask = new_mode_mask; t->mode_mask = new_mode_mask;
...@@ -592,6 +597,9 @@ static int tuner_probe(struct i2c_client *client, ...@@ -592,6 +597,9 @@ static int tuner_probe(struct i2c_client *client,
struct tuner *t; struct tuner *t;
struct tuner *radio; struct tuner *radio;
struct tuner *tv; struct tuner *tv;
#ifdef CONFIG_MEDIA_CONTROLLER
int ret;
#endif
t = kzalloc(sizeof(struct tuner), GFP_KERNEL); t = kzalloc(sizeof(struct tuner), GFP_KERNEL);
if (NULL == t) if (NULL == t)
...@@ -684,6 +692,18 @@ static int tuner_probe(struct i2c_client *client, ...@@ -684,6 +692,18 @@ static int tuner_probe(struct i2c_client *client,
/* Should be just before return */ /* Should be just before return */
register_client: register_client:
#if defined(CONFIG_MEDIA_CONTROLLER)
t->pad.flags = MEDIA_PAD_FL_SOURCE;
t->sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_TUNER;
t->sd.entity.name = t->name;
ret = media_entity_init(&t->sd.entity, 1, &t->pad, 0);
if (ret < 0) {
tuner_err("failed to initialize media entity!\n");
kfree(t);
return -ENODEV;
}
#endif
/* Sets a default mode */ /* Sets a default mode */
if (t->mode_mask & T_ANALOG_TV) if (t->mode_mask & T_ANALOG_TV)
t->mode = V4L2_TUNER_ANALOG_TV; t->mode = V4L2_TUNER_ANALOG_TV;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册