On Thu, Oct 8, 2015 at 8:32 PM, Laurent Pinchart
<[email protected]> wrote:

> The PCA9621 is an I2C 8-bit output open-drain expander.
>
> Signed-off-by: Laurent Pinchart <[email protected]>

I think I like the mean, clean stand-alone driver better, but now note
this:

> +       ret = i2c_smbus_write_byte(gpio->client, gpio->out);

This is using smbus. That means you can probably access the whole
thing using regmap with devm_regmap_init_i2c() check for example
drivers/mfd/stw481x.c for an example.

> +       mutex_init(&gpio->lock);

With regmap maybe this mutex is not needed to lock stuff?

> +       /* Read the current output state. */
> +       ret = i2c_smbus_read_byte(gpio->client);
> +       if (ret < 0)
> +               return ret;
> +
> +       gpio->out = ret;

And regmap also has this per-register caching thing, where a callback
signifies whether a register i cached or not.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to