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
38 * offset to a register/bitmask pair. If not38 * offset to a register/bitmask pair. If not
39 * given the default gpio_regmap_simple_xlate()39 * given the default gpio_regmap_simple_xlate()
40 * is used.40 * 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.
41 * @drvdata: (Optional) Pointer to driver specific data which is45 * @drvdata: (Optional) Pointer to driver specific data which is
42 * not used by gpio-remap but is provided "as is" to the46 * not used by gpio-remap but is provided "as is" to the
43 * driver callback(s).47 * driver callback(s).
@@ -85,6 +89,7 @@ struct gpio_regmap_config { · 41 unmodified lines
85 int reg_stride;89 int reg_stride;
86 int ngpio_per_reg;90 int ngpio_per_reg;
87 struct irq_domain *irq_domain;91 struct irq_domain *irq_domain;
92 unsigned long *fixed_direction_output;
88 93
89#ifdef CONFIG_REGMAP_IRQ94#ifdef CONFIG_REGMAP_IRQ
90 struct regmap_irq_chip *regmap_irq_chip;95 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