Re: [PATCH 01/06] MFD: DA9052/53 MFD core module v9

From: Mark Brown
Date: Sun Dec 11 2011 - 23:44:45 EST


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 <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>

> +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.
--
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/