All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Mark Brown <broonie-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
Subject: Re: Regulator consumer and i2c device interaction.
Date: Sat, 10 Jan 2009 18:46:37 +0000	[thread overview]
Message-ID: <4968ED0D.9040103@gmail.com> (raw)
In-Reply-To: <4968C652.2050300-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Jonathan Cameron wrote:
> Dear All,
>
> Currently regulator consumers are registered and identified via a pointer to the relevant
> device:
>
> e.g. via a regulator consumer supply structure:
> static struct regulator_consumer_supply imote2_sensor_3_con[] = {
> 	{
> 		.dev = &sht15.dev,
> 		.supply = "vcc",
> 	},
> };
>
> static struct regulator_init_data imote2_ldo_init_data[] = {{
> 	{
> 	 	.constraints = {
> 		.name = "vcc_sensor_3",
> 		.min_uV = 2800000,
> 		.max_uV = 3000000,
> 		.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
> 	},
> 	.num_consumer_supplies = ARRAY_SIZE(imote2_sensor_3_con),
> 	.consumer_supplies = imote2_sensor_3_con,
> },
> };
>
> and relevant association with a regulator driver.
>
> Now in the case of i2c devices, the struct device  pointer is created
> somewhat later and isn't readily available.
>
> I think the struct device pointer is only used as device instance specific
> token in the regulator framework.  If so is there any reason it can't be
> relaxed to a void * thus allowing something else to be used in i2c drivers?
>
> If so what could actually be used?  Unfortunately all the data elements
> of i2c_board_info are coppied out (rather than a pointer to the original
> structure being used) so that's not currently available.  I guess it could
> be made so at the cost of a single pointer in each i2c_client structure.
>   
Oops, that won't work as typically these are specified __initdata .
Any suggestions for alternatives?
> So the question is how would people prefer to do this?
>
> Thanks,
>
> --
> Jonathan Cameron
>
>   

WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <Jonathan.Cameron@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>, linux-i2c@vger.kernel.org
Cc: Mark Brown <broonie@sirena.org.uk>
Subject: Re: Regulator consumer and i2c device interaction.
Date: Sat, 10 Jan 2009 18:46:37 +0000	[thread overview]
Message-ID: <4968ED0D.9040103@gmail.com> (raw)
In-Reply-To: <4968C652.2050300@gmail.com>

Jonathan Cameron wrote:
> Dear All,
>
> Currently regulator consumers are registered and identified via a pointer to the relevant
> device:
>
> e.g. via a regulator consumer supply structure:
> static struct regulator_consumer_supply imote2_sensor_3_con[] = {
> 	{
> 		.dev = &sht15.dev,
> 		.supply = "vcc",
> 	},
> };
>
> static struct regulator_init_data imote2_ldo_init_data[] = {{
> 	{
> 	 	.constraints = {
> 		.name = "vcc_sensor_3",
> 		.min_uV = 2800000,
> 		.max_uV = 3000000,
> 		.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
> 	},
> 	.num_consumer_supplies = ARRAY_SIZE(imote2_sensor_3_con),
> 	.consumer_supplies = imote2_sensor_3_con,
> },
> };
>
> and relevant association with a regulator driver.
>
> Now in the case of i2c devices, the struct device  pointer is created
> somewhat later and isn't readily available.
>
> I think the struct device pointer is only used as device instance specific
> token in the regulator framework.  If so is there any reason it can't be
> relaxed to a void * thus allowing something else to be used in i2c drivers?
>
> If so what could actually be used?  Unfortunately all the data elements
> of i2c_board_info are coppied out (rather than a pointer to the original
> structure being used) so that's not currently available.  I guess it could
> be made so at the cost of a single pointer in each i2c_client structure.
>   
Oops, that won't work as typically these are specified __initdata .
Any suggestions for alternatives?
> So the question is how would people prefer to do this?
>
> Thanks,
>
> --
> Jonathan Cameron
>
>   


  parent reply	other threads:[~2009-01-10 18:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-10 16:01 Regulator consumer and i2c device interaction Jonathan Cameron
     [not found] ` <4968C652.2050300-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-01-10 18:43   ` Mark Brown
2009-01-10 18:43     ` Mark Brown
2009-01-10 18:46   ` Jonathan Cameron [this message]
2009-01-10 18:46     ` Jonathan Cameron

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=4968ED0D.9040103@gmail.com \
    --to=jonathan.cameron-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=broonie-GFdadSzt00ze9xe1eoZjHA@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /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.