public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Da903x regulator driver. Bug?
@ 2008-10-24 15:47 Jonathan Cameron
  2008-10-24 17:23 ` Jonathan Cameron
  2008-10-27 15:29 ` [PATCH] da903x regulator bug fix Jonathan Cameron
  0 siblings, 2 replies; 12+ messages in thread
From: Jonathan Cameron @ 2008-10-24 15:47 UTC (permalink / raw)
  To: LKML, eric miao, Liam Girdwood

Firstly, is lkml the right place to ask questions about regulator drivers?

Secondly, though I can't track down any examples, I'm guessing the following
is a valid board config for the da903x reg etc.

static struct regulator_init_data stargate2_ld8_init_data = {
	.supply_regulator_dev = NULL,
	.constraints = {
		.name = "vdd_mica",
		.min_uV = 1800000,
		.max_uV = 1900000,
		.valid_modes_mask = REGULATOR_CHANGE_VOLTAGE,
	},
};

/* playing with this ld0 as it only goes to an external connector */
static struct da903x_subdev_info stargate2_da9030_subdevs[] = {
	{
		.name = "da903x-regulator",
		.id = DA9030_ID_LDO8,
		.platform_data = &stargate2_ld8_init_data,
	},
};

static struct da903x_platform_data stargate2_da9030_pdata = {
	.num_subdevs = ARRAY_SIZE(stargate2_da9030_subdevs),
	.subdevs = stargate2_da9030_subdevs,
};
static struct i2c_board_info __initdata stargate2_pwr_i2c_board_info [] = {
	{
		.type = "da9030",
		.addr = 0x49,
		.platform_data = &stargate2_da9030_pdata,
		.irq = gpio_to_irq(1),
	},
};

// and relevant registration code.


Now if this is now things are expected to be, there is a bug in
regulators/da903x.c in da903x_regulator_probe

rdev = regulator_register(&ri->desc, pdev->dev.parent, ri);

should be

rdev = regulator_register(&ri->desc, &pdev->dev, ri);

or else you aren't going to get the constraint.  I think the
first will give you the device of the mfd, not the regulator.

Thanks,

Jonathan

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-10-28 12:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-24 15:47 Da903x regulator driver. Bug? Jonathan Cameron
2008-10-24 17:23 ` Jonathan Cameron
2008-10-24 18:24   ` Liam Girdwood
2008-10-24 18:53     ` Jonathan Cameron
2008-10-24 19:44       ` Mark Brown
2008-10-27 15:29 ` [PATCH] da903x regulator bug fix Jonathan Cameron
2008-10-28  1:01   ` Eric Miao
2008-10-28  1:02     ` Eric Miao
2008-10-28 10:40       ` Jonathan Cameron
2008-10-28 11:03       ` Jonathan Cameron
2008-10-28 11:19         ` Liam Girdwood
2008-10-28 12:21           ` Eric Miao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox