Skip to contentSkip to conversation

gpiolib: allow simultaneous setting of multiple GPIO outputs

PATCH Superseded Rojhalat Ibrahim 6 participants 17 messages Jun 16, 2014 – Aug 29, 2014

Subsystems (2)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/2 gpiolib: allow simultaneous setting of multiple GPIO outputs

Introduce new functions gpiod_set_array & gpiod_set_raw_array to the consumer interface which allow setting multiple outputs with just one function call. Also add an optional set_multiple function to the driver interface. Without an implementation of that function in the chip driver outputs are set sequentially.

Implementing the set_multiple function in a chip driver allows for:
- Improved performance for certain use cases. The original motivation for this was the task of configuring an FPGA. In that specific case, where 9 GPIO lines have to be set many times, configuration time goes down from 48 s to 20 s when using the new function.
- Simultaneous glitch-free setting of multiple pins on any kind of parallel bus attached to GPIOs provided they all reside on the same chip and bank.

Limitations:
Performance is only improved for normal high-low outputs. Open drain and open source outputs are always set separately from each other. Those kinds of outputs could probably be accelerated in a similar way if we could forgo the error checking when setting GPIO directions.

---
Change log:
v5: - check can_sleep property per chip
- remove superfluous checks
- supplement documentation
v4: - add gpiod_set_array function for setting logical values
- change interface of the set_multiple driver function to use unsigned long as type for the bit fields
- use generic bitops (which also use unsigned long for bit fields)
- do not use ARCH_NR_GPIOS any more
v3: - add documentation
- change commit message
v2: - use descriptor interface
- allow arbitrary groups of GPIOs spanning multiple chips

 Documentation/gpio/consumer.txt |  25 ++++++
 drivers/gpio/gpiolib.c          | 168 ++++++++++++++++++++++++++++++++++++++++
 include/linux/gpio/consumer.h   |  38 +++++++++
 include/linux/gpio/driver.h     |   4 +
 4 files changed, 235 insertions(+)
Documentation/gpio/consumer.txt +25 -0
index d8abfc3..369e663 100644
@@ -163,6 +163,31 @@ The active-low state of a GPIO can also be queried using the following call:
 Note that these functions should only be used with great moderation ; a driver
 should not have to care about the physical line level.
 
+Set multiple GPIO outputs with a single function call
+-----------------------------------------------------
+The following functions set the output values of an array of GPIOs:
+
+	void gpiod_set_array(unsigned int array_size,
+			     struct gpio_desc **desc_array,
+			     int *value_array)
+	void gpiod_set_raw_array(unsigned int array_size,
+				 struct gpio_desc **desc_array,
+				 int *value_array)
+	void gpiod_set_array_cansleep(unsigned int array_size,
+				      struct gpio_desc **desc_array,
+				      int *value_array)
+	void gpiod_set_raw_array_cansleep(unsigned int array_size,
+					  struct gpio_desc **desc_array,
+					  int *value_array)
+
+The array can be an arbitrary set of GPIOs. The functions will try to set
+GPIOs belonging to the same bank or chip simultaneously if supported by the
+corresponding chip driver. In that case a significantly improved performance
+can be expected. If simultaneous setting is not possible the GPIOs will be set
+sequentially.
+Note that for optimal performance GPIOs belonging to the same chip should be
+contiguous within the array of descriptors.
+
 GPIOs mapped to IRQs
 --------------------
 GPIO lines can quite often be used as IRQs. You can get the IRQ number
drivers/gpio/gpiolib.c +168 -0

186 lines not on this page · raw message

include/linux/gpio/consumer.h +38 -0
index 05e53cc..e51abe3 100644
@@ -53,14 +53,24 @@ int gpiod_direction_output_raw(struct gpio_desc *desc, int value);
 /* Value get/set from non-sleeping context */
 int gpiod_get_value(const struct gpio_desc *desc);
 void gpiod_set_value(struct gpio_desc *desc, int value);
+void gpiod_set_array(unsigned int array_size,
+		     struct gpio_desc **desc_array, int *value_array);
 int gpiod_get_raw_value(const struct gpio_desc *desc);
 void gpiod_set_raw_value(struct gpio_desc *desc, int value);
