History

gpio: regmap: add the .fixed_direction_output configuration parameter

There are GPIO controllers such as the one present in the LX2160ARDB QIXIS FPGA which have fixed-direction input and output GPIO lines mixed together in a single register. This cannot be modeled using the gpio-regmap as-is since there is no way to present the true direction of a GPIO line. In order to make this use case possible, add a new configuration parameter - fixed_direction_output - into the gpio_regmap_config structure. This will enable user drivers to provide a bitmap that represents the fixed direction of the GPIO lines.

Ioana Ciornei committed 1 year ago

Commit 00aaae61 parent d3762312 files · +29 −2Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/gpio/regmap.h+5−0
@@ -38,6 +38,10 @@ struct regmap; · 37 unmodified lines
3838 * offset to a register/bitmask pair. If not
3939 * given the default gpio_regmap_simple_xlate()
4040 * is used.
41+ * @fixed_direction_output:
42+ * (Optional) Bitmap representing the fixed direction of
43+ * the GPIO lines. Useful when there are GPIO lines with a
44+ * fixed direction mixed together in the same register.
4145 * @drvdata: (Optional) Pointer to driver specific data which is
4246 * not used by gpio-remap but is provided "as is" to the
4347 * driver callback(s).
@@ -85,6 +89,7 @@ struct gpio_regmap_config { · 41 unmodified lines
8589 int reg_stride;
8690 int ngpio_per_reg;
8791 struct irq_domain *irq_domain;
92+ unsigned long *fixed_direction_output;
8893
8994 #ifdef CONFIG_REGMAP_IRQ
9095 struct regmap_irq_chip *regmap_irq_chip;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t