summaryrefslogtreecommitdiff
path: root/target/linux/s3c24xx/patches-2.6.26/0029-gta02-power_control.patch.patch
blob: 27049690db4f5e056598453e540d17f926f54b72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
From 70a0c17968f5151ce4f468785860e04bbc7a9d3c Mon Sep 17 00:00:00 2001
From: mokopatches <mokopatches@openmoko.org>
Date: Wed, 16 Jul 2008 14:46:56 +0100
Subject: [PATCH] gta02-power_control.patch

---
 arch/arm/plat-s3c24xx/neo1973_pm_bt.c  |   84 +++++++++---
 arch/arm/plat-s3c24xx/neo1973_pm_gps.c |  217 ++++++++++++++++++++++++--------
 arch/arm/plat-s3c24xx/neo1973_pm_gsm.c |   97 ++++++++++++--
 3 files changed, 309 insertions(+), 89 deletions(-)

diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_bt.c b/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
index b1af441..d685ef7 100644
--- a/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
+++ b/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
@@ -19,7 +19,9 @@
 #include <linux/pcf50606.h>
 
 #include <asm/hardware.h>
+#include <asm/mach-types.h>
 #include <asm/arch/gta01.h>
+#include <asm/arch/gta02.h>
 
 #define DRVMSG "FIC Neo1973 Bluetooth Power Management"
 
@@ -27,14 +29,30 @@ static ssize_t bt_read(struct device *dev, struct device_attribute *attr,
 		       char *buf)
 {
 	if (!strcmp(attr->attr.name, "power_on")) {
-		if (pcf50606_onoff_get(pcf50606_global,
-					PCF50606_REGULATOR_D1REG) &&
-		    pcf50606_voltage_get(pcf50606_global,
-					 PCF50606_REGULATOR_D1REG) == 3100)
-			goto out_1;
+		switch (machine_arch_type) {
+		case MACH_TYPE_NEO1973_GTA01:
+			if (pcf50606_onoff_get(pcf50606_global,
+						PCF50606_REGULATOR_D1REG) &&
+			    pcf50606_voltage_get(pcf50606_global,
+						 PCF50606_REGULATOR_D1REG) == 3100)
+				goto out_1;
+			break;
+		case MACH_TYPE_NEO1973_GTA02:
+			if (s3c2410_gpio_getpin(GTA02_GPIO_BT_EN))
+				goto out_1;
+			break;
+		}
 	} else if (!strcmp(attr->attr.name, "reset")) {
-		if (s3c2410_gpio_getpin(GTA01_GPIO_BT_EN) == 0)
-			goto out_1;
+		switch (machine_arch_type) {
+		case MACH_TYPE_NEO1973_GTA01:
+			if (s3c2410_gpio_getpin(GTA01_GPIO_BT_EN) == 0)
+				goto out_1;
+			break;
+		case MACH_TYPE_NEO1973_GTA02:
+			if (s3c2410_gpio_getpin(GTA02_GPIO_BT_EN) == 0)
+				goto out_1;
+			break;
+		}
 	}
 
 	return strlcpy(buf, "0\n", 3);
@@ -48,20 +66,37 @@ static ssize_t bt_write(struct device *dev, struct device_attribute *attr,
 	unsigned long on = simple_strtoul(buf, NULL, 10);
 
 	if (!strcmp(attr->attr.name, "power_on")) {
-		/* if we are powering up, assert reset, then power, then
-		 * release reset */
-		if (on) {
-			s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, 0);
-			pcf50606_voltage_set(pcf50606_global,
-					     PCF50606_REGULATOR_D1REG,
-					     3100);
+		switch (machine_arch_type) {
+		case MACH_TYPE_NEO1973_GTA01:
+			/* if we are powering up, assert reset, then power,
+			 * then release reset */
+			if (on) {
+				s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, 0);
+				pcf50606_voltage_set(pcf50606_global,
+						     PCF50606_REGULATOR_D1REG,
+						     3100);
+			}
+			pcf50606_onoff_set(pcf50606_global,
+					   PCF50606_REGULATOR_D1REG, on);
+			s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, on);
+			break;
+		case MACH_TYPE_NEO1973_GTA02:
+			if (on)
+				s3c2410_gpio_setpin(GTA02_GPIO_BT_EN, 0);
+			else
+				s3c2410_gpio_setpin(GTA02_GPIO_BT_EN, 1);
+			break;
 		}
-		pcf50606_onoff_set(pcf50606_global,
-				   PCF50606_REGULATOR_D1REG, on);
-		s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, on);
 	} else if (!strcmp(attr->attr.name, "reset")) {
 		/* reset is low-active, so we need to invert */
-		s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, on ? 0 : 1);
+		switch (machine_arch_type) {
+		case MACH_TYPE_NEO1973_GTA01:
+			s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, on ? 0 : 1);
+			break;
+		case MACH_TYPE_NEO1973_GTA02:
+			s3c2410_gpio_setpin(GTA02_GPIO_BT_EN, on ? 0 : 1);
+			break;
+		}
 	}
 
 	return count;
