Duy Truong | e833aca | 2013-02-12 13:35:08 -0800 | [diff] [blame^] | 1 | /* Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Ravi Kumar V | 651a565 | 2012-09-01 00:06:02 +0530 | [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 | |
| 20 | static struct gpiomux_setting gpio_uart_config = { |
| 21 | .func = GPIOMUX_FUNC_2, |
| 22 | .drv = GPIOMUX_DRV_16MA, |
| 23 | .pull = GPIOMUX_PULL_NONE, |
| 24 | .dir = GPIOMUX_OUT_HIGH, |
| 25 | }; |
| 26 | |
| 27 | static struct msm_gpiomux_config msm_blsp_configs[] __initdata = { |
| 28 | { |
| 29 | .gpio = 45, /* BLSP8 UART TX */ |
| 30 | .settings = { |
| 31 | [GPIOMUX_SUSPENDED] = &gpio_uart_config, |
| 32 | }, |
| 33 | }, |
| 34 | { |
| 35 | .gpio = 46, /* BLSP8 UART RX */ |
| 36 | .settings = { |
| 37 | [GPIOMUX_SUSPENDED] = &gpio_uart_config, |
| 38 | }, |
| 39 | }, |
| 40 | }; |
| 41 | |
| 42 | void __init mpq8092_init_gpiomux(void) |
| 43 | { |
| 44 | int rc; |
| 45 | |
| 46 | rc = msm_gpiomux_init(NR_GPIO_IRQS); |
| 47 | if (rc) { |
| 48 | pr_err(KERN_ERR "mpq8092_init_gpiomux failed %d\n", rc); |
| 49 | return; |
| 50 | } |
| 51 | |
| 52 | msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs)); |
| 53 | } |