Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
| 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 | #include <linux/kernel.h> |
| 14 | #include <linux/platform_device.h> |
| 15 | #include <asm/mach-types.h> |
| 16 | #include <asm/mach/arch.h> |
| 17 | #include <mach/board.h> |
| 18 | #include <mach/msm_iomap.h> |
| 19 | #include <mach/gpio.h> |
| 20 | #include <mach/gpiomux.h> |
| 21 | #include "timer.h" |
| 22 | #include "devices.h" |
| 23 | |
Rohit Vaswani | 0966687 | 2011-08-23 17:41:54 -0700 | [diff] [blame] | 24 | static struct platform_device *common_devices[] = { |
| 25 | &msm9615_device_uart_gsbi4, |
| 26 | }; |
| 27 | |
| 28 | static struct gpiomux_setting gsbi4 = { |
| 29 | .func = GPIOMUX_FUNC_1, |
| 30 | .drv = GPIOMUX_DRV_8MA, |
| 31 | .pull = GPIOMUX_PULL_NONE, |
| 32 | }; |
| 33 | |
| 34 | struct msm_gpiomux_config msm9615_gsbi_configs[] __initdata = { |
| 35 | { |
| 36 | .gpio = 12, /* GSBI4 UART */ |
| 37 | .settings = { |
| 38 | [GPIOMUX_SUSPENDED] = &gsbi4, |
| 39 | }, |
| 40 | }, |
| 41 | { |
| 42 | .gpio = 13, /* GSBI4 UART */ |
| 43 | .settings = { |
| 44 | [GPIOMUX_SUSPENDED] = &gsbi4, |
| 45 | }, |
| 46 | }, |
| 47 | { |
| 48 | .gpio = 14, /* GSBI4 UART */ |
| 49 | .settings = { |
| 50 | [GPIOMUX_SUSPENDED] = &gsbi4, |
| 51 | }, |
| 52 | }, |
| 53 | { |
| 54 | .gpio = 15, /* GSBI4 UART */ |
| 55 | .settings = { |
| 56 | [GPIOMUX_SUSPENDED] = &gsbi4, |
| 57 | }, |
| 58 | }, |
| 59 | }; |
| 60 | |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 61 | static int __init gpiomux_init(void) |
| 62 | { |
| 63 | int rc; |
| 64 | |
| 65 | rc = msm_gpiomux_init(NR_GPIO_IRQS); |
| 66 | if (rc) { |
| 67 | pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc); |
| 68 | return rc; |
| 69 | } |
Rohit Vaswani | 0966687 | 2011-08-23 17:41:54 -0700 | [diff] [blame] | 70 | msm_gpiomux_install(msm9615_gsbi_configs, |
| 71 | ARRAY_SIZE(msm9615_gsbi_configs)); |
| 72 | |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 73 | return 0; |
| 74 | } |
| 75 | |
| 76 | static void __init msm9615_common_init(void) |
| 77 | { |
| 78 | msm9615_device_init(); |
| 79 | gpiomux_init(); |
Rohit Vaswani | 0966687 | 2011-08-23 17:41:54 -0700 | [diff] [blame] | 80 | platform_add_devices(common_devices, ARRAY_SIZE(common_devices)); |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | static void __init msm9615_cdp_init(void) |
| 84 | { |
| 85 | msm9615_common_init(); |
| 86 | } |
| 87 | |
| 88 | static void __init msm9615_mtp_init(void) |
| 89 | { |
| 90 | msm9615_common_init(); |
| 91 | } |
| 92 | |
| 93 | MACHINE_START(MSM9615_CDP, "QCT MSM9615 CDP") |
| 94 | .map_io = msm9615_map_io, |
| 95 | .init_irq = msm9615_init_irq, |
| 96 | .timer = &msm_timer, |
| 97 | .init_machine = msm9615_cdp_init, |
| 98 | MACHINE_END |
| 99 | |
| 100 | MACHINE_START(MSM9615_MTP, "QCT MSM9615 MTP") |
| 101 | .map_io = msm9615_map_io, |
| 102 | .init_irq = msm9615_init_irq, |
| 103 | .timer = &msm_timer, |
| 104 | .init_machine = msm9615_mtp_init, |
| 105 | MACHINE_END |