+void gpiod_set_raw_array(unsigned int array_size,
+			 struct gpio_desc **desc_array, int *value_array);
 
 /* Value get/set from sleeping context */
 int gpiod_get_value_cansleep(const struct gpio_desc *desc);
 void gpiod_set_value_cansleep(struct gpio_desc *desc, int value);
+void gpiod_set_array_cansleep(unsigned int array_size,
+			      struct gpio_desc **desc_array,
+			      int *value_array);
 int gpiod_get_raw_value_cansleep(const struct gpio_desc *desc);
 void gpiod_set_raw_value_cansleep(struct gpio_desc *desc, int value);
+void gpiod_set_raw_array_cansleep(unsigned int array_size,
+				  struct gpio_desc **desc_array,
+				  int *value_array);
 
 int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce);
 
@@ -180,6 +190,13 @@ static inline void gpiod_set_value(struct gpio_desc *desc, int value)
 	/* GPIO can never have been requested */
 	WARN_ON(1);
 }
+static inline void gpiod_set_array(unsigned int array_size,
+				   struct gpio_desc **desc_array,
+				   int *value_array)
+{
+	/* GPIO can never have been requested */
+	WARN_ON(1);
+}
 static inline int gpiod_get_raw_value(const struct gpio_desc *desc)
 {
 	/* GPIO can never have been requested */
@@ -191,6 +208,13 @@ static inline void gpiod_set_raw_value(struct gpio_desc *desc, int value)
 	/* GPIO can never have been requested */
 	WARN_ON(1);
 }
+static inline void gpiod_set_raw_array(unsigned int array_size,
+				       struct gpio_desc **desc_array,
+				       int *value_array)
+{
+	/* GPIO can never have been requested */
+	WARN_ON(1);
+}
 
 static inline int gpiod_get_value_cansleep(const struct gpio_desc *desc)
 {
@@ -203,6 +227,13 @@ static inline void gpiod_set_value_cansleep(struct gpio_desc *desc, int value)
 	/* GPIO can never have been requested */
 	WARN_ON(1);
 }
+static inline void gpiod_set_array_cansleep(unsigned int array_size,
+					    struct gpio_desc **desc_array,
+					    int *value_array)
+{
+	/* GPIO can never have been requested */
+	WARN_ON(1);
+}
 static inline int gpiod_get_raw_value_cansleep(const struct gpio_desc *desc)
 {
 	/* GPIO can never have been requested */
@@ -215,6 +246,13 @@ static inline void gpiod_set_raw_value_cansleep(struct gpio_desc *desc,
 	/* GPIO can never have been requested */
 	WARN_ON(1);
 }
+static inline void gpiod_set_raw_array_cansleep(unsigned int array_size,
+						struct gpio_desc **desc_array,
+						int *value_array)
+{
+	/* GPIO can never have been requested */
+	WARN_ON(1);
+}
 
 static inline int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce)
 {
include/linux/gpio/driver.h +4 -0
index 573e4f3..4814250 100644
@@ -32,6 +32,7 @@ struct seq_file;
  * @get: returns value for signal "offset"; for output signals this
  *	returns either the value actually sensed, or zero
  * @set: assigns output value for signal "offset"
+ * @set_multiple: assigns output values for multiple signals defined by "mask"
  * @set_debounce: optional hook for setting debounce time for specified gpio in
  *      interrupt triggered gpio chips
  * @to_irq: optional hook supporting non-static gpio_to_irq() mappings;
@@ -87,6 +88,9 @@ struct gpio_chip {
 						unsigned offset);
 	void			(*set)(struct gpio_chip *chip,
 						unsigned offset, int value);
+	void			(*set_multiple)(struct gpio_chip *chip,
+						unsigned long *mask,
+						unsigned long *bits);
 	int			(*set_debounce)(struct gpio_chip *chip,
 						unsigned offset,
 						unsigned debounce);

--
1.8.5.5

Reviewed-by on v5 1/2
#1 lore raw
Quoted 14 lines · Rojhalat Ibrahim

Introduce new functions gpiod_set_array & gpiod_set_raw_array to the consumer interface which allow setting multiple outputs with just one function call. Also add an optional set_multiple function to the driver interface. Without an implementation of that function in the chip driver outputs are set sequentially.

Implementing the set_multiple function in a chip driver allows for:
- Improved performance for certain use cases. The original motivation for this was the task of configuring an FPGA. In that specific case, where 9 GPIO lines have to be set many times, configuration time goes down from 48 s to 20 s when using the new function.
- Simultaneous glitch-free setting of multiple pins on any kind of parallel bus attached to GPIOs provided they all reside on the same chip and bank.

Quoted 5 lines

Limitations:
Performance is only improved for normal high-low outputs. Open drain and open source outputs are always set separately from each other. Those kinds of outputs could probably be accelerated in a similar way if we could forgo the error checking when setting GPIO directions.

Tried to find something more to say, but each and every concern I had has been addressed through the various revisions of this series.

As far as I can judge, this is a very nicely crafted patch.

#2 lore raw
In reply to Rojhalat Ibrahim
Quoted 5 lines · Rojhalat Ibrahim

Introduce new functions gpiod_set_array & gpiod_set_raw_array to the consumer interface which allow setting multiple outputs with just one function call. Also add an optional set_multiple function to the driver interface. Without an implementation of that function in the chip driver outputs are set sequentially.

I'm pretty sure I reviewed the external interfaces last time and they don't seem to have changed so:

Please carry forward tags that still apply so people don't need to duplicate review.

#3 lore raw
In reply to Rojhalat Ibrahim
Quoted 5 lines · Rojhalat Ibrahim

Introduce new functions gpiod_set_array & gpiod_set_raw_array to the consumer interface which allow setting multiple outputs with just one function call. Also add an optional set_multiple function to the driver interface. Without an implementation of that function in the chip driver outputs are set sequentially.

Yes this looks good.

Except for one thing I mentioned quite early I think:

no users!

How am I supposed to test this?

I wanted to see a patch also switching the one in-kernel thing that really needs this switched over to using this functionality.

That means, a patch to drivers/i2c/busses/i2c-gpio.c to set scl+sda in one go, for example.

Or a similar patch to drivers/spi/spi-gpio.c I guess?

Something that makes sense. As a bonus you get to rewrite one of these drivers to use GPIO descriptors ;)

