1 From d4b28ec4e2818207cc0e48b90dbce581e0b779e7 Mon Sep 17 00:00:00 2001
2 From: Andy Green <andy@openmoko.com>
3 Date: Wed, 30 Jul 2008 12:46:56 +0100
4 Subject: [PATCH] use-gta02-glamo-mci-sd-dynamic-clock.patch
6 This patch uses the new glamo-mci slow clock ratio
7 patch in order to dynamically reduce SD Card clock
8 rate when the GPS unit is powered on GTA02.
10 Signed-off-by: Andy Green <andy@openmoko.com>
12 arch/arm/mach-s3c2440/mach-gta02.c | 12 ++++++++++++
13 arch/arm/plat-s3c24xx/neo1973_pm_gps.c | 12 +++++++++---
14 2 files changed, 21 insertions(+), 3 deletions(-)
16 diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
17 index 382837d..8e43c4a 100644
18 --- a/arch/arm/mach-s3c2440/mach-gta02.c
19 +++ b/arch/arm/mach-s3c2440/mach-gta02.c
21 #include <linux/gta02_hdq.h>
22 #include <linux/bq27000_battery.h>
24 +#include "../plat-s3c24xx/neo1973_pm_gps.h"
26 /* arbitrates which sensor IRQ owns the shared SPI bus */
27 static spinlock_t motion_irq_lock;
29 @@ -1424,6 +1426,15 @@ static void gta02_glamo_mci_suspending(struct platform_device *dev)
31 /* Smedia Glamo 3362 */
34 + * we crank down SD Card clock dynamically when GPS is powered
37 +static int gta02_glamo_mci_use_slow(void)
39 + return neo1973_pm_gps_is_on();
42 static struct glamofb_platform_data gta02_glamo_pdata = {
45 @@ -1456,6 +1467,7 @@ static struct glamofb_platform_data gta02_glamo_pdata = {
47 /* glamo MMC function platform data */
48 .glamo_set_mci_power = gta02_glamo_mmc_set_power,
49 + .glamo_mci_use_slow = gta02_glamo_mci_use_slow,
50 .glamo_irq_is_wired = glamo_irq_is_wired,
51 .mci_suspending = gta02_glamo_mci_suspending,
52 .mci_all_dependencies_resumed =
53 diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_gps.c b/arch/arm/plat-s3c24xx/neo1973_pm_gps.c
54 index 8cd583d..a21b763 100644
55 --- a/arch/arm/plat-s3c24xx/neo1973_pm_gps.c
56 +++ b/arch/arm/plat-s3c24xx/neo1973_pm_gps.c
57 @@ -39,6 +39,12 @@ struct neo1973_pm_gps_data {
59 static struct neo1973_pm_gps_data neo1973_gps;
61 +int neo1973_pm_gps_is_on(void)
63 + return neo1973_gps.power_was_on;
65 +EXPORT_SYMBOL_GPL(neo1973_pm_gps_is_on);
67 /* This is the 2.8V supply for the RTC crystal, the mail clock crystal and
68 * the input to VDD_RF */
69 static void gps_power_2v8_set(int on)
70 @@ -265,6 +271,9 @@ static int gps_power_1v5_get(void)
71 /* This is the POWERON pin */
72 static void gps_pwron_set(int on)
75 + neo1973_gps.power_was_on = !!on;
77 #ifdef CONFIG_MACH_NEO1973_GTA01
78 if (machine_is_neo1973_gta01())
79 neo1973_gpb_setpin(GTA01_GPIO_GPS_PWRON, on);
80 @@ -492,9 +501,6 @@ static DEVICE_ATTR(power_sequence, 0644, power_sequence_read,
81 static int gta01_pm_gps_suspend(struct platform_device *pdev,
85 - neo1973_gps.power_was_on = gps_pwron_get();
87 #ifdef CONFIG_MACH_NEO1973_GTA01
88 if (machine_is_neo1973_gta01()) {