blob: 15d7679231f11a5dd8f07df95a87bcce4bf08faf [file] [log] [blame]
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -08001/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
Hanumant Singh55a1bb02012-11-06 10:01:15 -08002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13
14#include <linux/init.h>
15#include <linux/ioport.h>
16#include <mach/board.h>
17#include <mach/gpio.h>
18#include <mach/gpiomux.h>
19
Gilad Avidovf84f2792013-01-31 13:26:39 -070020static struct gpiomux_setting gpio_i2c_config = {
21 .func = GPIOMUX_FUNC_3,
22 .drv = GPIOMUX_DRV_2MA,
23 .pull = GPIOMUX_PULL_NONE,
24};
25
Gilad Avidovf58f1832013-01-09 17:31:28 -070026static struct gpiomux_setting gpio_spi_config = {
27 .func = GPIOMUX_FUNC_1,
28 .drv = GPIOMUX_DRV_6MA,
29 .pull = GPIOMUX_PULL_NONE,
30};
31
32static struct gpiomux_setting gpio_spi_cs_config = {
33 .func = GPIOMUX_FUNC_1,
34 .drv = GPIOMUX_DRV_6MA,
35 .pull = GPIOMUX_PULL_DOWN,
36};
37
Gilad Avidovf84f2792013-01-31 13:26:39 -070038static struct msm_gpiomux_config msm_blsp_configs[] __initdata = {
39 {
Gilad Avidovf58f1832013-01-09 17:31:28 -070040 .gpio = 10, /* BLSP1 QUP3 I2C_SDA */
Gilad Avidovf84f2792013-01-31 13:26:39 -070041 .settings = {
42 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
43 },
44 },
45 {
Gilad Avidovf58f1832013-01-09 17:31:28 -070046 .gpio = 11, /* BLSP1 QUP3 I2C_SCL */
Gilad Avidovf84f2792013-01-31 13:26:39 -070047 .settings = {
48 [GPIOMUX_SUSPENDED] = &gpio_i2c_config,
49 },
50 },
Gilad Avidovf58f1832013-01-09 17:31:28 -070051 {
52 .gpio = 0, /* BLSP1 QUP1 SPI_DATA_MOSI */
53 .settings = {
54 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
55 },
56 },
57 {
58 .gpio = 1, /* BLSP1 QUP1 SPI_DATA_MISO */
59 .settings = {
60 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
61 },
62 },
63 {
64 .gpio = 3, /* BLSP1 QUP1 SPI_CLK */
65 .settings = {
66 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
67 },
68 },
69 {
70 .gpio = 2, /* BLSP1 QUP1 SPI_CS1 */
71 .settings = {
72 [GPIOMUX_SUSPENDED] = &gpio_spi_cs_config,
73 },
74 },
Gilad Avidovf84f2792013-01-31 13:26:39 -070075};
76
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -080077void __init msm8610_init_gpiomux(void)
Hanumant Singh55a1bb02012-11-06 10:01:15 -080078{
79 int rc;
80
Rohit Vaswani341c2032012-11-08 18:49:29 -080081 rc = msm_gpiomux_init_dt();
Hanumant Singh55a1bb02012-11-06 10:01:15 -080082 if (rc) {
Rohit Vaswani341c2032012-11-08 18:49:29 -080083 pr_err("%s failed %d\n", __func__, rc);
Hanumant Singh55a1bb02012-11-06 10:01:15 -080084 return;
85 }
Gilad Avidovf84f2792013-01-31 13:26:39 -070086
87 msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));
Hanumant Singh55a1bb02012-11-06 10:01:15 -080088}