This is not a hard wall, but I highly suspect that there must be some driver using this if you want to implement it, right? And the two mentioned drivers will be easy to use to test the feature on a lot of platforms.

Yours,
Linus Walleij

#4 lore raw
Quoted 8 lines · On Monday 07 July 2014 17:23:34 Linus Walleij wrote:
Quoted 5 lines · Rojhalat Ibrahim

Introduce new functions gpiod_set_array & gpiod_set_raw_array to the consumer interface which allow setting multiple outputs with just one function call. Also add an optional set_multiple function to the driver interface. Without an implementation of that function in the chip driver outputs are set sequentially.

Quoted 6 lines

Yes this looks good.

Except for one thing I mentioned quite early I think:

no users!

I'm pretty sure you did _not_ mention this before.

Quoted 10 lines

How am I supposed to test this?

I wanted to see a patch also switching the one in-kernel thing that really needs this switched over to using this functionality.

That means, a patch to drivers/i2c/busses/i2c-gpio.c to set scl+sda in one go, for example.

Or a similar patch to drivers/spi/spi-gpio.c I guess?

Quoted 8 lines

Something that makes sense. As a bonus you get to rewrite one of these drivers to use GPIO descriptors ;)

This is not a hard wall, but I highly suspect that there must be some driver using this if you want to implement it, right? And the two mentioned drivers will be easy to use to test the feature on a lot of platforms.

I'll take a look at those drivers and hopefully come back with an extended patch set.

Rojhalat

#5 lore raw
Quoted 9 lines · Rojhalat Ibrahim
Quoted 8 lines · On Monday 07 July 2014 17:23:34 Linus Walleij wrote:
Quoted 5 lines · Rojhalat Ibrahim

Introduce new functions gpiod_set_array & gpiod_set_raw_array to the consumer interface which allow setting multiple outputs with just one function call. Also add an optional set_multiple function to the driver interface. Without an implementation of that function in the chip driver outputs are set sequentially.

Quoted 7 lines
Quoted 5 lines

Yes this looks good.

Except for one thing I mentioned quite early I think:

no users!

I'm pretty sure you did _not_ mention this before.

I'm not referring to your patch set specifically. The idea of array handling has been proposed something like three times, I cannot tell these discussion threads apart in my head.

But it's a reasonable request don't you think?

Quoted 2 lines

