Thread (1 message) 1 message, 1 author, 2011-08-15

RE: GPIO and Pinmux device tree support for Exynos.

From: Stephen Warren <hidden>
Date: 2011-08-15 15:54:10

Shawn Guo wrote at Saturday, August 13, 2011 8:01 AM:
On Thu, Aug 11, 2011 at 01:06:19PM -0700, Stephen Warren wrote:
quoted
Thomas Abraham wrote at Thursday, August 11, 2011 12:09 PM:
quoted
I did some work on the gpio and pinmux device tree support for exynos.
I thought to discuss with you about what was done before proceeding
further.

In the dts file, the interrupt controller node is listed as

GPA: gpio-controller@11400000 {
		compatible = "samsung,exynos4-gpio-gpa0", "samsung,exynos4-gpio";
		#gpio-cells = <4>;
		gpio-controller;
};

The meaning of the 4 cells are as below. The values of all the cells
are set as per the exynos chip specification.

< [GPIO Pin Number]  [Pin-Mux Function Number] [Pull Up/Down Setting]
[Driver Strength Setting] >


Device nodes would include the gpio's that it would use (as in below example)

serial@13800000 {
		compatible = "samsung,s5pv310-uart";
		reg = <0x13800000 0x100>;
		interrupts = <116>;
		gpios = <&GPA  0  2  0  2   /* Tx */
				&GPA  1  2  0  2>;  /* Rx */
};
The one problem with this approach is that presumably every single driver
(e.g. for the serial port above) must look for and handle the gpios
property, whereas presumably a serial port would otherwise have no need
to deal with GPIOs.
I think that individual driver still needs to look for gpios property
to actually use gpio with gpiolib api like gpio_request(),
gpio_direction_output() etc. no?
If those pins are actually used as GPIOs with gpio_set/get_value, then
yes, certainly.

However, given the comments in your example at least, it sounds like those
pins are the serial RX/TX lines, in which case they aren't being used as
GPIOs, but are driven by hardware. As such, I'd expect gpio_direction_*()
to be irrelevant for them, since I think those function are only intended
for SW-controlled literal GPIOs. If HW-controlled pins need direction
configuration, that's logically pinmux functionality rather than GPIO
functionality, even if on Exynos, both those functionalities are provided
by the same HW.

-- 
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