* [patch 2.6.27-rc7-omap1-git] beagle: two more GPIOs
@ 2008-09-28 17:55 David Brownell
2008-10-06 20:17 ` David Brownell
0 siblings, 1 reply; 3+ messages in thread
From: David Brownell @ 2008-09-28 17:55 UTC (permalink / raw)
To: linux-omap
From: David Brownell <dbrownell@users.sourceforge.net>
Request two more GPIOs on Beagle: MMC write protect, DVI enable.
Also define the first OMAP3 GPIO mux config symbols, with a new
naming convention. Examples:
- GPIO42 is bidirectional, and uses external pull up/down (if any);
- GPIO42_UP is bidirectional, with an internal pullup;
- GPIO42_DOWN is bidirectional, with an internal pulldown.
- GPIO42_OUT is output-only, and needs no pullup or pulldown.
All of those would be fully functional through the standard GPIO
interface as well as the legacy OMAP-only one, except GPIO42_OUT
which won't let you read the actual pin value after setting it.
There's no special off-mode support for these particular pins;
on Beagle they have external pullups or pulldowns.
(OMAP2 can use this naming convention too, except that since it
has no input-enable the "_OUT" convention can't be used there.)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
p.s. Looks like for GPIOs we could probably stop requiring
the prefix saying which ball it uses on one BGA package...
arch/arm/mach-omap2/board-omap3beagle.c | 11 +++++++++++
arch/arm/mach-omap2/mux.c | 9 +++++++++
arch/arm/plat-omap/include/mach/mux.h | 10 +++++++++-
3 files changed, 29 insertions(+), 1 deletion(-)
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -43,6 +43,7 @@
#include <mach/common.h>
#include <mach/gpmc.h>
#include <mach/nand.h>
+#include <mach/mux.h>
#define GPMC_CS0_BASE 0x60
@@ -255,7 +256,17 @@ static void __init omap3_beagle_init(voi
omap_board_config = omap3_beagle_config;
omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
omap_serial_init();
+
+ omap_cfg_reg(AH8_34XX_GPIO29);
+ gpio_request(29, "mmc0_wp");
+ gpio_direction_input(29);
hsmmc_init();
+
+ omap_cfg_reg(J25_34XX_GPIO170);
+ gpio_request(170, "DVI_nPD");
+ /* REVISIT leave DVI powered down until it's needed ... */
+ gpio_direction_output(170, true);
+
usb_musb_init();
usb_ehci_init();
omap3beagle_flash_init();
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -373,6 +373,15 @@ MUX_CFG_34XX("AA13_3430_USB3HS_TLL_D6",
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
MUX_CFG_34XX("AA12_3430_USB3HS_TLL_D7", 0x172,
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
+
+
+/* 34XX GPIO - bidirectional, unless the name has an "_OUT" suffix.
+ * no internal pullup/pulldown without "_UP" or "_DOWN" suffix.
+ */
+MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa,
+ OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
+MUX_CFG_34XX("J25_34XX_GPIO170", 0x1c6,
+ OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
};
#define OMAP34XX_PINS_SZ ARRAY_SIZE(omap34xx_pins)
--- a/arch/arm/plat-omap/include/mach/mux.h
+++ b/arch/arm/plat-omap/include/mach/mux.h
@@ -723,8 +723,16 @@ enum omap34xx_index {
AB12_3430_USB3HS_TLL_DATA4,
AB13_3430_USB3HS_TLL_DATA5,
AA13_3430_USB3HS_TLL_DATA6,
- AA12_3430_USB3HS_TLL_DATA7
+ AA12_3430_USB3HS_TLL_DATA7,
+ /* 34xx GPIO
+ * - normally these are bidirectional, no internal pullup/pulldown
+ * - use "_UP" suffix (GPIO3_UP) if internal pullup is configured
+ * - use "_DOWN" suffix (GPIO3_DOWN) with internal pulldown
+ * - use "_OUT" suffix (GPIO3_OUT) for output-only pins
+ */
+ AH8_34XX_GPIO29,
+ J25_34XX_GPIO170,
};
struct omap_mux_cfg {
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [patch 2.6.27-rc7-omap1-git] beagle: two more GPIOs
2008-09-28 17:55 [patch 2.6.27-rc7-omap1-git] beagle: two more GPIOs David Brownell
@ 2008-10-06 20:17 ` David Brownell
2008-10-07 8:05 ` Tony Lindgren
0 siblings, 1 reply; 3+ messages in thread
From: David Brownell @ 2008-10-06 20:17 UTC (permalink / raw)
To: linux-omap
From: David Brownell <dbrownell@users.sourceforge.net>
Request two more GPIOs on Beagle: MMC write protect, DVI enable.
Also define the first OMAP3 GPIO mux config symbols, with a new
naming convention. Examples:
- GPIO42 is bidirectional, and uses external pull up/down (if any);
- GPIO42_UP is bidirectional, with an internal pullup;
- GPIO42_DOWN is bidirectional, with an internal pulldown.
- GPIO42_OUT is output-only, and needs no pullup or pulldown.
All of those would be fully functional through the standard GPIO
interface as well as the legacy OMAP-only one, except GPIO42_OUT
which won't let you read the actual pin value after setting it.
There's no special off-mode support for these particular pins;
on Beagle they have external pullups or pulldowns.
(OMAP2 can use this naming convention too, except that since it
has no input-enable the "_OUT" convention can't be used there.)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
REFRESHED against 2.6.27-rc8-omap-git as of today ...
arch/arm/mach-omap2/board-omap3beagle.c | 11 +++++++++++
arch/arm/mach-omap2/mux.c | 8 ++++++++
arch/arm/plat-omap/include/mach/mux.h | 8 ++++++++
3 files changed, 27 insertions(+)
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -43,6 +43,7 @@
#include <mach/common.h>
#include <mach/gpmc.h>
#include <mach/nand.h>
+#include <mach/mux.h>
#define GPMC_CS0_BASE 0x60
@@ -291,7 +292,17 @@ static void __init omap3_beagle_init(voi
omap_board_config = omap3_beagle_config;
omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
omap_serial_init();
+
+ omap_cfg_reg(AH8_34XX_GPIO29);
+ gpio_request(29, "mmc0_wp");
+ gpio_direction_input(29);
hsmmc_init();
+
+ omap_cfg_reg(J25_34XX_GPIO170);
+ gpio_request(170, "DVI_nPD");
+ /* REVISIT leave DVI powered down until it's needed ... */
+ gpio_direction_output(170, true);
+
usb_musb_init();
usb_ehci_init();
omap3beagle_flash_init();
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -416,6 +416,14 @@ MUX_CFG_34XX("AD2_3430_USB3FS_PHY_MM3_TX
MUX_CFG_34XX("AC1_3430_USB3FS_PHY_MM3_TXEN_N", 0x18a,
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_OUTPUT)
+
+/* 34XX GPIO - bidirectional, unless the name has an "_OUT" suffix.
+ * No internal pullup/pulldown without "_UP" or "_DOWN" suffix.
+ */
+MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa,
+ OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
+MUX_CFG_34XX("J25_34XX_GPIO170", 0x1c6,
+ OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
};
#define OMAP34XX_PINS_SZ ARRAY_SIZE(omap34xx_pins)
--- a/arch/arm/plat-omap/include/mach/mux.h
+++ b/arch/arm/plat-omap/include/mach/mux.h
@@ -749,6 +749,14 @@ enum omap34xx_index {
AD2_3430_USB3FS_PHY_MM3_TXDAT,
AC1_3430_USB3FS_PHY_MM3_TXEN_N,
+ /* 34xx GPIO
+ * - normally these are bidirectional, no internal pullup/pulldown
+ * - "_UP" suffix (GPIO3_UP) if internal pullup is configured
+ * - "_DOWN" suffix (GPIO3_DOWN) with internal pulldown
+ * - "_OUT" suffix (GPIO3_OUT) for output-only pins (unlike 24xx)
+ */
+ AH8_34XX_GPIO29,
+ J25_34XX_GPIO170,
};
struct omap_mux_cfg {
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [patch 2.6.27-rc7-omap1-git] beagle: two more GPIOs
2008-10-06 20:17 ` David Brownell
@ 2008-10-07 8:05 ` Tony Lindgren
0 siblings, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2008-10-07 8:05 UTC (permalink / raw)
To: David Brownell; +Cc: linux-omap
* David Brownell <david-b@pacbell.net> [081007 01:23]:
> From: David Brownell <dbrownell@users.sourceforge.net>
>
> Request two more GPIOs on Beagle: MMC write protect, DVI enable.
>
> Also define the first OMAP3 GPIO mux config symbols, with a new
> naming convention. Examples:
>
> - GPIO42 is bidirectional, and uses external pull up/down (if any);
> - GPIO42_UP is bidirectional, with an internal pullup;
> - GPIO42_DOWN is bidirectional, with an internal pulldown.
> - GPIO42_OUT is output-only, and needs no pullup or pulldown.
>
> All of those would be fully functional through the standard GPIO
> interface as well as the legacy OMAP-only one, except GPIO42_OUT
> which won't let you read the actual pin value after setting it.
>
> There's no special off-mode support for these particular pins;
> on Beagle they have external pullups or pulldowns.
>
> (OMAP2 can use this naming convention too, except that since it
> has no input-enable the "_OUT" convention can't be used there.)
Pushing. These we can send to mainline with the hsmmc patches.
Tony
> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
> ---
> REFRESHED against 2.6.27-rc8-omap-git as of today ...
>
> arch/arm/mach-omap2/board-omap3beagle.c | 11 +++++++++++
> arch/arm/mach-omap2/mux.c | 8 ++++++++
> arch/arm/plat-omap/include/mach/mux.h | 8 ++++++++
> 3 files changed, 27 insertions(+)
>
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> @@ -43,6 +43,7 @@
> #include <mach/common.h>
> #include <mach/gpmc.h>
> #include <mach/nand.h>
> +#include <mach/mux.h>
>
>
> #define GPMC_CS0_BASE 0x60
> @@ -291,7 +292,17 @@ static void __init omap3_beagle_init(voi
> omap_board_config = omap3_beagle_config;
> omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
> omap_serial_init();
> +
> + omap_cfg_reg(AH8_34XX_GPIO29);
> + gpio_request(29, "mmc0_wp");
> + gpio_direction_input(29);
> hsmmc_init();
> +
> + omap_cfg_reg(J25_34XX_GPIO170);
> + gpio_request(170, "DVI_nPD");
> + /* REVISIT leave DVI powered down until it's needed ... */
> + gpio_direction_output(170, true);
> +
> usb_musb_init();
> usb_ehci_init();
> omap3beagle_flash_init();
> --- a/arch/arm/mach-omap2/mux.c
> +++ b/arch/arm/mach-omap2/mux.c
> @@ -416,6 +416,14 @@ MUX_CFG_34XX("AD2_3430_USB3FS_PHY_MM3_TX
> MUX_CFG_34XX("AC1_3430_USB3FS_PHY_MM3_TXEN_N", 0x18a,
> OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_OUTPUT)
>
> +
> +/* 34XX GPIO - bidirectional, unless the name has an "_OUT" suffix.
> + * No internal pullup/pulldown without "_UP" or "_DOWN" suffix.
> + */
> +MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa,
> + OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
> +MUX_CFG_34XX("J25_34XX_GPIO170", 0x1c6,
> + OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
> };
>
> #define OMAP34XX_PINS_SZ ARRAY_SIZE(omap34xx_pins)
> --- a/arch/arm/plat-omap/include/mach/mux.h
> +++ b/arch/arm/plat-omap/include/mach/mux.h
> @@ -749,6 +749,14 @@ enum omap34xx_index {
> AD2_3430_USB3FS_PHY_MM3_TXDAT,
> AC1_3430_USB3FS_PHY_MM3_TXEN_N,
>
> + /* 34xx GPIO
> + * - normally these are bidirectional, no internal pullup/pulldown
> + * - "_UP" suffix (GPIO3_UP) if internal pullup is configured
> + * - "_DOWN" suffix (GPIO3_DOWN) with internal pulldown
> + * - "_OUT" suffix (GPIO3_OUT) for output-only pins (unlike 24xx)
> + */
> + AH8_34XX_GPIO29,
> + J25_34XX_GPIO170,
> };
>
> struct omap_mux_cfg {
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-10-07 8:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-28 17:55 [patch 2.6.27-rc7-omap1-git] beagle: two more GPIOs David Brownell
2008-10-06 20:17 ` David Brownell
2008-10-07 8:05 ` Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox