Re: [PATCH 1/2] gpio: Add gpio latch driver

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

 



Hi Marco,

On Fri, Aug 26, 2022 at 07:53:07AM +0200, Marco Felsch wrote:
> Hi Sascha,
> 
> nice patche, please see inline.
> 
> On 22-08-25, Sascha Hauer wrote:
> > This driver implements a GPIO multiplexer based on latches connected to
> > other GPIOs. A set of data GPIOs is connected to the data input of
> > multiple latches. The clock input of each latch is driven by another
> > set of GPIOs. With two 8-bit latches 10 GPIOs can be multiplexed into
> > 16 GPIOs. GPOs might be a better term as in fact the multiplexed pins
> > are output only.
> > 

[snip]

> > +
> > +static void __gpio_latch_set(struct gpio_latch_priv *priv, unsigned int offset, int val)
> > +{
> > +	int latch = offset / priv->n_pins;
> > +	int i;
> > +
> > +	if (val)
> > +		priv->shadow[latch] |= BIT(offset % priv->n_pins);
> > +	else
> > +		priv->shadow[latch] &= ~BIT(offset % priv->n_pins);
> > +
> > +	for (i = 0; i < priv->n_pins; i++)
> > +		gpiod_set_value(priv->data_gpios->desc[i], priv->shadow[latch] & BIT(i));
> > +
> > +	gpiod_set_value(priv->clk_gpios->desc[latch], 1);
> > +	gpiod_set_value(priv->clk_gpios->desc[latch], 0);
> 
> Your have two access function for _can_sleep and "can not sleep" but
> here you don't resepect it.

I thought the gpio framework would pick the right implementation
automatically. Apparently it doesn't. Will fix in v2.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



[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