Thread (1 message) 1 message, 1 author, 2012-01-04

[PATCH 6/6] gpio: tegra: Parameterize the number of banks

From: Stephen Warren <hidden>
Date: 2012-01-04 20:00:26
Also in: linux-devicetree, linux-tegra

Rob Herring wrote at Wednesday, January 04, 2012 12:54 PM:
On 01/04/2012 12:39 PM, Stephen Warren wrote:
quoted
Tegra20's GPIO controller has 7 banks, and Tegra30's controller has 8
banks. Allow the number of banks to be configured at run-time by the
device tree.
...
quoted
diff --git a/Documentation/devicetree/bindings/gpio/gpio_nvidia.txt
...
quoted
 Required properties:
 - compatible : "nvidia,tegra20-gpio"
 - reg : Physical base address and length of the controller's registers.
+- nvidia,num-banks : The number of GPIO banks. This should be 7 for
+  Tegra20 and 8 for Tegra30. This must match the number of interrupt
+  specifiers in the interrupts property.
You can determine the number of banks based on the compatible property
rather than needing an additional property.
That's certainly possible.

However, if say nvidia,tegraNNN-gpio has 9 banks, we then have to
explicitly edit the driver to know that, whereas by using a property,
we wouldn't have to change the driver at all to support a future GPIO
controller. So, isn't it better to explicitly represent this in DT?

Note that I have no idea how many GPIO banks our future chips will have,
so this might not turn out to save any work at all, but perhaps.

-- 
nvpublic
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help