changed Makefile and profiles, added patches for kernel 2.6.24 (stable-branch of...
[openwrt/openwrt.git] / target / linux / s3c24xx / patches-2.6.26 / 0231-use-gta02-glamo-mci-sd-dynamic-clock.patch.patch
1 From cba90f4bb9fc765be789e7d9e0f836ad4670c87f Mon Sep 17 00:00:00 2001
2 From: Andy Green <andy@openmoko.com>
3 Date: Wed, 30 Jul 2008 14:37:17 +0100
4 Subject: [PATCH] use-gta02-glamo-mci-sd-dynamic-clock.patch
5
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.
9
10 Signed-off-by: Andy Green <andy@openmoko.com>
11 ---
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(-)
15
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
20 @@ -85,6 +85,8 @@
21 #include <linux/gta02_hdq.h>
22 #include <linux/bq27000_battery.h>
23
24 +#include "../plat-s3c24xx/neo1973_pm_gps.h"
25 +
26 /* arbitrates which sensor IRQ owns the shared SPI bus */
27 static spinlock_t motion_irq_lock;
28
29 @@ -1424,6 +1426,15 @@ static void gta02_glamo_mci_suspending(struct platform_device *dev)
30
31 /* Smedia Glamo 3362 */
32
33 +/*
34 + * we crank down SD Card clock dynamically when GPS is powered
35 + */
36 +
37 +static int gta02_glamo_mci_use_slow(void)
38 +{
39 + return neo1973_pm_gps_is_on();
40 +}
41 +
42 static struct glamofb_platform_data gta02_glamo_pdata = {
43 .width = 43,
44 .height = 58,
45 @@ -1456,6 +1467,7 @@ static struct glamofb_platform_data gta02_glamo_pdata = {
46
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 {
58
59 static struct neo1973_pm_gps_data neo1973_gps;
60
61 +int neo1973_pm_gps_is_on(void)
62 +{
63 + return neo1973_gps.power_was_on;
64 +}
65 +EXPORT_SYMBOL_GPL(neo1973_pm_gps_is_on);
66 +
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)
73 {
74 +
75 + neo1973_gps.power_was_on = !!on;
76 +
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,
82 pm_message_t state)
83 {
84 -
85 - neo1973_gps.power_was_on = gps_pwron_get();
86 -
87 #ifdef CONFIG_MACH_NEO1973_GTA01
88 if (machine_is_neo1973_gta01()) {
89 /* FIXME */
90 --
91 1.5.6.3
92