@@ -107,9 +142,16 @@ static int __init gta01_bt_probe(struct platform_device *pdev)
 {
 	dev_info(&pdev->dev, DRVMSG ": starting\n");
 
-	/* we make sure that the voltage is off */
-	pcf50606_onoff_set(pcf50606_global,
-			   PCF50606_REGULATOR_D1REG, 0);
+	switch (machine_arch_type) {
+	case MACH_TYPE_NEO1973_GTA01:
+		/* we make sure that the voltage is off */
+		pcf50606_onoff_set(pcf50606_global,
+				   PCF50606_REGULATOR_D1REG, 0);
+		break;
+	case MACH_TYPE_NEO1973_GTA02:
+		/* FIXME: implementation */
+		break;
+	}
 	/* we pull reset to low to make sure that the chip doesn't
 	 * drain power through the reset line */
 	s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, 0);
diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_gps.c b/arch/arm/plat-s3c24xx/neo1973_pm_gps.c
index f8cf719..6bd8054 100644
--- a/arch/arm/plat-s3c24xx/neo1973_pm_gps.c
+++ b/arch/arm/plat-s3c24xx/neo1973_pm_gps.c
@@ -17,10 +17,18 @@
 #include <linux/delay.h>
 #include <linux/platform_device.h>
 
-#include <linux/pcf50606.h>
-
 #include <asm/hardware.h>
+
+#include <asm/mach-types.h>
+#ifdef CONFIG_MACH_NEO1973_GTA01
 #include <asm/arch/gta01.h>
+#include <linux/pcf50606.h>
+#endif
+
+#ifdef CONFIG_MACH_NEO1973_GTA02
+#include <asm/arch/gta02.h>
+#include <linux/pcf50633.h>
+#endif
 
 /* This is the 2.8V supply for the RTC crystal, the mail clock crystal and
  * the input to VDD_RF */
@@ -248,15 +256,42 @@ static int gps_power_1v5_get(void)
 /* This is the POWERON pin */
 static void gps_pwron_set(int on)
 {
-	s3c2410_gpio_setpin(GTA01_GPIO_GPS_PWRON, on);
+#ifdef CONFIG_MACH_NEO1973_GTA01
+	if (machine_is_neo1973_gta01())
+		s3c2410_gpio_setpin(GTA01_GPIO_GPS_PWRON, on);
+#endif /* CONFIG_MACH_NEO1973_GTA01 */
+
+#ifdef CONFIG_MACH_NEO1973_GTA02
+	if (machine_is_neo1973_gta02()) {
+		if (on)
+			pcf50633_voltage_set(pcf50633_global,
+				PCF50633_REGULATOR_LDO5, 3000);
+			pcf50633_onoff_set(pcf50633_global,
+				PCF50633_REGULATOR_LDO5, on);
+	}
+#endif /* CONFIG_MACH_NEO1973_GTA02 */
 }
 
 static int gps_pwron_get(void)
 {
-	if (s3c2410_gpio_getpin(GTA01_GPIO_GPS_PWRON))
-		return 1;
-	else
-		return 0;
+#ifdef CONFIG_MACH_NEO1973_GTA01
+	if (machine_is_neo1973_gta01()) {
+		if (s3c2410_gpio_getpin(GTA01_GPIO_GPS_PWRON))
+			return 1;
+		else
+			return 0;
+	}
+#endif /* CONFIG_MACH_NEO1973_GTA01 */
+
+#ifdef CONFIG_MACH_NEO1973_GTA02
+	if (machine_is_neo1973_gta02()) {
+		if (pcf50633_onoff_get(pcf50633_global, PCF50633_REGULATOR_LDO5))
+			return 1;
+		else
+			return 0;
+	}
+#endif /* CONFIG_MACH_NEO1973_GTA02 */
+	return -1;
 }
 
 /* This is the nRESET pin */
