On Fri, Dec 09, 2011 at 07:45:44PM +0530, Ashish Jangam wrote:
> The DA9052/53 is a highly integrated PMIC subsystem with supply domain
> flexibility to support wide range of high performance application.

This looks pretty good now.  There's a few issues below but with those
corrected the driver looks good.

Reviewed-by: Mark Brown <broo...@opensource.wolfsonmicro.com>

> +int da9052_add_regulator_devices(struct da9052 *da9052)
> +{
> +     struct platform_device *pdev;
> +     int i, ret;
> +
> +     for (i = 0; i < DA9052_MAX_REGULATORS; i++) {
> +             pdev = platform_device_alloc("da9052-regulator", i);
> +             if (!pdev)
> +                     return -ENOMEM;
> +
> +             pdev->dev.parent = da9052->dev;
> +             ret = platform_device_add(pdev);
> +             if (ret) {
> +                     platform_device_put(pdev);
> +                     return ret;
> +             }
> +     }

Same comment as ever about these - just make them normal MFD children.

> +     if (!pdata && !pdata->irq_base)
> +             da9052->irq_base = -1;

The above should be || not && - you want to set irq_base to -1 if you
don't have one provided.

> +static inline int da9052_reg_update(struct da9052 *da9052, unsigned char reg,
> +                                  unsigned char bit_mask,
> +                                  unsigned char reg_val)
> +{
> +     if (reg > DA9052_MAX_REG_CNT) {
> +             dev_err(da9052->dev, "invalid reg %x\n", reg);
> +             return -EINVAL;
> +     }

regmap will do this for you if you tell it max_register, this will also
get you the ability to inspect the device registers via debugfs which
can be very helpful.  I'd also encourage you to enable cache support, it
should make system performance better.

_______________________________________________
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

Reply via email to