All of lore.kernel.org
 help / color / mirror / Atom feed
From: Akihiro TSUKADA <tskd08@gmail.com>
To: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: linux-media@vger.kernel.org, tskd08@gmail.com
Subject: Re: [RFC/PATCH] dvb-core: add template code for i2c binding model
Date: Mon, 05 Jan 2015 20:59:38 +0900	[thread overview]
Message-ID: <54AA7CAA.2070203@gmail.com> (raw)
In-Reply-To: <20141230111051.7aeff58a@concha.lan>

Hi, thank you for the comment.
I understood the naming conventions you mentioned,
and I'll update them in the next version.

>> diff --git a/drivers/media/dvb-core/dvb_i2c.c b/drivers/media/dvb-core/dvb_i2c.c
>> new file mode 100644
>> index 0000000..4ea4e5e
>> --- /dev/null
>> +++ b/drivers/media/dvb-core/dvb_i2c.c
....
>> +static struct i2c_client *
>> +dvb_i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info *info,
>> +		   const unsigned short *probe_addrs)
>> +{
>> +	struct i2c_client *cl;
>> +
>> +	request_module(I2C_MODULE_PREFIX "%s", info->type);
>> +	/* Create the i2c client */
>> +	if (info->addr == 0 && probe_addrs)
>> +		cl = i2c_new_probed_device(adap, info, probe_addrs, NULL);
>> +	else
>> +		cl = i2c_new_device(adap, info);
>> +	if (!cl || !cl->dev.driver)
>> +		return NULL;
>> +	return cl;
> 
> The best would be to also register the device with the media controller,
> if CONFIG_MEDIA_CONTROLLER is defined, just like v4l2_i2c_subdev_init()
> does.

I'll comment to your patch on this.

> I would also try to use similar names for the function calls to the ones
> that the v4l subsystem uses for subdevices.

So the name should be dvb_i2c_new_subdev()?
I am a bit worried that it would be rather confusing because
this func is different from v4l2_i2c_new_subdev() in that
it does not return "struct dvb_frontend *", requires info.platform_data parameter,
and is a static/internal function.

One more thing that I'm wondering about is whether we should add fe->demod_i2c_bus
to support tuner devices on a (dedicated) i2c bus hosted on a demod device.
I guess that this structure is pretty common (to reduce noise),
and this removes i2c_adapter from "out" structure and
confines the usage of "out" structure to just device-specific ones.

--
akihiro 


  parent reply	other threads:[~2015-01-05 11:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-05 10:49 [RFC/PATCH] dvb-core: add template code for i2c binding model tskd08
2014-12-05 10:55 ` [PATCH 0/5] ports to dvb-core i2c template code tskd08
2014-12-05 10:55 ` [PATCH 1/5] dvb: qm1d1c0042: use dvb-core i2c binding model template tskd08
2014-12-05 10:55 ` [PATCH 2/5] dvb: mxl301rf: " tskd08
2014-12-05 10:55 ` [PATCH 3/5] dvb: tc90522: " tskd08
2014-12-05 10:55 ` [PATCH 4/5] dvb: tc90522: remove a redundant state variable tskd08
2014-12-05 10:55 ` [PATCH 5/5] dvb: pci/pt3: use dvb-core i2c binding model template tskd08
2014-12-26 11:00 ` [RFC/PATCH] dvb-core: add template code for i2c binding model Akihiro TSUKADA
2014-12-30 13:10 ` Mauro Carvalho Chehab
2014-12-30 20:01   ` Mauro Carvalho Chehab
2015-01-05 12:14     ` Akihiro TSUKADA
2015-01-05 12:24       ` Mauro Carvalho Chehab
2015-01-05 11:59   ` Akihiro TSUKADA [this message]
2015-01-13 18:54 ` Antti Palosaari
2015-01-15 11:20   ` Akihiro TSUKADA

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54AA7CAA.2070203@gmail.com \
    --to=tskd08@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.