@@ -441,17 +476,40 @@ static DEVICE_ATTR(power_sequence, 0644, power_sequence_read,
 static int gta01_pm_gps_suspend(struct platform_device *pdev,
 				pm_message_t state)
 {
-	/* FIXME */
-	gps_power_sequence_down();
+#ifdef CONFIG_MACH_NEO1973_GTA01
+	if (machine_is_neo1973_gta01()) {
+		/* FIXME */
+		gps_power_sequence_down();
+	}
+#endif /* CONFIG_MACH_NEO1973_GTA01 */
+
+#ifdef CONFIG_MACH_NEO1973_GTA02
+	if (machine_is_neo1973_gta02()) {
+		/* FIXME */
+		pcf50633_onoff_set(pcf50633_global,
+			PCF50633_REGULATOR_LDO5, 0);
+	}
+#endif /* CONFIG_MACH_NEO1973_GTA02 */
 
 	return 0;
 }
 
 static int gta01_pm_gps_resume(struct platform_device *pdev)
 {
-	/* FIXME */
-	gps_power_sequence_up();
-
+#ifdef CONFIG_MACH_NEO1973_GTA01
+	if (machine_is_neo1973_gta01()) {
+		/* FIXME */
+		gps_power_sequence_up();
+	}
+#endif /* CONFIG_MACH_NEO1973_GTA01 */
+
+#ifdef CONFIG_MACH_NEO1973_GTA02
+	if (machine_is_neo1973_gta02()) {
+		/* FIXME */
+		pcf50633_onoff_set(pcf50633_global,
+			PCF50633_REGULATOR_LDO5, 1);
+#endif /* CONFIG_MACH_NEO1973_GTA02 */
+	}
 	return 0;
 }
 #else
@@ -476,59 +534,110 @@ static struct attribute_group gta01_gps_attr_group = {
 	.attrs	= gta01_gps_sysfs_entries,
 };
 
+static struct attribute *gta02_gps_sysfs_entries[] = {
+	&dev_attr_pwron.attr,
+	NULL
+};
+
+static struct attribute_group gta02_gps_attr_group = {
+	.name	= NULL,
+	.attrs	= gta02_gps_sysfs_entries,
+};
+
 static int __init gta01_pm_gps_probe(struct platform_device *pdev)
 {
-	s3c2410_gpio_cfgpin(GTA01_GPIO_GPS_PWRON, S3C2410_GPIO_OUTPUT);
+#ifdef CONFIG_MACH_NEO1973_GTA01
+	if (machine_is_neo1973_gta01()) {
+		s3c2410_gpio_cfgpin(GTA01_GPIO_GPS_PWRON, S3C2410_GPIO_OUTPUT);
 
-	switch (system_rev) {
-	case GTA01v3_SYSTEM_REV:
-		break;
-	case GTA01v4_SYSTEM_REV:
-		s3c2410_gpio_cfgpin(GTA01_GPIO_GPS_RESET, S3C2410_GPIO_OUTPUT);
-		break;
-	case GTA01Bv3_SYSTEM_REV:
-	case GTA01Bv4_SYSTEM_REV:
-		s3c2410_gpio_cfgpin(GTA01_GPIO_GPS_EN_3V3, S3C2410_GPIO_OUTPUT);
-		/* fallthrough */
-	case GTA01Bv2_SYSTEM_REV:
-		s3c2410_gpio_cfgpin(GTA01_GPIO_GPS_EN_2V8, S3C2410_GPIO_OUTPUT);
-		s3c2410_gpio_cfgpin(GTA01_GPIO_GPS_EN_3V, S3C2410_GPIO_OUTPUT);
-		s3c2410_gpio_cfgpin(GTA01_GPIO_GPS_RESET, S3C2410_GPIO_OUTPUT);
-		break;
-	default:
-		dev_warn(&pdev->dev, "Unknown GTA01 Revision 0x%x, "
-			 "AGPS PM features not available!!!\n",
-			 system_rev);
-		return -1;
-		break;
-	}
+		switch (system_rev) {
+		case GTA01v3_SYSTEM_REV:
+			break;
+		case GTA01v4_SYSTEM_REV:
+			s3c2410_gpio_cfgpin(GTA01_GPIO_GPS_RESET, S3C2410_GPIO_OUTPUT);
+			break;
+		case GTA01Bv3_SYSTEM_REV:
+		case GTA01Bv4_SYSTEM_REV:
+			s3c2410_gpio_cfgpin(GTA01_GPIO_GPS_EN_3V3, S3C2410_GPIO_OUTPUT);
+			/* fallthrough */
+		case GTA01Bv2_SYSTEM_REV:
+			s3c2410_gpio_cfgpin(GTA01_GPIO_GPS_EN_2V8, S3C2410_GPIO_OUTPUT);
+			s3c2410_gpio_cfgpin(GTA01_GPIO_GPS_EN_3V, S3C2410_GPIO_OUTPUT);
+			s3c2410_gpio_cfgpin(GTA01_GPIO_GPS_RESET, S3C2410_GPIO_OUTPUT);
+			break;
+		default:
+			dev_warn(&pdev->dev, "Unknown GTA01 Revision 0x%x, "
+				"AGPS PM features not available!!!\n",
+				system_rev);
+			return -1;
+			break;
+		}
 
-	gps_power_sequence_down();
+		gps_power_sequence_down();
 
-	switch (system_rev) {
-	case GTA01v3_SYSTEM_REV:
-	case GTA01v4_SYSTEM_REV:
-	case GTA01Bv2_SYSTEM_REV:
-		gta01_gps_sysfs_entries[ARRAY_SIZE(gta01_gps_sysfs_entries)-3] =
-					&dev_attr_power_tcxo_2v8.attr;
-		break;
-	case GTA01Bv3_SYSTEM_REV:
-	case GTA01Bv4_SYSTEM_REV:
-		gta01_gps_sysfs_entries[ARRAY_SIZE(gta01_gps_sysfs_entries)-3] =
-					&dev_attr_power_core_1v5.attr;
-		gta01_gps_sysfs_entries[ARRAY_SIZE(gta01_gps_sysfs_entries)-2] =
-					&dev_attr_power_vdd_core_1v5.attr;
-		break;
-	}
+		switch (system_rev) {
+		case GTA01v3_SYSTEM_REV:
+		case GTA01v4_SYSTEM_REV:
+		case GTA01Bv2_SYSTEM_REV:
+			gta01_gps_sysfs_entries[ARRAY_SIZE(gta01_gps_sysfs_entries)-3] =
+						&dev_attr_power_tcxo_2v8.attr;
+			break;
+		case GTA01Bv3_SYSTEM_REV:
+		case GTA01Bv4_SYSTEM_REV:
+			gta01_gps_sysfs_entries[ARRAY_SIZE(gta01_gps_sysfs_entries)-3] =
+						&dev_attr_power_core_1v5.attr;
+			gta01_gps_sysfs_entries[ARRAY_SIZE(gta01_gps_sysfs_entries)-2] =
+						&dev_attr_power_vdd_core_1v5.attr;
+			break;
+		}
 
-	return sysfs_create_group(&pdev->dev.kobj, &gta01_gps_attr_group);
+		return sysfs_create_group(&pdev->dev.kobj, &gta01_gps_attr_group);
+	}
+#endif /* CONFIG_MACH_NEO1973_GTA01 */
+
+#ifdef CONFIG_MACH_NEO1973_GTA02
+	if (machine_is_neo1973_gta02()) {
+		switch (system_rev) {
+		case GTA02v2_SYSTEM_REV:
+		case GTA02v3_SYSTEM_REV:
+		case GTA02v4_SYSTEM_REV:
+		case GTA02v5_SYSTEM_REV:
+		case GTA02v6_SYSTEM_REV:
+			pcf50633_voltage_set(pcf50633_global,
+				PCF50633_REGULATOR_LDO5, 3000);
+			pcf50633_onoff_set(pcf50633_global,
+				PCF50633_REGULATOR_LDO5, 0);
+			dev_info(&pdev->dev, "FIC Neo1973 GPS Power Managerment:"
+				 "starting\n");
+			break;
+		default:
+			dev_warn(&pdev->dev, "Unknown GTA02 Revision 0x%x, "
+				"AGPS PM features not available!!!\n",
+				system_rev);
+			return -1;
+			break;
+		}
+		return sysfs_create_group(&pdev->dev.kobj, &gta02_gps_attr_group);
+	}
+#endif /* CONFIG_MACH_NEO1973_GTA02 */
+	return -1;
 }
 
 static int gta01_pm_gps_remove(struct platform_device *pdev)
 {
-	gps_power_sequence_down();
-	sysfs_remove_group(&pdev->dev.kobj, &gta01_gps_attr_group);
+#ifdef CONFIG_MACH_NEO1973_GTA01
+	if (machine_is_neo1973_gta01()) {
+		gps_power_sequence_down();
+		sysfs_remove_group(&pdev->dev.kobj, &gta01_gps_attr_group);
+	}
+#endif /* CONFIG_MACH_NEO1973_GTA01 */
 
+#ifdef CONFIG_MACH_NEO1973_GTA02
+	if (machine_is_neo1973_gta02()) {
+		pcf50633_onoff_set(pcf50633_global, PCF50633_REGULATOR_LDO5, 0);
+		sysfs_remove_group(&pdev->dev.kobj, &gta02_gps_attr_group);
+	}
+#endif /* CONFIG_MACH_NEO1973_GTA02 */
 	return 0;
 }
 
diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c b/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
index a1615f8..13cb45b 100644
--- a/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
+++ b/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
@@ -19,8 +19,15 @@
 #include <linux/errno.h>
 
 #include <asm/hardware.h>
+#include <asm/mach-types.h>
 #include <asm/arch/gta01.h>
 
+#ifdef CONFIG_MACH_NEO1973_GTA02
+#include <asm/arch/gta02.h>
+#include <linux/pcf50633.h>
+#include <asm/arch/regs-gpioj.h>
+#endif
+
 struct gta01pm_priv {
 	int gpio_ngsm_en;
 	struct console *con;
@@ -54,8 +61,16 @@ static ssize_t gsm_read(struct device *dev, struct device_attribute *attr,
 		if (s3c2410_gpio_getpin(GTA01_GPIO_MODEM_RST))
 			goto out_1;
 	} else if (!strcmp(attr->attr.name, "download")) {
-		if (s3c2410_gpio_getpin(GTA01_GPIO_MODEM_DNLOAD))
-			goto out_1;
+#ifdef CONFIG_MACH_NEO1973_GTA01
+		if (machine_is_neo1973_gta01())
+			if (s3c2410_gpio_getpin(GTA01_GPIO_MODEM_DNLOAD))
+				goto out_1;
+#endif
+#ifdef CONFIG_MACH_NEO1973_GTA02
+		if (machine_is_neo1973_gta02())
+			if (s3c2410_gpio_getpin(GTA02_GPIO_nDL_GSM))
+				goto out_1;
+#endif
 	}
 
 	return strlcpy(buf, "0\n", 3);
@@ -70,32 +85,67 @@ static ssize_t gsm_write(struct device *dev, struct device_attribute *attr,
 
 	if (!strcmp(attr->attr.name, "power_on")) {
 		if (on) {
-			dev_info(dev, "powering up GSM, thus disconnecting "
-				 "serial console\n");
+			if (gta01_gsm.con) {
+				dev_info(dev, "powering up GSM, thus "
+					 "disconnecting serial console\n");
 
-			if (gta01_gsm.con)
 				console_stop(gta01_gsm.con);
+			}
 
 			if (gta01_gsm.gpio_ngsm_en)
 				s3c2410_gpio_setpin(gta01_gsm.gpio_ngsm_en, 0);
 
+			switch (system_rev) {
+#ifdef CONFIG_MACH_NEO1973_GTA02
+			case GTA02v2_SYSTEM_REV:
+			case GTA02v3_SYSTEM_REV:
+			case GTA02v4_SYSTEM_REV:
+			case GTA02v5_SYSTEM_REV:
+			case GTA02v6_SYSTEM_REV:
+				pcf50633_gpio_set(pcf50633_global,
+						  PCF50633_GPIO2, 1);
+				break;
+#endif
+			}
+
 			s3c2410_gpio_setpin(GTA01_GPIO_MODEM_ON, 1);
 		} else {
 			s3c2410_gpio_setpin(GTA01_GPIO_MODEM_ON, 0);
 
+			switch (system_rev) {
+#ifdef CONFIG_MACH_NEO1973_GTA02
+			case GTA02v2_SYSTEM_REV:
+			case GTA02v3_SYSTEM_REV:
+			case GTA02v4_SYSTEM_REV:
+			case GTA02v5_SYSTEM_REV:
+			case GTA02v6_SYSTEM_REV:
+				pcf50633_gpio_set(pcf50633_global,
+						  PCF50633_GPIO2, 0);
+				break;
+#endif
+			}
+
 			if (gta01_gsm.gpio_ngsm_en)
 				s3c2410_gpio_setpin(gta01_gsm.gpio_ngsm_en, 1);
 
-			if (gta01_gsm.con)
+			if (gta01_gsm.con) {
 				console_start(gta01_gsm.con);
 
-			dev_info(dev, "powered down GSM, thus enabling "
-				 "serial console\n");
+				dev_info(dev, "powered down GSM, thus enabling "
+					 "serial console\n");
+			}
 		}
 	} else if (!strcmp(attr->attr.name, "reset")) {
 		s3c2410_gpio_setpin(GTA01_GPIO_MODEM_RST, on);
 	} else if (!strcmp(attr->attr.name, "download")) {
-		s3c2410_gpio_setpin(GTA01_GPIO_MODEM_DNLOAD, on);
+#ifdef CONFIG_MACH_NEO1973_GTA01
+		if (machine_is_neo1973_gta01())
+			s3c2410_gpio_setpin(GTA01_GPIO_MODEM_DNLOAD, on);
+#endif
+#ifdef CONFIG_MACH_NEO1973_GTA02
+		if (machine_is_neo1973_gta02())
+			s3c2410_gpio_setpin(GTA02_GPIO_nDL_GSM, on);
+#endif
 	}
 
 	return count;
@@ -111,6 +161,9 @@ static int gta01_gsm_suspend(struct platform_device *pdev, pm_message_t state)
 	/* GPIO state is saved/restored by S3C2410 core GPIO driver, so we
 	 * don't need to do anything here */
 
+	/* disable DL GSM to prevent jack_insert becoming flaoting */
+	if (machine_is_neo1973_gta02())
+		s3c2410_gpio_setpin(GTA02_GPIO_nDL_GSM, 1);
 	return 0;
 }
 
@@ -124,6 +177,8 @@ static int gta01_gsm_resume(struct platform_device *pdev)
 	if (s3c2410_gpio_getpin(GTA01_GPIO_MODEM_ON) && gta01_gsm.con)
 		console_stop(gta01_gsm.con);
 
+	if (machine_is_neo1973_gta02())
+		s3c2410_gpio_setpin(GTA02_GPIO_nDL_GSM, 0);
 	return 0;
 }
 #else
@@ -134,7 +189,7 @@ static int gta01_gsm_resume(struct platform_device *pdev)
 static struct attribute *gta01_gsm_sysfs_entries[] = {
 	&dev_attr_power_on.attr,
 	&dev_attr_reset.attr,
-	NULL,
+	&dev_attr_download.attr,
 	NULL
 };
 
@@ -158,8 +213,18 @@ static int __init gta01_gsm_probe(struct platform_device *pdev)
 		gta01_gsm.gpio_ngsm_en = GTA01Bv2_GPIO_nGSM_EN;
 		s3c2410_gpio_setpin(GTA01v3_GPIO_nGSM_EN, 0);
 		break;
+#ifdef CONFIG_MACH_NEO1973_GTA02
+	case GTA02v1_SYSTEM_REV:
+	case GTA02v2_SYSTEM_REV:
+	case GTA02v3_SYSTEM_REV:
+	case GTA02v4_SYSTEM_REV:
+	case GTA02v5_SYSTEM_REV:
+	case GTA02v6_SYSTEM_REV:
+		gta01_gsm.gpio_ngsm_en = 0;
+		break;
+#endif
 	default:
-		dev_warn(&pdev->dev, "Unknown GTA01 Revision 0x%x, "
+		dev_warn(&pdev->dev, "Unknown Neo1973 Revision 0x%x, "
 			 "some PM features not available!!!\n",
 			 system_rev);
 		break;
@@ -175,9 +240,13 @@ static int __init gta01_gsm_probe(struct platform_device *pdev)
 		break;
 	}
 
-	gta01_gsm.con = find_s3c24xx_console();
-	if (!gta01_gsm.con)
-		dev_warn(&pdev->dev, "cannot find S3C24xx console driver\n");
+	if (machine_is_neo1973_gta01()) {
+		gta01_gsm.con = find_s3c24xx_console();
+		if (!gta01_gsm.con)
+			dev_warn(&pdev->dev,
+				 "cannot find S3C24xx console driver\n");
+	} else
+		gta01_gsm.con = NULL;
 
 	return sysfs_create_group(&pdev->dev.kobj, &gta01_gsm_attr_group);
 }
-- 
1.5.6.3