I'll take a look at those drivers and hopefully come back with an extended patch set.

Thanks.

Yours,
Linus Walleij

#6 lore raw
Quoted 16 lines · On Wednesday 09 July 2014 12:17:13 Linus Walleij wrote:
Quoted 15 lines · Rojhalat Ibrahim
Quoted 13 lines · On Monday 07 July 2014 17:23:34 Linus Walleij wrote:
Quoted 5 lines · Rojhalat Ibrahim

Introduce new functions gpiod_set_array & gpiod_set_raw_array to the consumer interface which allow setting multiple outputs with just one function call. Also add an optional set_multiple function to the driver interface. Without an implementation of that function in the chip driver outputs are set sequentially.

Yes this looks good.

Except for one thing I mentioned quite early I think:

no users!

Quoted 8 lines
Quoted 1 line

I'm pretty sure you did _not_ mention this before.

I'm not referring to your patch set specifically. The idea of array handling has been proposed something like three times, I cannot tell these discussion threads apart in my head.

But it's a reasonable request don't you think?

The request might be reasonable.

But after taking a look at the i2c-gpio and spi-gpio drivers, I do not think they would benefit from the new feature. In both cases there are only two GPIO lines. And they have to be set separately at least half of the time.

I could not find any other in-kernel driver that might benefit from the new feature, either.

So I guess you are right: There are no users for this.

For my use-case the feature is very beneficial, but of course only in combination with an out-of-kernel driver module for configuring the FPGA on my custom board. I posted the patch because I expected similar use-cases to exist for other people out there. If you think that's not the case, there is nothing I can do about it.

Rojhalat

#7 lore raw

On Wed, Jul 30, 2014 at 11:12:30AM +0200, Rojhalat Ibrahim wrote:

Please fix your mailer to word wrap within paragraphs.

Quoted 3 lines

I could not find any other in-kernel driver that might benefit from the new feature, either.

So I guess you are right: There are no users for this.

The usual users for this are devices like LCD panels or other parallel buses.

#8 lore raw
Quoted 10 lines · On Wednesday 30 July 2014 11:41:30 Mark Brown wrote:

On Wed, Jul 30, 2014 at 11:12:30AM +0200, Rojhalat Ibrahim wrote:

Please fix your mailer to word wrap within paragraphs.

Quoted 3 lines

I could not find any other in-kernel driver that might benefit from the new feature, either.

So I guess you are right: There are no users for this.

The usual users for this are devices like LCD panels or other parallel buses.

Can you point me to any in-kernel driver that uses GPIOs to drive an LCD panel or a parallel bus?

#9 lore raw
In reply to Rojhalat Ibrahim
Quoted 32 lines · Rojhalat Ibrahim
Quoted 16 lines · On Wednesday 09 July 2014 12:17:13 Linus Walleij wrote:
Quoted 15 lines · Rojhalat Ibrahim
Quoted 13 lines · On Monday 07 July 2014 17:23:34 Linus Walleij wrote:
Quoted 5 lines · Rojhalat Ibrahim

Introduce new functions gpiod_set_array & gpiod_set_raw_array to the consumer interface which allow setting multiple outputs with just one function call. Also add an optional set_multiple function to the driver interface. Without an implementation of that function in the chip driver outputs are set sequentially.

Yes this looks good.

Except for one thing I mentioned quite early I think:

no users!

Quoted 8 lines
Quoted 1 line

I'm pretty sure you did _not_ mention this before.

I'm not referring to your patch set specifically. The idea of array handling has been proposed something like three times, I cannot tell these discussion threads apart in my head.

But it's a reasonable request don't you think?

The request might be reasonable.

But after taking a look at the i2c-gpio and spi-gpio drivers, I do not think they would benefit from the new feature. In both cases there are only two GPIO lines. And they have to be set separately at least half of the time.

Quoted 8 lines

I could not find any other in-kernel driver that might benefit from the new feature, either.

So I guess you are right: There are no users for this.

For my use-case the feature is very beneficial, but of course only in combination with an out-of-kernel driver module for configuring the FPGA on my custom board. I posted the patch because I expected similar use-cases to exist for other people out there. If you think that's not the case, there is nothing I can do about it.

Personally I would be sad if this series is not merged. It is a well-written solution to a problem that comes regularly. It is understandable that the upstream kernel API serves, well, upstream users - but we also need to recognize that most of the drivers using lots of GPIOs do not get merged upstream because using GPIOs that way is often considered a hack.

