Syed Rameez Mustafa | 3971c14 | 2013-01-09 19:04:53 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
Hanumant Singh | 55a1bb0 | 2012-11-06 10:01:15 -0800 | [diff] [blame] | 2 | * |
| 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 Avidov | f84f279 | 2013-01-31 13:26:39 -0700 | [diff] [blame] | 20 | static struct gpiomux_setting gpio_i2c_config = { |
| 21 | .func = GPIOMUX_FUNC_3, |
| 22 | .drv = GPIOMUX_DRV_2MA, |
| 23 | .pull = GPIOMUX_PULL_NONE, |
| 24 | }; |
| 25 | |
Gilad Avidov | f58f183 | 2013-01-09 17:31:28 -0700 | [diff] [blame^] | 26 | static struct gpiomux_setting gpio_spi_config = { |
| 27 | .func = GPIOMUX_FUNC_1, |
| 28 | .drv = GPIOMUX_DRV_6MA, |
| 29 | .pull = GPIOMUX_PULL_NONE, |
| 30 | }; |
| 31 | |
| 32 | static 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 Avidov | f84f279 | 2013-01-31 13:26:39 -0700 | [diff] [blame] | 38 | static struct msm_gpiomux_config msm_blsp_configs[] __initdata = { |
| 39 | { |
Gilad Avidov | f58f183 | 2013-01-09 17:31:28 -0700 | [diff] [blame^] | 40 | .gpio = 10, /* BLSP1 QUP3 I2C_SDA */ |
Gilad Avidov | f84f279 | 2013-01-31 13:26:39 -0700 | [diff] [blame] | 41 | .settings = { |
| 42 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 43 | }, |
| 44 | }, |
| 45 | { |
Gilad Avidov | f58f183 | 2013-01-09 17:31:28 -0700 | [diff] [blame^] | 46 | .gpio = 11, /* BLSP1 QUP3 I2C_SCL */ |
Gilad Avidov | f84f279 | 2013-01-31 13:26:39 -0700 | [diff] [blame] | 47 | .settings = { |
| 48 | [GPIOMUX_SUSPENDED] = &gpio_i2c_config, |
| 49 | }, |
| 50 | }, |
Gilad Avidov | f58f183 | 2013-01-09 17:31:28 -0700 | [diff] [blame^] | 51 | { |
| 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 Avidov | f84f279 | 2013-01-31 13:26:39 -0700 | [diff] [blame] | 75 | }; |
| 76 | |
Syed Rameez Mustafa | 3971c14 | 2013-01-09 19:04:53 -0800 | [diff] [blame] | 77 | void __init msm8610_init_gpiomux(void) |
Hanumant Singh | 55a1bb0 | 2012-11-06 10:01:15 -0800 | [diff] [blame] | 78 | { |
| 79 | int rc; |
| 80 | |
Rohit Vaswani | 341c203 | 2012-11-08 18:49:29 -0800 | [diff] [blame] | 81 | rc = msm_gpiomux_init_dt(); |
Hanumant Singh | 55a1bb0 | 2012-11-06 10:01:15 -0800 | [diff] [blame] | 82 | if (rc) { |
Rohit Vaswani | 341c203 | 2012-11-08 18:49:29 -0800 | [diff] [blame] | 83 | pr_err("%s failed %d\n", __func__, rc); |
Hanumant Singh | 55a1bb0 | 2012-11-06 10:01:15 -0800 | [diff] [blame] | 84 | return; |
| 85 | } |
Gilad Avidov | f84f279 | 2013-01-31 13:26:39 -0700 | [diff] [blame] | 86 | |
| 87 | msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs)); |
Hanumant Singh | 55a1bb0 | 2012-11-06 10:01:15 -0800 | [diff] [blame] | 88 | } |