diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-14 16:42:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-14 16:42:43 -0400 |
commit | 2cf4d4514d5b43c1f3b64bd0ec8b9853bde8f1dc (patch) | |
tree | e35a625496acc6ac852846d40b8851186b9d1ac4 /arch/arm/mach-u300/padmux.c | |
parent | 44b7532b8b464f606053562400719c9c21276037 (diff) | |
parent | ce53895a5d24e0ee19fb92f56c17323fb4c9ab27 (diff) |
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (417 commits)
MAINTAINERS: EB110ATX is not ebsa110
MAINTAINERS: update Eric Miao's email address and status
fb: add support of LCD display controller on pxa168/910 (base layer)
[ARM] 5552/1: ep93xx get_uart_rate(): use EP93XX_SYSCON_PWRCNT and EP93XX_SYSCON_PWRCN
[ARM] pxa/sharpsl_pm: zaurus needs generic pxa suspend/resume routines
[ARM] 5544/1: Trust PrimeCell resource sizes
[ARM] pxa/sharpsl_pm: cleanup of gpio-related code.
[ARM] pxa/sharpsl_pm: drop set_irq_type calls
[ARM] pxa/sharpsl_pm: merge pxa-specific code into generic one
[ARM] pxa/sharpsl_pm: merge the two sharpsl_pm.c since it's now pxa specific
[ARM] sa1100: remove unused collie_pm.c
[ARM] pxa: fix the conflicting non-static declarations of global_gpios[]
[ARM] 5550/1: Add default configure file for w90p910 platform
[ARM] 5549/1: Add clock api for w90p910 platform.
[ARM] 5548/1: Add gpio api for w90p910 platform
[ARM] 5551/1: Add multi-function pin api for w90p910 platform.
[ARM] Make ARM_VIC_NR depend on ARM_VIC
[ARM] 5546/1: ARM PL022 SSP/SPI driver v3
ARM: OMAP4: SMP: Update defconfig for OMAP4430
ARM: OMAP4: SMP: Enable SMP support for OMAP4430
...
Diffstat (limited to 'arch/arm/mach-u300/padmux.c')
-rw-r--r-- | arch/arm/mach-u300/padmux.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/arch/arm/mach-u300/padmux.c b/arch/arm/mach-u300/padmux.c new file mode 100644 index 000000000000..f3664564f086 --- /dev/null +++ b/arch/arm/mach-u300/padmux.c | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * | ||
3 | * arch/arm/mach-u300/padmux.c | ||
4 | * | ||
5 | * | ||
6 | * Copyright (C) 2009 ST-Ericsson AB | ||
7 | * License terms: GNU General Public License (GPL) version 2 | ||
8 | * U300 PADMUX functions | ||
9 | * Author: Linus Walleij <linus.walleij@stericsson.com> | ||
10 | * | ||
11 | */ | ||
12 | #include <linux/io.h> | ||
13 | #include <linux/err.h> | ||
14 | #include <mach/u300-regs.h> | ||
15 | #include <mach/syscon.h> | ||
16 | |||
17 | #include "padmux.h" | ||
18 | |||
19 | /* Set the PAD MUX to route the MMC reader correctly to GPIO0. */ | ||
20 | void pmx_set_mission_mode_mmc(void) | ||
21 | { | ||
22 | u16 val; | ||
23 | |||
24 | val = readw(U300_SYSCON_VBASE + U300_SYSCON_PMC1LR); | ||
25 | val &= ~U300_SYSCON_PMC1LR_MMCSD_MASK; | ||
26 | writew(val, U300_SYSCON_VBASE + U300_SYSCON_PMC1LR); | ||
27 | val = readw(U300_SYSCON_VBASE + U300_SYSCON_PMC1HR); | ||
28 | val &= ~U300_SYSCON_PMC1HR_APP_GPIO_1_MASK; | ||
29 | val |= U300_SYSCON_PMC1HR_APP_GPIO_1_MMC; | ||
30 | writew(val, U300_SYSCON_VBASE + U300_SYSCON_PMC1HR); | ||
31 | } | ||
32 | |||
33 | void pmx_set_mission_mode_spi(void) | ||
34 | { | ||
35 | u16 val; | ||
36 | |||
37 | /* Set up padmuxing so the SPI port and its chipselects are active */ | ||
38 | val = readw(U300_SYSCON_VBASE + U300_SYSCON_PMC1HR); | ||
39 | /* | ||
40 | * Activate the SPI port (disable the use of these pins for generic | ||
41 | * GPIO, DSP, AAIF | ||
42 | */ | ||
43 | val &= ~U300_SYSCON_PMC1HR_APP_SPI_2_MASK; | ||
44 | val |= U300_SYSCON_PMC1HR_APP_SPI_2_SPI; | ||
45 | /* | ||
46 | * Use GPIO pin SPI CS1 for CS1 actually (it can be used for other | ||
47 | * things also) | ||
48 | */ | ||
49 | val &= ~U300_SYSCON_PMC1HR_APP_SPI_CS_1_MASK; | ||
50 | val |= U300_SYSCON_PMC1HR_APP_SPI_CS_1_SPI; | ||
51 | /* | ||
52 | * Use GPIO pin SPI CS2 for CS2 actually (it can be used for other | ||
53 | * things also) | ||
54 | */ | ||
55 | val &= ~U300_SYSCON_PMC1HR_APP_SPI_CS_2_MASK; | ||
56 | val |= U300_SYSCON_PMC1HR_APP_SPI_CS_2_SPI; | ||
57 | writew(val, U300_SYSCON_VBASE + U300_SYSCON_PMC1HR); | ||
58 | } | ||