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.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -38,6 +38,10 @@ struct regmap; · 37 unmodified lines | ||
| 38 | 38 | * offset to a register/bitmask pair. If not |
| 39 | 39 | * given the default gpio_regmap_simple_xlate() |
| 40 | 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 | 45 | * @drvdata: (Optional) Pointer to driver specific data which is |
| 42 | 46 | * not used by gpio-remap but is provided "as is" to the |
| 43 | 47 | * driver callback(s). |
| @@ -85,6 +89,7 @@ struct gpio_regmap_config { · 41 unmodified lines | ||
| 85 | 89 | int reg_stride; |
| 86 | 90 | int ngpio_per_reg; |
| 87 | 91 | struct irq_domain *irq_domain; |
| 92 | + unsigned long *fixed_direction_output; | |
| 88 | 93 | |
| 89 | 94 | #ifdef CONFIG_REGMAP_IRQ |
| 90 | 95 | struct regmap_irq_chip *regmap_irq_chip; |