[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKew6eXsf5UKe4t5m3MAuU1OUSZcUPBoSRUCjyR-gKRmDC8MOw@mail.gmail.com>
Date: Fri, 25 May 2012 17:57:35 +0530
From: Yadwinder Singh Brar <yadi.brar01@...il.com>
To: Jonghwa Lee <jonghwa3.lee@...sung.com>
Cc: linux-kernel@...r.kernel.org, Liam Girdwood <lrg@...com>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>,
Chiwoong Byun <woong.byun@...sung.com>,
Myungjoo Ham <myungjoo.ham@...sung.com>,
Kyungmin Park <kyungmin.park@...sung.com>
Subject: Re: [PATCH v4] regulator: MAX77686: Add Maxim 77686 regulator driver
Hi Jonghwa,
> +
> + if (pdata)
> + max77686->opmode_data = pdata->opmode_data;
I think this is unused(unwanted) now.
> +
> + for (i = 0; i < MAX77686_REGULATORS; i++) {
> + if (pdata)
> + init_data[pdata->regulators[i].id] =
> + pdata->regulators[i].initdata;
I think we can directly use pdata->regulators[i].initdata instead of
init_data[i].
In case if pdata is not their we can use same instance of
init_data(default) for all regulators.
> +
> + config.init_data = init_data[i];
> + rdev[i] = regulator_register(®ulators[i], &config);
> +
> +
> + for (i = 0; i < 8; i++) {
> + if (pdata->buck2_voltage[i] > 0)
> + ret = regulator_map_voltage_linear(
> + rdev[MAX77686_LDOS+1],
> + pdata->buck2_voltage[i],
> + pdata->buck2_voltage[i]
> + + MAX77686_DVS_UVSTEP);
> + /* 1.1V as default for safety */
> + if (pdata->buck2_voltage[i] <= 0 || ret < 0)
> + max77686->buck2_vol[i] = 0x28;
> + else
> + max77686->buck2_vol[i] = ret;
> + regmap_write(max77686->iodev->regmap,
> + MAX77686_REG_BUCK2DVS1 + i, max77686->buck2_vol[i]);
> +
> + if (pdata->buck3_voltage[i] > 0)
> + ret = regulator_map_voltage_linear(
> + rdev[MAX77686_LDOS+1],
> + pdata->buck3_voltage[i],
> + pdata->buck3_voltage[i]
> + + MAX77686_DVS_UVSTEP);
> + /* 1.1V as default for safety */
> + if (pdata->buck3_voltage[i] <= 0 || ret < 0)
> + max77686->buck3_vol[i] = 0x28;
> + else
> + max77686->buck3_vol[i] = ret;
> + regmap_write(max77686->iodev->regmap,
> + MAX77686_REG_BUCK3DVS1 + i, max77686->buck3_vol[i]);
> +
> + if (pdata->buck4_voltage[i] > 0)
> + ret = regulator_map_voltage_linear(
> + rdev[MAX77686_LDOS+1],
> + pdata->buck4_voltage[i],
> + pdata->buck4_voltage[i]
> + + MAX77686_DVS_UVSTEP);
> + /* 1.1V as default for safety */
> + if (pdata->buck4_voltage[i] <= 0 || ret < 0)
> + max77686->buck4_vol[i] = 0x28;
> + else
> + max77686->buck4_vol[i] = ret;
> + regmap_write(max77686->iodev->regmap,
> + MAX77686_REG_BUCK4DVS1 + i, max77686->buck4_vol[i]);
> + }
Why do we need to initialize the 8 voltage registers of BUCK2/3/4 ?
Regards,
Yadwinder.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists