Re: [PATCH v2] Add ltc3562 voltage regulator driver

From: Mark Brown
Date: Fri Oct 31 2014 - 14:18:08 EST


On Fri, Oct 31, 2014 at 03:07:57PM +0100, Mike Looijmans wrote:
> On 30-10-2014 17:51, Mark Brown wrote:

> >This appears to be reimplementing regmap (including a cache). Please
> >use that instead. Pretty much the entire driver could then be replaced
> >with the regmap helpers, none of the operations look like they'd be
> >needed, and you'd get the regmap diagnostic infrastructure.

> The chip doesn't have an I2C register map, it uses "commands".
> It does not support read transactions at all, it will NACK those. The first
> byte contains a bit mask that tells which outputs are to be configured and
> in what mode, the next is the enable bit and setpoint value. The first byte
> already contains data, it's not just an address.

If that's the case the code is really rather unclear about what it's
doing - the use of "reg" for what's being written doesn't help, nor does
the fact that what looks like a cache is being kept. The code should
either use regmap or make it clear why that doesn't fit well.

Attachment: signature.asc
Description: Digital signature