aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-msm/board-qsd8x50.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-17 22:13:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-17 22:13:18 -0400
commit6899608533410557e6698cb9d4ff6df553916e98 (patch)
treeb392548a6757d08ec7b1395925499e032c174411 /arch/arm/mach-msm/board-qsd8x50.c
parent411f5c7a502769ccc0377c5ba36cb0b283847ba8 (diff)
parent92c260f755c42337c550d8ac1f8ccd1b32bffb20 (diff)
Merge branch 'for-linus' of git://codeaurora.org/quic/kernel/davidb/linux-msm
* 'for-linus' of git://codeaurora.org/quic/kernel/davidb/linux-msm: (46 commits) msm: scm: Check for interruption immediately msm: scm: Fix improper register assignment msm: scm: Mark inline asm as volatile msm: iommu: Enable HTW L2 redirection on MSM8960 msm: iommu: Don't read from write-only registers msm: iommu: Remove dependency on IDR msm: iommu: Use ASID tagging instead of VMID tagging msm: iommu: Rework clock logic and add IOMMU bus clock control msm: iommu: Clock control for the IOMMU driver msm: mdp: Set the correct pack pattern for XRGB/ARGB msm_fb: Fix framebuffer console msm: mdp: Add support for RGBX 8888 image format. video: msmfb: Put the partial update magic value into the fix_screen struct. msm: clock: Migrate to clkdev msm: clock: Remove references to clk_ops_pcom msm: headsmp.S: Fix section mismatch msm: Use explicit GPLv2 licenses msm: iommu: Enable IOMMU support for MSM8960 msm: iommu: Generalize platform data for multiple targets msm: iommu: Create a Kconfig item for the IOMMU driver ...
Diffstat (limited to 'arch/arm/mach-msm/board-qsd8x50.c')
-rw-r--r--arch/arm/mach-msm/board-qsd8x50.c86
1 files changed, 81 insertions, 5 deletions
diff --git a/arch/arm/mach-msm/board-qsd8x50.c b/arch/arm/mach-msm/board-qsd8x50.c
index 15c2bbd2ef81..7f568611547e 100644
--- a/arch/arm/mach-msm/board-qsd8x50.c
+++ b/arch/arm/mach-msm/board-qsd8x50.c
@@ -1,4 +1,4 @@
1/* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved. 1/* Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved.
2 * 2 *
3 * This program is free software; you can redistribute it and/or modify 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 4 * it under the terms of the GNU General Public License version 2 and
@@ -21,6 +21,8 @@
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/delay.h> 22#include <linux/delay.h>
23#include <linux/usb/msm_hsusb.h> 23#include <linux/usb/msm_hsusb.h>
24#include <linux/err.h>
25#include <linux/clkdev.h>
24 26
25#include <asm/mach-types.h> 27#include <asm/mach-types.h>
26#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
@@ -31,6 +33,8 @@
31#include <mach/irqs.h> 33#include <mach/irqs.h>
32#include <mach/sirc.h> 34#include <mach/sirc.h>
33#include <mach/gpio.h> 35#include <mach/gpio.h>
36#include <mach/vreg.h>
37#include <mach/mmc.h>
34 38
35#include "devices.h" 39#include "devices.h"
36 40
@@ -95,6 +99,81 @@ static struct platform_device *devices[] __initdata = {
95 &msm_device_hsusb_host, 99 &msm_device_hsusb_host,
96}; 100};
97 101
102static struct msm_mmc_gpio sdc1_gpio_cfg[] = {
103 {51, "sdc1_dat_3"},
104 {52, "sdc1_dat_2"},
105 {53, "sdc1_dat_1"},
106 {54, "sdc1_dat_0"},
107 {55, "sdc1_cmd"},
108 {56, "sdc1_clk"}
109};
110
111static struct vreg *vreg_mmc;
112static unsigned long vreg_sts;
113
114static uint32_t msm_sdcc_setup_power(struct device *dv, unsigned int vdd)
115{
116 int rc = 0;
117 struct platform_device *pdev;
118
119 pdev = container_of(dv, struct platform_device, dev);
120
121 if (vdd == 0) {
122 if (!vreg_sts)
123 return 0;
124
125 clear_bit(pdev->id, &vreg_sts);
126
127 if (!vreg_sts) {
128 rc = vreg_disable(vreg_mmc);
129 if (rc)
130 pr_err("vreg_mmc disable failed for slot "
131 "%d: %d\n", pdev->id, rc);
132 }
133 return 0;
134 }
135
136 if (!vreg_sts) {
137 rc = vreg_set_level(vreg_mmc, 2900);
138 if (rc)
139 pr_err("vreg_mmc set level failed for slot %d: %d\n",
140 pdev->id, rc);
141 rc = vreg_enable(vreg_mmc);
142 if (rc)
143 pr_err("vreg_mmc enable failed for slot %d: %d\n",
144 pdev->id, rc);
145 }
146 set_bit(pdev->id, &vreg_sts);
147 return 0;
148}
149
150static struct msm_mmc_gpio_data sdc1_gpio = {
151 .gpio = sdc1_gpio_cfg,
152 .size = ARRAY_SIZE(sdc1_gpio_cfg),
153};
154
155static struct msm_mmc_platform_data qsd8x50_sdc1_data = {
156 .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
157 .translate_vdd = msm_sdcc_setup_power,
158 .gpio_data = &sdc1_gpio,
159};
160
161static void __init qsd8x50_init_mmc(void)
162{
163 if (machine_is_qsd8x50_ffa() || machine_is_qsd8x50a_ffa())
164 vreg_mmc = vreg_get(NULL, "gp6");
165 else
166 vreg_mmc = vreg_get(NULL, "gp5");
167
168 if (IS_ERR(vreg_mmc)) {
169 pr_err("vreg get for vreg_mmc failed (%ld)\n",
170 PTR_ERR(vreg_mmc));
171 return;
172 }
173
174 msm_add_sdcc(1, &qsd8x50_sdc1_data, 0, 0);
175}
176
98static void __init qsd8x50_map_io(void) 177static void __init qsd8x50_map_io(void)
99{ 178{
100 msm_map_qsd8x50_io(); 179 msm_map_qsd8x50_io();
@@ -113,11 +192,10 @@ static void __init qsd8x50_init(void)
113 msm_device_hsusb.dev.parent = &msm_device_otg.dev; 192 msm_device_hsusb.dev.parent = &msm_device_otg.dev;
114 msm_device_hsusb_host.dev.parent = &msm_device_otg.dev; 193 msm_device_hsusb_host.dev.parent = &msm_device_otg.dev;
115 platform_add_devices(devices, ARRAY_SIZE(devices)); 194 platform_add_devices(devices, ARRAY_SIZE(devices));
195 qsd8x50_init_mmc();
116} 196}
117 197
118MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF") 198MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF")
119#ifdef CONFIG_MSM_DEBUG_UART
120#endif
121 .boot_params = PLAT_PHYS_OFFSET + 0x100, 199 .boot_params = PLAT_PHYS_OFFSET + 0x100,
122 .map_io = qsd8x50_map_io, 200 .map_io = qsd8x50_map_io,
123 .init_irq = qsd8x50_init_irq, 201 .init_irq = qsd8x50_init_irq,
@@ -126,8 +204,6 @@ MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF")
126MACHINE_END 204MACHINE_END
127 205
128MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5") 206MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5")
129#ifdef CONFIG_MSM_DEBUG_UART
130#endif
131 .boot_params = PLAT_PHYS_OFFSET + 0x100, 207 .boot_params = PLAT_PHYS_OFFSET + 0x100,
132 .map_io = qsd8x50_map_io, 208 .map_io = qsd8x50_map_io,
133 .init_irq = qsd8x50_init_irq, 209 .init_irq = qsd8x50_init_irq,