Re: [NEW DRIVER V5 1/7] drivers/mfd: DA9058 MFD core driver

From: Mark Brown
Date: Wed Apr 17 2013 - 15:20:13 EST


On Wed, Apr 17, 2013 at 05:33:33PM +0100, Anthony Olech wrote:

> +static struct regulator_consumer_supply platform_vddarm_consumers[] = {
> + {.supply = "vcc",}
> +};
> +

This looks very system specific and should be done by the system
integration for the board not the MFD.

> +static struct da9058_regulator_pdata buck1_pdata = {
> + .regulator_name = "DA9058_BUCK1",
> + .regulator_id = DA9058_BUCK_1,
> + .min_uv = DA9058_BUCK12_VOLT_LOWER * 1000,
> + .max_uv = DA9058_BUCK12_VOLT_UPPER * 1000,
> + .control_voltage_step = DA9058_BUCK_VOLT_STEP * 1000,
> + .control_register = DA9058_BUCK1_REG,
> + .control_step_mask = DA9058_MAX_VSEL,
> + .control_enable_mask = DA9058_BUCK_LDO_EN,
> + .ramp_register = DA9058_SUPPLY_REG,
> + .ramp_enable_mask = DA9058_SUPPLY_VBUCK1GO,
> + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE |
> + REGULATOR_CHANGE_STATUS,
> + .valid_modes_mask = REGULATOR_MODE_NORMAL,
> + .boot_on = 1,
> + .num_consumer_supplies = ARRAY_SIZE(platform_vddarm_consumers),
> + .consumer_supplies = platform_vddarm_consumers,
> +};

The regulators might be used for some totally different purpose on
another system, and the configuration may be different even if the
purpose is the same. The above also doesn't make much sense, you allow
changing modes but only support one mode.

You need to split out the regulator_init_data and let the board set it
up.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/