4

Though I read few Documents on GPIOs, I am still unable to understand GPIOs top level multiplexing.

From the code, I see few GPIOs (like Int, Reset Pins) of dedicated device are multiplexed during suspend/*resume* callbacks of that particular driver. I want to know what exactly this gpio multiplexing does and how it effects system's suspend/*resume*?

artless noise
  • 21,212
  • 6
  • 68
  • 105
Narain
  • 4,461
  • 2
  • 17
  • 15
  • They are probably closing this question, because multiplexing is a technique from the field of telecommunication and not programming, hence my answer as a comment: How it works for example on a dedicated board like the [Beagle](http://elinux.org/BeagleBoardPinMux) is that the individual pins are set differently for different purposes. A pin can be used for I2C or for GPIO for example. – Anne van Rossum Mar 06 '13 at 10:01
  • @ondervloei: I suppose I was asking about pin multiplexing. From the Kernel Documentation, I understand that this multiplexing is all about configuring gpio settings and enabling of all pullups or pulldowns. May be this is what I needed to know. Let me know if there is something more to know ? – Narain Mar 06 '13 at 10:24
  • yes, that's what I as embedded guy understand under pin muxing, see also [lw.net](http://lwn.net/Articles/468759/) where they describe the pin control subsystem. If a specific device uses a pin for multiple purposes depending on some kind of device mode, I can imagine that there is additional "multiplexing" involved, but it seems unlikely that the physical board switches from being a clock line to driving an LED for example. – Anne van Rossum Mar 06 '13 at 11:37
  • You will have to look in the datasheet for the particular processor that controls those GPIOs. GPIO (general purpose I/O) pins often have alternate functions. For example, some can be configured to drive an I2C bus, or SPI, or USB, or be configured as specific interrupts. – Peter L. Mar 07 '13 at 22:36
  • @PeterL. Yes, I knew that GPIOs are configured differently for different purposes as u said. But I wanna know about GPIO multiplexing. Say if I am using one gpio(GPIO_XYZ_INT) as interrupt pin, should I reconfigure this gpio during suspend/resume events and if so how ? – Narain Mar 08 '13 at 05:23
  • @Narain, not sure about how to handle suspend/resume, but suspect that the processor would retain these register settings. You might have to configure other registers as well to enable the right interrupt behavior. Have you looked at how other drivers handle GPIO interrupts? Is your code implemented in Linux? Are there any interrupts generated at all for the GPIOs? (# cat /proc/interrupts on Linux) – Peter L. Mar 08 '13 at 17:12

2 Answers2

1

The feature you are asking about is not generally known as multiplexing. In order to enable suspend/resume on a GPIO, you have to have interrupt capabilities on the GPIO. Then you can mark this interrupt as wake-able. You do this with irq_set_irq_wake() and gpio_to_irq() is helpful. The underlying gpio as well as the Linux driver must support this; It is not really a driver, but an instance of the gpio subsystem for your platform.

If the driver you are interested in is not using these features, then it is non-standard Linux use and you need to point us to the appropriate driver source.

See also: LWN pinctrl, Linux gpio doc, pinctrl+gpio device tree bindings

artless noise
  • 21,212
  • 6
  • 68
  • 105
1

Gpio TLMM Provides a single GPIO pin can be used for multi funcionalities ,so one can configure that gpio pin to any one of functionality specified in datasheet/schematic. when a system is going to suspend all the gpio's will be configured accordingly to their low power state to reduce leakage current. and if a gpio is configured as an interrupt which can be wakable when system is in sleep,then that gpio interrupt monitoring will switched from normal gpio owner to always on power control block..