How to add GPIO outputs to the PXA2xx MFP configuration?
From: Igor Grinberg <hidden>
Date: 2012-03-30 15:28:37
On 03/30/12 18:06, Paul Parsons wrote:
quoted hunk ↗ jump to hunk
--- On Fri, 30/3/12, Igor Grinberg <grinberg@compulab.co.il> wrote:quoted
On 03/28/12 20:12, Paul Parsons wrote:quoted
On PXA2xx platforms, the MFP API (described inDocumentation/arm/pxa/mfp.txt)quoted
provides values for the following: 1. GPIO inputs (e.g. GPIO105_GPIO). 2. Alternate function inputs (e.g. GPIO105_CIF_DD_1). 3. Alternate function outputs (e.g.GPIO105_KP_MKOUT_2).quoted
It does not provide values for GPIO outputs (i.e. AF0outputs).quoted
One cannot use the macro used by the MFP API internally- MFP_CFG_OUT() - toquoted
define new GPIO output values, since that macro isforbidden in platform code.quoted
Without the ability to add GPIO outputs to the MFPconfiguration, it is notquoted
possible to drive GPIO outputs high during sleep mode. This would be useful, for example, on the hx4700platform, where driving thequoted
infrared powerdown GPIO 105 high during sleep modewould save some mA.quoted
So my question is: what method should one use to addGPIO outputs to the MFPquoted
configuration? One possible method, namely manually defining values inthe platform code:quoted
MFP_PIN_GPIO105 | MFP_AF0 |MFP_DIR_OUT | MFP_LPM_DRIVE_HIGH, Have you tried: GPIO105_GPIO | MFP_LPM_DRIVE_HIGH, ? This way it works on other boards.Hello Igor, GPIO105_GPIO expands to a GPIO input - MFP_CFG_IN(GPIO105, AF0) - not an output.
Yeah, I know... but read in mfp-pxa2xx.h, lines 6-20:
/*
* the following MFP_xxx bit definitions in mfp.h are re-used for pxa2xx:
*
* MFP_PIN(x)
* MFP_AFx
* MFP_LPM_DRIVE_{LOW, HIGH}
* MFP_LPM_EDGE_x
*
* other MFP_x bit definitions will be ignored
*
* and adds the below two bits specifically for pxa2xx:
*
* bit 23 - Input/Output (PXA2xx specific)
* bit 24 - Wakeup Enable(PXA2xx specific)
*/
Also, PXA2xx h/w does not have an MFP registers, but only AF setting regs,
So the whole MFP for PXA2xx is only to conform to newer "PXA" platform features...
--
Regards,
Igor.