On 2015年01月06日 03:29, Mauro Carvalho Chehab wrote: > Em Mon, 05 Jan 2015 23:36:00 +0900 >> And if so, >> Shouldn't only the (tuner) subdevices be registered separately >> in dvb_i2c_attach_tuner(), instead of dvb_i2c_attach_fe()? > > No, it seems better to let dmxdev to register. That means that even > the non-converted I2C drivers, plus the non-I2C drivers may benefit > from the Media controller as well. I guess you meant dvbdev instead of dmxdev, but still I'm afraid that media_entity for a tuner module is not registered like FE(demod),dmxdev,net,ca, because dvb_frontend_register() registers just a demod (or a whole FE module) for now. Tuner subdevices don't have their own device nodes to be passed to dvb_register_media_device() in the first place, So I think we need to define MEDIA_ENT_T_DVB_SUBDEV{,_TUNER} and register a media_entity of type:MEDIA_ENT_T_DVB_SUBDEV_TUNER, if a separate tuner chip is used. (with {major,minor} of the parent FE dev?) If we can distinguish if a separate tuner subdev is used or not by looking into "fe", then we might be able to register the subdev from within dvb_register_[media_]device(). But if we cannot know from "fe", dvb_i2c_attach_tuner() looks to be a good place. Further, when a DTV board has multiple tuners and/or multiple demods and the link between them can be dynamically configurable, (via media controller API or a new DVB ioctl?), then a tuner subdev can be unused and connected to no demod, so we cannot identify all tuner subdevs from the demod ("fe") anyway. > Yeah, we could map this way, but that would require to add an extra > parameter to the fe register function, with has already too much > parameters. So, as it already uses an struct to pass parameters into > it, I decided to just re-use it. if we add dvb_adapter.mdev and a user sets the pointer, then we can retrieve mdev in all the registering functions (dvb_register_frontend, dvb_{dmxdev,net,ca_en50221}_init), as all of them take a dvb_adapter parameter. or is it possible that the FE,demux,net,ca under one DVB adapter belong to different mdev's and each of them must keep its parent mdev separately? regards, akihiro -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html