I'd be surprised if at least *one* such driver was not in mainline though. Had a quick look but could not find anything that would be an obvious candidate to use these new functions.

#10 lore raw
Quoted 4 lines · Alexandre Courbot

I'd be surprised if at least *one* such driver was not in mainline though. Had a quick look but could not find anything that would be an obvious candidate to use these new functions.

What about drivers/mtd/nand/gpio.c, the GPIO bitbanged NAND controller driver? Most of the latch, control, and data lines groups are set at the same time. It should be a perfect example.

virtually yours
Gerhard Sittig

Signature · 3 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: [email protected]
#11 lore raw
Quoted 10 lines · On Thursday 31 July 2014 09:12:35 Gerhard Sittig wrote:
Quoted 4 lines · Alexandre Courbot

I'd be surprised if at least *one* such driver was not in mainline though. Had a quick look but could not find anything that would be an obvious candidate to use these new functions.

What about drivers/mtd/nand/gpio.c, the GPIO bitbanged NAND controller driver? Most of the latch, control, and data lines groups are set at the same time. It should be a perfect example.

Well, not so perfect, since AFAIUI only a few control signals are managed by GPIOs (Chip Enable, Command Latch Enable, Address Latch Enable), but not the actual data lines. But granted, at least at one place in the driver three lines are set at the same time.

There are a few other drivers which also do that:
- drivers/tty/serial/serial_mctrl_gpio.c controls multiple modem lines via GPIO
- drivers/net/phy/mdio-mux-gpio.c a GPIO controlled MDIO bus multiplexer driver
- drivers/regulator/gpio-regulator.c controls voltage regulators

All of the above do set multiple GPIOs at the same time, but in all cases performance does not really matter. Moreover they all seem a bit obscure to me.

Nevertheless, IMHO they are still better candidates for using the new functions than the i2c-gpio or spi-gpio drivers.

So, Linus, would a patched version of one of the mentioned drivers qualify as a user that would allow you to merge my patch?

Rojhalat

#12 lore raw
Quoted 13 lines · Rojhalat Ibrahim
Quoted 10 lines · On Thursday 31 July 2014 09:12:35 Gerhard Sittig wrote:
Quoted 4 lines · Alexandre Courbot

I'd be surprised if at least *one* such driver was not in mainline though. Had a quick look but could not find anything that would be an obvious candidate to use these new functions.

What about drivers/mtd/nand/gpio.c, the GPIO bitbanged NAND controller driver? Most of the latch, control, and data lines groups are set at the same time. It should be a perfect example.

Quoted 4 lines

Well, not so perfect, since AFAIUI only a few control signals are managed by GPIOs (Chip Enable, Command Latch Enable, Address Latch Enable), but not the actual data lines. But granted, at least at one place in the driver three lines are set at the same time.

For some reason I mistook the driver's description and was under the impression that it would completely bitbang the NAND protocol. But I was wrong, it's a "GPIO _assisted_ NAND flash" driver. I am sorry for the confusion. Have sent patches to the MTD list to have the documentation updated for clarity.

Quoted 10 lines

There are a few other drivers which also do that:
- drivers/tty/serial/serial_mctrl_gpio.c controls multiple modem lines via GPIO
- drivers/net/phy/mdio-mux-gpio.c a GPIO controlled MDIO bus multiplexer driver
- drivers/regulator/gpio-regulator.c controls voltage regulators

All of the above do set multiple GPIOs at the same time, but in all cases performance does not really matter. Moreover they all seem a bit obscure to me.

Nevertheless, IMHO they are still better candidates for using the new functions than the i2c-gpio or spi-gpio drivers.

Could you spot the LCD driver mentioned by Mark? There are displays that implement a typically four or optionally eight bit data bus plus some three control lines (E/RW/RS), usually GPIO bitbanged -- so in total it's 7 or 11 software controlled pins. One of the controller chips is HD44780, compatibles have KS... and SED... names.

It's a pity that drivers/auxdisplay/ and drivers/staging/panel/ only support parport(4) and not GPIO.

