3 * arch/arm/mach-u300/padmux.c
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>
13 #include <linux/err.h>
14 #include <mach/u300-regs.h>
15 #include <mach/syscon.h>
19 /* Set the PAD MUX to route the MMC reader correctly to GPIO0. */
20 void pmx_set_mission_mode_mmc(void)
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
);
33 void pmx_set_mission_mode_spi(void)
37 /* Set up padmuxing so the SPI port and its chipselects are active */
38 val
= readw(U300_SYSCON_VBASE
+ U300_SYSCON_PMC1HR
);
40 * Activate the SPI port (disable the use of these pins for generic
43 val
&= ~U300_SYSCON_PMC1HR_APP_SPI_2_MASK
;
44 val
|= U300_SYSCON_PMC1HR_APP_SPI_2_SPI
;
46 * Use GPIO pin SPI CS1 for CS1 actually (it can be used for other
49 val
&= ~U300_SYSCON_PMC1HR_APP_SPI_CS_1_MASK
;
50 val
|= U300_SYSCON_PMC1HR_APP_SPI_CS_1_SPI
;
52 * Use GPIO pin SPI CS2 for CS2 actually (it can be used for other
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
);