wl1251: use wiphy_dev instead of wl->spi->dev
[linux/fpc-iii.git] / arch / arm / mach-u300 / padmux.c
blobf3664564f08695b3d2960c3b95b5ab34e022813d
1 /*
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>
12 #include <linux/io.h>
13 #include <linux/err.h>
14 #include <mach/u300-regs.h>
15 #include <mach/syscon.h>
17 #include "padmux.h"
19 /* Set the PAD MUX to route the MMC reader correctly to GPIO0. */
20 void pmx_set_mission_mode_mmc(void)
22 u16 val;
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)
35 u16 val;
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
41 * GPIO, DSP, AAIF
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
47 * things also)
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
53 * things also)
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);