Re: [RFC/PATCH 1/2] gpio: Add PCA9621 driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 8, 2015 at 8:32 PM, Laurent Pinchart
<laurent.pinchart@xxxxxxxxxxxxxxxx> wrote:

> The PCA9621 is an I2C 8-bit output open-drain expander.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>

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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux