dt-bindings: gpio: Add Tegra238 support
Subsystems (3)
PATCH 1/2 dt-bindings: gpio: Add Tegra238 support
Extend the existing Tegra186 GPIO controller device tree bindings with support for the GPIO controllers found on Tegra238. Tegra238 has two GPIO controllers: the main controller and always-on (AON) controller. The number of pins is slightly different, but the programming model remains the same.
Add a new header, include/dt-bindings/gpio/nvidia,tegra238-gpio.h, that defines port IDs as well as the TEGRA238_MAIN_GPIO() helper, both of which are used in conjunction to create a unique specifier for each pin.
--- .../bindings/gpio/nvidia,tegra186-gpio.yaml | 6 ++ .../dt-bindings/gpio/nvidia,tegra238-gpio.h | 58 +++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 include/dt-bindings/gpio/nvidia,tegra238-gpio.h
Documentation/devicetree/bindings/gpio/nvidia,tegra186-gpio.yaml +6 -0
@@ -85,6 +85,8 @@ properties: - nvidia,tegra194-gpio-aon - nvidia,tegra234-gpio - nvidia,tegra234-gpio-aon + - nvidia,tegra238-gpio + - nvidia,tegra238-gpio-aon - nvidia,tegra256-gpio - nvidia,tegra264-gpio - nvidia,tegra264-gpio-uphy
@@ -163,6 +165,7 @@ allOf: - nvidia,tegra186-gpio - nvidia,tegra194-gpio - nvidia,tegra234-gpio + - nvidia,tegra238-gpio - nvidia,tegra256-gpio - nvidia,tegra264-gpio - nvidia,tegra264-gpio-uphy
@@ -180,6 +183,7 @@ allOf: - nvidia,tegra186-gpio-aon - nvidia,tegra194-gpio-aon - nvidia,tegra234-gpio-aon + - nvidia,tegra238-gpio-aon - nvidia,tegra264-gpio-aon then: properties:
@@ -192,6 +196,8 @@ allOf: compatible: contains: enum: + - nvidia,tegra238-gpio + - nvidia,tegra238-gpio-aon - nvidia,tegra264-gpio - nvidia,tegra264-gpio-uphy - nvidia,tegra264-gpio-aon
include/dt-bindings/gpio/nvidia,tegra238-gpio.h new file +58 -0
58 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH 2/2 gpio: tegra186: Add support for Tegra238
Extend the existing Tegra186 GPIO controller driver with support for the GPIO controller found on Tegra238.
--- drivers/gpio/gpio-tegra186.c | 68 ++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+)
drivers/gpio/gpio-tegra186.c +68 -0
@@ -19,6 +19,7 @@#include <dt-bindings/gpio/tegra186-gpio.h> #include <dt-bindings/gpio/tegra194-gpio.h> #include <dt-bindings/gpio/tegra234-gpio.h> +#include <dt-bindings/gpio/nvidia,tegra238-gpio.h> #include <dt-bindings/gpio/tegra241-gpio.h> #include <dt-bindings/gpio/tegra256-gpio.h> #include <dt-bindings/gpio/nvidia,tegra264-gpio.h>
@@ -1239,6 +1240,67 @@ static const struct tegra_gpio_soc tegra234_aon_soc = { .has_vm_support = false, }; +#define TEGRA238_MAIN_GPIO_PORT (_name, _bank, _port, _pins) \ + TEGRA_GPIO_PORT(TEGRA238_MAIN, _name, _bank, _port, _pins) + +static const struct tegra_gpio_port tegra238_main_ports[] = { +TEGRA238_MAIN_GPIO_PORT (A ,0 ,0 ,8 ), +TEGRA238_MAIN_GPIO_PORT (B ,0 ,1 ,5 ), +TEGRA238_MAIN_GPIO_PORT (C ,0 ,2 ,8 ), +TEGRA238_MAIN_GPIO_PORT (D ,0 ,3 ,8 ), +TEGRA238_MAIN_GPIO_PORT (E ,0 ,4 ,4 ), +TEGRA238_MAIN_GPIO_PORT (F ,0 ,5 ,8 ), +TEGRA238_MAIN_GPIO_PORT (G ,0 ,6 ,8 ), +TEGRA238_MAIN_GPIO_PORT (H ,0 ,7 ,6 ), +TEGRA238_MAIN_GPIO_PORT (J ,1 ,0 ,8 ), +TEGRA238_MAIN_GPIO_PORT (K ,1 ,1 ,4 ), +TEGRA238_MAIN_GPIO_PORT (L ,1 ,2 ,8 ), +TEGRA238_MAIN_GPIO_PORT (M ,1 ,3 ,8 ), +TEGRA238_MAIN_GPIO_PORT (N ,1 ,4 ,3 ), +TEGRA238_MAIN_GPIO_PORT (P ,1 ,5 ,8 ), +TEGRA238_MAIN_GPIO_PORT (Q ,1 ,6 ,3 ), +TEGRA238_MAIN_GPIO_PORT (R ,2 ,0 ,8 ), +TEGRA238_MAIN_GPIO_PORT (S ,2 ,1 ,8 ), +TEGRA238_MAIN_GPIO_PORT (T ,2 ,2 ,8 ), +TEGRA238_MAIN_GPIO_PORT (U ,2 ,3 ,6 ), +TEGRA238_MAIN_GPIO_PORT (V ,2 ,4 ,2 ), +TEGRA238_MAIN_GPIO_PORT (W ,3 ,0 ,8 ), +TEGRA238_MAIN_GPIO_PORT (X ,3 ,1 ,2 ) +}; + +static const struct tegra_gpio_soc tegra238_main_soc = { + .num_ports =ARRAY_SIZE (tegra238_main_ports), + .ports = tegra238_main_ports, + .name ="tegra238-gpio" , + .instance =0 , + .num_irqs_per_bank =8 , + .has_vm_support = true, +}; + +#define TEGRA238_AON_GPIO_PORT (_name, _bank, _port, _pins) \ + TEGRA_GPIO_PORT(TEGRA238_AON, _name, _bank, _port, _pins) + +static const struct tegra_gpio_port tegra238_aon_ports[] = { +TEGRA238_AON_GPIO_PORT (AA ,0 ,0 ,8 ), +TEGRA238_AON_GPIO_PORT (BB ,0 ,1 ,1 ), +TEGRA238_AON_GPIO_PORT (CC ,0 ,2 ,8 ), +TEGRA238_AON_GPIO_PORT (DD ,0 ,3 ,8 ), +TEGRA238_AON_GPIO_PORT (EE ,0 ,4 ,6 ), +TEGRA238_AON_GPIO_PORT (FF ,0 ,5 ,8 ), +TEGRA238_AON_GPIO_PORT (GG ,0 ,6 ,8 ), +TEGRA238_AON_GPIO_PORT (HH ,0 ,7 ,4 ) +}; + +static const struct tegra_gpio_soc tegra238_aon_soc = { + .num_ports =ARRAY_SIZE (tegra238_aon_ports), + .ports = tegra238_aon_ports, + .name ="tegra238-gpio-aon" , + .instance =1 , + .num_irqs_per_bank =8 , + .has_gte = true, + .has_vm_support = false, +}; +#define TEGRA241_MAIN_GPIO_PORT (_name, _bank, _port, _pins) \ TEGRA_GPIO_PORT(TEGRA241_MAIN, _name, _bank, _port, _pins)
@@ -1447,6 +1509,12 @@ static const struct of_device_id tegra186_gpio_of_match[] = { }, { .compatible = "nvidia,tegra234-gpio-aon", .data = &tegra234_aon_soc + }, { + .compatible = "nvidia,tegra238-gpio", + .data = &tegra238_main_soc + }, { + .compatible = "nvidia,tegra238-gpio-aon", + .data = &tegra238_aon_soc }, { .compatible ="nvidia,tegra256-gpio" , .data = &tegra256_main_soc
Signature · 1 line
2.25.1
pw-bot: not-applicable
Bartosz Golaszewski
AppliedQuoted 6 lines · Prathamesh Shete
Extend the existing Tegra186 GPIO controller device tree bindings with support for the GPIO controllers found on Tegra238. Tegra238 has two GPIO controllers: the main controller and always-on (AON) controller. The number of pins is slightly different, but the programming model remains the same.
Quoted 6 lines
Add a new header,
include/dt-bindings/gpio/nvidia,tegra238-gpio.h, that defines port IDs as well as theTEGRA238_MAIN_GPIO()helper, both of which are used in conjunction to create a unique specifier for each pin.[...]
Applied, thanks!
[1/2] dt-bindings: gpio: Add Tegra238 support
https://git.kernel.org/brgl/c/4002ccd266b665f1097e20addbe8f3baeb2136f9 [2/2] gpio: tegra186: Add support for Tegra238 https://git.kernel.org/brgl/c/8ac12d8b7099cdebff19aed78a81f61d8042c6be
Best regards,
Signature · 1 line
Bartosz Golaszewski <[email protected]>