···11-Bindings for the Broadcom's brcm,bcm6345-gpio memory-mapped GPIO controllers.22-33-These bindings can be used on any BCM63xx SoC. However, BCM6338 and BCM634544-are the only ones which don't need a pinctrl driver.55-BCM6338 have 8-bit data and dirout registers, where GPIO state can be read66-and/or written, and the direction changed from input to output.77-BCM6345 have 16-bit data and dirout registers, where GPIO state can be read88-and/or written, and the direction changed from input to output.99-1010-Required properties:1111- - compatible: should be "brcm,bcm6345-gpio"1212- - reg-names: must contain1313- "dat" - data register1414- "dirout" - direction (output) register1515- - reg: address + size pairs describing the GPIO register sets;1616- order must correspond with the order of entries in reg-names1717- - #gpio-cells: must be set to 2. The first cell is the pin number and1818- the second cell is used to specify the gpio polarity:1919- 0 = active high2020- 1 = active low2121- - gpio-controller: Marks the device node as a gpio controller.2222-2323-Optional properties:2424- - native-endian: use native endian memory.2525-2626-Examples:2727- - BCM6338:2828- gpio: gpio-controller@fffe0407 {2929- compatible = "brcm,bcm6345-gpio";3030- reg-names = "dirout", "dat";3131- reg = <0xfffe0407 1>, <0xfffe040f 1>;3232-3333- #gpio-cells = <2>;3434- gpio-controller;3535- };3636-3737- - BCM6345:3838- gpio: gpio-controller@fffe0406 {3939- compatible = "brcm,bcm6345-gpio";4040- reg-names = "dirout", "dat";4141- reg = <0xfffe0406 2>, <0xfffe040a 2>;4242- native-endian;4343-4444- #gpio-cells = <2>;4545- gpio-controller;4646- };
···11+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause22+%YAML 1.233+---44+$id: http://devicetree.org/schemas/gpio/brcm,bcm6345-gpio.yaml#55+$schema: http://devicetree.org/meta-schemas/core.yaml#66+77+title: Broadcom BCM6345 GPIO controller88+99+maintainers:1010+ - Álvaro Fernández Rojas <noltari@gmail.com>1111+ - Jonas Gorski <jonas.gorski@gmail.com>1212+1313+description: |+1414+ Bindings for Broadcom's BCM63xx memory-mapped GPIO controllers.1515+1616+ These bindings can be used on any BCM63xx SoC. However, BCM6338 and BCM63451717+ are the only ones which don't need a pinctrl driver.1818+1919+ BCM6338 have 8-bit data and dirout registers, where GPIO state can be read2020+ and/or written, and the direction changed from input to output.2121+ BCM6345 have 16-bit data and dirout registers, where GPIO state can be read2222+ and/or written, and the direction changed from input to output.2323+ BCM6318, BCM6328, BCM6358, BCM6362, BCM6368 and BCM63268 have 32-bit data2424+ and dirout registers, where GPIO state can be read and/or written, and the2525+ direction changed from input to output.2626+2727+properties:2828+ compatible:2929+ enum:3030+ - brcm,bcm6318-gpio3131+ - brcm,bcm6328-gpio3232+ - brcm,bcm6345-gpio3333+ - brcm,bcm6358-gpio3434+ - brcm,bcm6362-gpio3535+ - brcm,bcm6368-gpio3636+ - brcm,bcm63268-gpio3737+3838+ gpio-controller: true3939+4040+ "#gpio-cells":4141+ const: 24242+4343+ gpio-ranges:4444+ maxItems: 14545+4646+ native-endian: true4747+4848+ reg:4949+ maxItems: 25050+5151+ reg-names:5252+ items:5353+ - const: dirout5454+ - const: dat5555+5656+required:5757+ - compatible5858+ - reg5959+ - reg-names6060+ - gpio-controller6161+ - '#gpio-cells'6262+6363+additionalProperties: false6464+6565+examples:6666+ - |6767+ gpio@fffe0406 {6868+ compatible = "brcm,bcm6345-gpio";6969+ reg-names = "dirout", "dat";7070+ reg = <0xfffe0406 2>, <0xfffe040a 2>;7171+ native-endian;7272+7373+ gpio-controller;7474+ #gpio-cells = <2>;7575+ };7676+7777+ - |7878+ gpio@0 {7979+ compatible = "brcm,bcm63268-gpio";8080+ reg-names = "dirout", "dat";8181+ reg = <0x0 0x8>, <0x8 0x8>;8282+8383+ gpio-controller;8484+ gpio-ranges = <&pinctrl 0 0 52>;8585+ #gpio-cells = <2>;8686+ };
···254254 chip->names = config->names;255255 chip->label = config->label ?: dev_name(config->parent);256256257257+#if defined(CONFIG_OF_GPIO)258258+ /* gpiolib will use of_node of the parent if chip->of_node is NULL */259259+ chip->of_node = to_of_node(config->fwnode);260260+#endif /* CONFIG_OF_GPIO */261261+257262 /*258263 * If our regmap is fast_io we should probably set can_sleep to false.259264 * Right now, the regmap doesn't save this property, nor is there any
+55
drivers/pinctrl/bcm/Kconfig
···2929 help3030 Say Y here to enable the Broadcom BCM2835 GPIO driver.31313232+config PINCTRL_BCM63XX3333+ bool3434+ select GENERIC_PINCONF3535+ select GPIO_REGMAP3636+ select PINCONF3737+ select PINMUX3838+3939+config PINCTRL_BCM63184040+ bool "Broadcom BCM6318 GPIO driver"4141+ depends on (BMIPS_GENERIC || COMPILE_TEST)4242+ select PINCTRL_BCM63XX4343+ default BMIPS_GENERIC4444+ help4545+ Say Y here to enable the Broadcom BCM6318 GPIO driver.4646+4747+config PINCTRL_BCM63284848+ bool "Broadcom BCM6328 GPIO driver"4949+ depends on (BMIPS_GENERIC || COMPILE_TEST)5050+ select PINCTRL_BCM63XX5151+ default BMIPS_GENERIC5252+ help5353+ Say Y here to enable the Broadcom BCM6328 GPIO driver.5454+5555+config PINCTRL_BCM63585656+ bool "Broadcom BCM6358 GPIO driver"5757+ depends on (BMIPS_GENERIC || COMPILE_TEST)5858+ select PINCTRL_BCM63XX5959+ default BMIPS_GENERIC6060+ help6161+ Say Y here to enable the Broadcom BCM6358 GPIO driver.6262+6363+config PINCTRL_BCM63626464+ bool "Broadcom BCM6362 GPIO driver"6565+ depends on (BMIPS_GENERIC || COMPILE_TEST)6666+ select PINCTRL_BCM63XX6767+ default BMIPS_GENERIC6868+ help6969+ Say Y here to enable the Broadcom BCM6362 GPIO driver.7070+7171+config PINCTRL_BCM63687272+ bool "Broadcom BCM6368 GPIO driver"7373+ depends on (BMIPS_GENERIC || COMPILE_TEST)7474+ select PINCTRL_BCM63XX7575+ default BMIPS_GENERIC7676+ help7777+ Say Y here to enable the Broadcom BCM6368 GPIO driver.7878+7979+config PINCTRL_BCM632688080+ bool "Broadcom BCM63268 GPIO driver"8181+ depends on (BMIPS_GENERIC || COMPILE_TEST)8282+ select PINCTRL_BCM63XX8383+ default BMIPS_GENERIC8484+ help8585+ Say Y here to enable the Broadcom BCM63268 GPIO driver.8686+3287config PINCTRL_IPROC_GPIO3388 bool "Broadcom iProc GPIO (with PINCONF) driver"3489 depends on OF_GPIO && (ARCH_BCM_IPROC || COMPILE_TEST)
···624624bool gpiochip_irqchip_irq_valid(const struct gpio_chip *gc,625625 unsigned int offset);626626627627+#ifdef CONFIG_GPIOLIB_IRQCHIP627628int gpiochip_irqchip_add_domain(struct gpio_chip *gc,628629 struct irq_domain *domain);630630+#else631631+static inline int gpiochip_irqchip_add_domain(struct gpio_chip *gc,632632+ struct irq_domain *domain)633633+{634634+ WARN_ON(1);635635+ return -EINVAL;636636+}637637+#endif629638630639int gpiochip_generic_request(struct gpio_chip *gc, unsigned int offset);631640void gpiochip_generic_free(struct gpio_chip *gc, unsigned int offset);
+4
include/linux/gpio/regmap.h
···44#define _LINUX_GPIO_REGMAP_H5566struct device;77+struct fwnode_handle;78struct gpio_regmap;89struct irq_domain;910struct regmap;···1716 * @parent: The parent device1817 * @regmap: The regmap used to access the registers1918 * given, the name of the device is used1919+ * @fwnode: (Optional) The firmware node.2020+ * If not given, the fwnode of the parent is used.2021 * @label: (Optional) Descriptive name for GPIO controller.2122 * If not given, the name of the device is used.2223 * @ngpio: Number of GPIOs···6057struct gpio_regmap_config {6158 struct device *parent;6259 struct regmap *regmap;6060+ struct fwnode_handle *fwnode;63616462 const char *label;6563 int ngpio;