lkml.org 
[lkml]   [2012]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/2] regulator: add device tree support for max8997
On 12.01.2012 08:35, Thomas Abraham wrote:
> Add device tree based discovery support for max8997.

> +static int max8997_pmic_dt_parse_pdata(struct max8997_dev *iodev,
> + struct max8997_platform_data *pdata)
> +{

> + pdata->regulators = rdata;
> + for_each_child_of_node(regulators_np, reg_np) {
> + for (i = 0; i< ARRAY_SIZE(regulators); i++)
> + if (!of_node_cmp(reg_np->name, regulators[i].name))
> + break;
> + rdata->id = i;
> + rdata->initdata = of_get_regulator_init_data(
> + iodev->dev, reg_np);

One more thing - of_get_regulator_init_data() will set apply_uV to 1 so
we need to reset it for BUCK6, which doesn't provide set_voltage() ops,
like:

if (rdata->initdata && regulators[i].id == MAX8997_BUCK6)
rdata->initdata->constraints.apply_uV = 0;

Thanks


\
 
 \ /
  Last update: 2012-01-25 10:59    [W:0.087 / U:0.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site