Why is your FPGA netlist download driver not acceptable for mainline? Because it uses many GPIOs instead of a parallel or serial bus? Doesn't your code submission make parallel busses done by many GPIOs "more acceptable"? If your netlist download follows the ususal passive parallel approach, there should not be an issue. There are some FPGA netlist download drivers in drivers/misc/ and you might follow that pattern.

virtually yours
Gerhard Sittig

Signature · 3 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: [email protected]
#13 lore raw
Quoted 6 lines · Gerhard Sittig

Could you spot the LCD driver mentioned by Mark? There are displays that implement a typically four or optionally eight bit data bus plus some three control lines (E/RW/RS), usually GPIO bitbanged -- so in total it's 7 or 11 software controlled pins. One of the controller chips is HD44780, compatibles have KS... and SED... names.

I think the users just stayed out of tree due to not being able to get stuff merged.

#14 lore raw
In reply to Gerhard Sittig
Quoted 8 lines · On Wednesday 06 August 2014 14:45:44 Gerhard Sittig wrote:

Could you spot the LCD driver mentioned by Mark? There are displays that implement a typically four or optionally eight bit data bus plus some three control lines (E/RW/RS), usually GPIO bitbanged -- so in total it's 7 or 11 software controlled pins. One of the controller chips is HD44780, compatibles have KS... and SED... names.

I found a few display drivers using GPIOs for enable and/or reset lines, but none using GPIOs for the data lines.

Quoted 3 lines

It's a pity that drivers/auxdisplay/ and drivers/staging/panel/ only support parport(4) and not GPIO.

That could be an interesting application.

Quoted 10 lines

Why is your FPGA netlist download driver not acceptable for mainline? Because it uses many GPIOs instead of a parallel or serial bus? Doesn't your code submission make parallel busses done by many GPIOs "more acceptable"? If your netlist download follows the ususal passive parallel approach, there should not be an issue. There are some FPGA netlist download drivers in drivers/misc/ and you might follow that pattern.

Thanks for the suggestion. I have no problem with submitting that driver. Right now it's probably a little too board-specific for mainline, but I think I could improve on that. The result would be a driver to configure an Altera FPGA via the passive parallel configuration scheme using a number of GPIOs specified via DT. The driver would depend on the gpiod_set_array function and for now it would be the only user.

Do you think this has a chance to get merged? Should I post an extended patch set including the FPGA configuration driver?

Rojhalat

#15 lore raw
In reply to Rojhalat Ibrahim
Quoted 22 lines · Rojhalat Ibrahim
Quoted 10 lines · On Thursday 31 July 2014 09:12:35 Gerhard Sittig wrote:
Quoted 4 lines · Alexandre Courbot

I'd be surprised if at least *one* such driver was not in mainline though. Had a quick look but could not find anything that would be an obvious candidate to use these new functions.

What about drivers/mtd/nand/gpio.c, the GPIO bitbanged NAND controller driver? Most of the latch, control, and data lines groups are set at the same time. It should be a perfect example.

Well, not so perfect, since AFAIUI only a few control signals are managed by GPIOs (Chip Enable, Command Latch Enable, Address Latch Enable), but not the actual data lines. But granted, at least at one place in the driver three lines are set at the same time.

There are a few other drivers which also do that:
- drivers/tty/serial/serial_mctrl_gpio.c controls multiple modem lines via GPIO
- drivers/net/phy/mdio-mux-gpio.c a GPIO controlled MDIO bus multiplexer driver
- drivers/regulator/gpio-regulator.c controls voltage regulators

Quoted 8 lines

All of the above do set multiple GPIOs at the same time, but in all cases performance does not really matter. Moreover they all seem a bit obscure to me.

Nevertheless, IMHO they are still better candidates for using the new functions than the i2c-gpio or spi-gpio drivers.

So, Linus, would a patched version of one of the mentioned drivers qualify as a user that would allow you to merge my patch?

I think so. My concern is with code that doesn't get exercised, anywhere.

Yours,
Linus Walleij

#16 lore raw
Quoted 5 lines
Quoted 3 lines

So, Linus, would a patched version of one of the mentioned drivers qualify as a user that would allow you to merge my patch?

I think so. My concern is with code that doesn't get exercised, anywhere.

If we have a gpio-chardev somewhen, I know a bunch of industrial customers who will love it. It always feels a bit awkward to tell them they have to fiddle with bits individually if they want to read out an ID byte or have paired GPIO for other reasons.