-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathoc120v217-source.patch
More file actions
executable file
·915 lines (863 loc) · 28.5 KB
/
Copy pathoc120v217-source.patch
File metadata and controls
executable file
·915 lines (863 loc) · 28.5 KB
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
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
diff -X FILE -U 3 -H -d -r -N -- Kernel-stock/arch/arm/Kconfig Kernel/arch/arm/Kconfig
--- Kernel-stock/arch/arm/Kconfig 2010-10-05 18:13:32.000000000 +0800
+++ Kernel/arch/arm/Kconfig 2010-11-16 13:51:43.017158000 +0800
@@ -1092,7 +1092,7 @@
int
default 128 if ARCH_L7200
default 200 if ARCH_EBSA110 || ARCH_S3C2410 || ARCH_S5P6440 || ARCH_S5P6442 || (ARCH_S5PV210 && !HRT_RTC)
- default 256 if ARCH_S5PV210 && HRT_RTC
+ default 300 if ARCH_S5PV210 && HRT_RTC
default OMAP_32K_TIMER_HZ if ARCH_OMAP && OMAP_32K_TIMER
default AT91_TIMER_HZ if ARCH_AT91
default 100
diff -X FILE -U 3 -H -d -r -N -- Kernel-stock/arch/arm/mach-s5pv210/clock.c Kernel/arch/arm/mach-s5pv210/clock.c
--- Kernel-stock/arch/arm/mach-s5pv210/clock.c 2010-10-05 18:13:33.000000000 +0800
+++ Kernel/arch/arm/mach-s5pv210/clock.c 2010-11-24 09:18:57.891723001 +0800
@@ -122,79 +122,115 @@
struct S5PC110_clk_info clk_info[] = {
-#if USE_1DOT2GHZ
+// #if USE_1DOT2GHZ // jj
{
// APLL:1200,ARMCLK:1200,HCLK_MSYS:200,MPLL:667,HCLK_DSYS:166,HCLK_PSYS:133,PCLK_MSYS:100,PCLK_DSYS:83,PCLK_PSYS:66
.armclk = 1200* MHZ,
.apllout = 1200* MHZ,
- .apll_mps = ((150<<16)|(3<<8)|1),
- .msys_div0 = (0|(5<<4)|(5<<8)|(1<<12)),
+// .apll_mps = ((150<<16)|(3<<8)|1),
+ .apll_mps = 0x960301, //((150<<16)|(3<<8)|1)
+// .msys_div0 = (0|(5<<4)|(5<<8)|(1<<12)),
+ .msys_div0 = 0x1550,
.mpllout = 667* MHZ,
- .mpll_mps = ((667<<16)|(12<<8)|(1)),
- .psys_dsys_div0 = ((3<<16)|(1<<20)|(4<<24)|(1<<28)),
- .div2val = ((3<<0)|(3<<4)|(3<<8)),
- .dmc0_div6 = (3<<28),
+// .mpll_mps = ((667<<16)|(12<<8)|(1)),
+ .mpll_mps = 0x29B0C01,
+// .psys_dsys_div0 = ((3<<16)|(1<<20)|(4<<24)|(1<<28)),
+ .psys_dsys_div0 = 0x14130000,
+// .div2val = ((3<<0)|(3<<4)|(3<<8)),
+ .div2val = 0x333,
+// .dmc0_div6 = (3<<28),
+ .dmc0_div6 = 0x30000000,
},
-#endif// A extra entry for 1200MHZ level
+// #endif// A extra entry for 1200MHZ level
{
// APLL:1000,ARMCLK:1000,HCLK_MSYS:200,MPLL:667,HCLK_DSYS:166,HCLK_PSYS:133,PCLK_MSYS:100,PCLK_DSYS:83,PCLK_PSYS:66
.armclk = 1000* MHZ,
.apllout = 1000* MHZ,
- .apll_mps = ((125<<16)|(3<<8)|1),
- .msys_div0 = (0|(4<<4)|(4<<8)|(1<<12)),
+// .apll_mps = ((125<<16)|(3<<8)|1),
+ .apll_mps = 0x7D0301,
+// .msys_div0 = (0|(4<<4)|(4<<8)|(1<<12)),
+ .msys_div0 = 0x1440,
.mpllout = 667* MHZ,
- .mpll_mps = ((667<<16)|(12<<8)|(1)),
- .psys_dsys_div0 = ((3<<16)|(1<<20)|(4<<24)|(1<<28)),
- .div2val = ((3<<0)|(3<<4)|(3<<8)),
- .dmc0_div6 = (3<<28),
+// .mpll_mps = ((667<<16)|(12<<8)|(1)),
+ .mpll_mps = 0x29B0C01,
+// .psys_dsys_div0 = ((3<<16)|(1<<20)|(4<<24)|(1<<28)),
+ .psys_dsys_div0 = 0x14130000,
+// .div2val = ((3<<0)|(3<<4)|(3<<8)),
+ .div2val = 0x333,
+// .dmc0_div6 = (3<<28),
+ .dmc0_div6 = 0x30000000,
},
{
// APLL:800,ARMCLK:800,HCLK_MSYS:200,MPLL:667,HCLK_DSYS:166,HCLK_PSYS:133,PCLK_MSYS:100,PCLK_DSYS:83,PCLK_PSYS:66
.armclk = 800* MHZ,
.apllout = 800* MHZ,
- .apll_mps = ((100<<16)|(3<<8)|1),
- .msys_div0 = (0|(3<<4)|(3<<8)|(1<<12)),
+// .apll_mps = ((100<<16)|(3<<8)|1),
+ .apll_mps = 0x640301,
+// .msys_div0 = (0|(3<<4)|(3<<8)|(1<<12)),
+ .msys_div0 = 0x1330,
.mpllout = 667* MHZ,
- .mpll_mps = ((667<<16)|(12<<8)|(1)),
- .psys_dsys_div0 = ((3<<16)|(1<<20)|(4<<24)|(1<<28)),
- .div2val = ((3<<0)|(3<<4)|(3<<8)),
- .dmc0_div6 = (3<<28),
+// .mpll_mps = ((667<<16)|(12<<8)|(1)),
+ .mpll_mps = 0x29B0C01,
+// .psys_dsys_div0 = ((3<<16)|(1<<20)|(4<<24)|(1<<28)),
+ .psys_dsys_div0 = 0x14130000,
+// .div2val = ((3<<0)|(3<<4)|(3<<8)),
+ .div2val = 0x333,
+// .dmc0_div6 = (3<<28),
+ .dmc0_div6 = 0x30000000,
},
{
// APLL:800,ARMCLK:400,HCLK_MSYS:200,MPLL:667,HCLK_DSYS:166,HCLK_PSYS:133,PCLK_MSYS:100,PCLK_DSYS:83,PCLK_PSYS:66
.armclk = 400* MHZ,
.apllout = 800* MHZ,
- .apll_mps = ((100<<16)|(3<<8)|1),
- .msys_div0 = (1|(3<<4)|(1<<8)|(1<<12)),
+// .apll_mps = ((100<<16)|(3<<8)|1),
+ .apll_mps = 0x640301,
+// .msys_div0 = (1|(3<<4)|(1<<8)|(1<<12)),
+ .msys_div0 = 0x1131,
.mpllout = 667* MHZ,
- .mpll_mps = ((667<<16)|(12<<8)|(1)),
- .psys_dsys_div0 = ((3<<16)|(1<<20)|(4<<24)|(1<<28)),
- .div2val = ((3<<0)|(3<<4)|(3<<8)),
- .dmc0_div6 = (3<<28),
+// .mpll_mps = ((667<<16)|(12<<8)|(1)),
+ .mpll_mps = 0x29B0C01,
+// .psys_dsys_div0 = ((3<<16)|(1<<20)|(4<<24)|(1<<28)),
+ .psys_dsys_div0 = 0x14130000,
+// .div2val = ((3<<0)|(3<<4)|(3<<8)),
+ .div2val = 0x333,
+// .dmc0_div6 = (3<<28),
+ .dmc0_div6 = 0x30000000,
},
{
// APLL:800,ARMCLK:200,HCLK_MSYS:200,MPLL:667,HCLK_DSYS:166,HCLK_PSYS:133,PCLK_MSYS:100,PCLK_DSYS:83,PCLK_PSYS:66
.armclk = 200* MHZ,
.apllout = 800* MHZ,
- .apll_mps = ((100<<16)|(3<<8)|1),
- .msys_div0 = (3|(3<<4)|(0<<8)|(1<<12)),
+// .apll_mps = ((100<<16)|(3<<8)|1),
+ .apll_mps = 0x640301,
+// .msys_div0 = (3|(3<<4)|(0<<8)|(1<<12)),
+ .msys_div0 = 0x1033,
.mpllout = 667* MHZ,
- .mpll_mps = ((667<<16)|(12<<8)|(1)),
- .psys_dsys_div0 = ((3<<16)|(1<<20)|(4<<24)|(1<<28)),
- .div2val = ((3<<0)|(3<<4)|(3<<8)),
- .dmc0_div6 = (3<<28),
+// .mpll_mps = ((667<<16)|(12<<8)|(1)),
+ .mpll_mps = 0x29B0C01,
+// .psys_dsys_div0 = ((3<<16)|(1<<20)|(4<<24)|(1<<28)),
+ .psys_dsys_div0 = 0x14130000,
+// .div2val = ((3<<0)|(3<<4)|(3<<8)),
+ .div2val = 0x333,
+// .dmc0_div6 = (3<<28),
+ .dmc0_div6 = 0x30000000,
},
{
// APLL:800,ARMCLK:100,HCLK_MSYS:100,MPLL:667,HCLK_DSYS:83,HCLK_PSYS:66,PCLK_MSYS:100,PCLK_DSYS:83,PCLK_PSYS:66
.armclk = 100* MHZ,
.apllout = 800* MHZ,
- .apll_mps = ((100<<16)|(3<<8)|1),
- .msys_div0 = (7|(3<<4)|(0<<8)|(0<<12)),
+// .apll_mps = ((100<<16)|(3<<8)|1),
+ .apll_mps = 0x640301,
+// .msys_div0 = (7|(3<<4)|(0<<8)|(0<<12)),
+ .msys_div0 = 0x37,
.mpllout = 667* MHZ,
- .mpll_mps = ((667<<16)|(12<<8)|(1)),
- .psys_dsys_div0 = ((7<<16)|(0<<20)|(9<<24)|(0<<28)),
- .div2val = ((3<<0)|(3<<4)|(3<<8)),
- .dmc0_div6 = (7<<28),
+// .mpll_mps = ((667<<16)|(12<<8)|(1)),
+ .mpll_mps = 0x29B0C01,
+// .psys_dsys_div0 = ((7<<16)|(0<<20)|(9<<24)|(0<<28)),
+ .psys_dsys_div0 = 0x9070000,
+// .div2val = ((3<<0)|(3<<4)|(3<<8)),
+ .div2val = 0x333,
+// .dmc0_div6 = (7<<28),
+ .dmc0_div6 = 0x70000000,
}
};
diff -X FILE -U 3 -H -d -r -N -- Kernel-stock/arch/arm/mach-s5pv210/cpu-freq.c Kernel/arch/arm/mach-s5pv210/cpu-freq.c
--- Kernel-stock/arch/arm/mach-s5pv210/cpu-freq.c 2010-10-05 18:13:33.000000000 +0800
+++ Kernel/arch/arm/mach-s5pv210/cpu-freq.c 2010-11-24 09:18:57.921738001 +0800
@@ -37,7 +37,7 @@
#define ENABLE_DVFS_LOCK_HIGH 1
#define USE_DVS
-#define GPIO_BASED_DVS
+//#define GPIO_BASED_DVS
#define DBG(fmt...)
//#define DBG(fmt...) printk(fmt)
@@ -80,21 +80,37 @@
/* frequency */
static struct cpufreq_frequency_table s5pc110_freq_table_1GHZ[] = {
+/*
{L0, 1000*1000},
{L1, 800*1000},
{L2, 400*1000},
{L3, 200*1000},
{L4, 100*1000},
+*/
+ {L0, 1200*1000},
+ {L1, 1000*1000},
+ {L2, 800*1000},
+ {L3, 400*1000},
+ {L4, 200*1000},
+ {L5, 100*1000},
{0, CPUFREQ_TABLE_END},
};
/*Assigning different index for fast scaling up*/
static unsigned char transition_state_1GHZ[][2] = {
+/*
{1, 0},
{2, 0},
{3, 1},
{4, 2},
{4, 3},
+*/
+ {1, 0},
+ {2, 0},
+ {3, 1},
+ {4, 2},
+ {5, 3},
+ {5, 3},
};
/* frequency */
@@ -130,11 +146,19 @@
};
static unsigned int s5pc110_thres_table_1GHZ[][2] = {
+/*
{55, 80},
{50, 90},
{50, 90},
{40, 90},
{20, 80},
+*/
+ {40, 80},
+ {40, 90},
+ {40, 90},
+ {40, 80},
+ {40, 70},
+ {30, 70},
};
static unsigned int s5pc110_thres_table_1d2GHZ[][2] = {
@@ -707,7 +731,13 @@
policy->cur = policy->min = policy->max = s5pc110_getspeed(0);
//spin_lock_irqsave(&g_cpufreq_lock, irqflags);
-#if USE_1DOT2GHZ
+ S5PC11X_FREQ_TAB = 0;
+ S5PC11X_MAXFREQLEVEL = 5;
+ MAXFREQ_LEVEL_SUPPORTED = 5;
+ g_dvfs_high_lock_limit = 4;
+
+/*
+#if USE_1DOT2GHZ //jj
S5PC11X_FREQ_TAB = 1;
S5PC11X_MAXFREQLEVEL = 5;
MAXFREQ_LEVEL_SUPPORTED = 6;
@@ -718,7 +748,7 @@
MAXFREQ_LEVEL_SUPPORTED = 5;
g_dvfs_high_lock_limit = 4;
#endif
-
+*/
printk("S5PC11X_FREQ_TAB=%d , S5PC11X_MAXFREQLEVEL=%d\n",S5PC11X_FREQ_TAB,S5PC11X_MAXFREQLEVEL);
s5pc11x_cpufreq_level = S5PC11X_MAXFREQLEVEL;
diff -X FILE -U 3 -H -d -r -N -- Kernel-stock/arch/arm/mach-s5pv210/mach-aries.c Kernel/arch/arm/mach-s5pv210/mach-aries.c
--- Kernel-stock/arch/arm/mach-s5pv210/mach-aries.c 2010-10-05 18:13:33.000000000 +0800
+++ Kernel/arch/arm/mach-s5pv210/mach-aries.c 2010-11-18 16:34:40.253065002 +0800
@@ -2,6 +2,7 @@
*
* Copyright (c) 2010 Samsung Electronics Co., Ltd.
* http://www.samsung.com/
+ * Copyright (C) 2010 Michael Richter (alias neldar)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -2120,6 +2121,11 @@
while (1) ;
}
+// not the best solution, but a working one.
+#ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
+extern bool BacklightNotification_enabled;
+#endif
+
void s3c_config_sleep_gpio_table(int array_size, unsigned int (*gpio_table)[3])
{
u32 i, gpio;
@@ -2131,6 +2137,14 @@
s3c_gpio_slp_setpull_updown(gpio, gpio_table[i][2]);
}
+#ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
+ if(BacklightNotification_enabled)
+ {
+ s3c_gpio_slp_cfgpin(_3_GPIO_TOUCH_EN, S3C_GPIO_SLP_OUT1);
+ s3c_gpio_slp_setpull_updown(_3_GPIO_TOUCH_EN, S3C_GPIO_PULL_DOWN);
+ }
+#endif
+
if (gpio_get_value(GPIO_PS_ON))
{
s3c_gpio_slp_setpull_updown(GPIO_ALS_SDA_28V, S3C_GPIO_PULL_NONE);
diff -X FILE -U 3 -H -d -r -N -- Kernel-stock/arch/arm/mach-s5pv210/max8998_consumer.c Kernel/arch/arm/mach-s5pv210/max8998_consumer.c
--- Kernel-stock/arch/arm/mach-s5pv210/max8998_consumer.c 2010-10-05 18:13:33.000000000 +0800
+++ Kernel/arch/arm/mach-s5pv210/max8998_consumer.c 2010-11-24 09:18:57.841698001 +0800
@@ -42,7 +42,7 @@
#define PMIC_INT 1
#define PMIC_BOTH 2
-#define DECREASE_DVFS_DELAY
+//#define DECREASE_DVFS_DELAY
#ifdef DECREASE_DVFS_DELAY
#define PMIC_SET_MASK (0x38) //(0x7 << 3)
@@ -50,9 +50,9 @@
#define PMIC_SET2_BIT (0x10) //(0x1 << 4)
#define PMIC_SET3_BIT (0x20) //(0x1 << 5)
#else
-#define PMIC_ARM_MASK (0x3 << 3)
-#define PMIC_SET1_HIGH (0x1 << 3)
-#define PMIC_SET2_HIGH (0x1 << 4)
+#define PMIC_ARM_MASK (0x18) //(0x3 << 3)
+#define PMIC_SET1_HIGH (0x8) //(0x1 << 3)
+#define PMIC_SET2_HIGH (0x10) //(0x1 << 4)
#endif
#ifndef CONFIG_CPU_FREQ
@@ -86,6 +86,7 @@
static const unsigned int frequency_match_1GHZ[][4] = {
/* frequency, Mathced VDD ARM voltage , Matched VDD INT*/
#if 1
+ {1200000, 1300, 1100, 0},
{1000000, 1275, 1100, 0},
{800000, 1200, 1100, 1},
{400000, 1050, 1100, 2},
@@ -142,12 +143,12 @@
static const unsigned int dvs_volt_table_1GHZ[][3] = {
{L0, DVSARM1, DVSINT1},//DVSINT0
- {L1, DVSARM2, DVSINT1},
- {L2, DVSARM3, DVSINT1},
+ {L1, DVSARM1, DVSINT1},
+ {L2, DVSARM2, DVSINT1},
//266 {L3, DVSARM3, DVSINT1},
- {L3, DVSARM4, DVSINT1},
- {L4, DVSARM4, DVSINT2},
-// {L5, DVSARM4, DVSINT2},
+ {L3, DVSARM3, DVSINT1},
+ {L4, DVSARM4, DVSINT1},
+ {L5, DVSARM4, DVSINT2},
// {L6, DVSARM4, DVSINT2},
};
@@ -167,6 +168,8 @@
};
#endif
+extern int exp_UV_mV[6];
+
static int set_max8998(unsigned int pwr, enum perf_level p_lv)
{
int voltage;
@@ -174,17 +177,19 @@
int ret = 0;
const unsigned int (*frequency_match_tab)[4] = frequency_match[S5PC11X_FREQ_TAB];
- DBG("%s : p_lv = %d : pwr = %d \n", __FUNCTION__, p_lv,pwr);
+// DBG("%s : p_lv = %d : pwr = %d \n", __FUNCTION__, p_lv,pwr);
if(pwr == PMIC_ARM) {
- voltage = frequency_match_tab[p_lv][pwr + 1];
+// voltage = frequency_match_tab[p_lv][pwr + 1];
+ voltage = frequency_match_tab[p_lv][pwr + 1] - exp_UV_mV[p_lv];
if(voltage == s_arm_voltage)
return ret;
pmic_val = voltage * 1000;
- DBG("regulator_set_voltage =%d\n",voltage);
+// DBG("regulator_set_voltage =%d\n",voltage);
+ DBG("regulator_set_voltage =%dmA @ %dMHz-%d UV=%d\n",voltage,frequency_match_tab[p_lv][pwr]/1000,p_lv,exp_UV_mV[p_lv]);
/*set Arm voltage*/
ret = regulator_set_voltage(Reg_Arm,pmic_val,pmic_val);
if(ret != 0)
@@ -208,7 +213,7 @@
pmic_val = voltage * 1000;
- DBG("regulator_set_voltage = %d\n",voltage);
+ //DBG("regulator_set_voltage = %d\n",voltage);
/*set Arm voltage*/
ret = regulator_set_voltage(Reg_Int, pmic_val, pmic_val);
if(ret != 0)
@@ -256,7 +261,7 @@
int set_voltage(enum perf_level p_lv)
{
- DBG("%s : p_lv = %d\n", __FUNCTION__, p_lv);
+ //DBG("%s : p_lv = %d\n", __FUNCTION__, p_lv);
if(step_curr != p_lv)
{
/*Commenting gpio initialisation*/
@@ -268,7 +273,6 @@
}
return 0;
}
-
EXPORT_SYMBOL(set_voltage);
#ifdef DECREASE_DVFS_DELAY
@@ -372,7 +376,8 @@
set_gpio_dvs(p_lv);
udelay(delay);
- DBG("[PWR] %s : level (%d -> %d), delay (%u)\n", __func__, step_curr, p_lv, delay);
+ DBG("[PWR] %s : level (%d -> %d), delay (%u)\n", __func__, frequency_match_tab[step_curr][0], frequency_match_tab[p_lv][0], delay); //jj
+// DBG("[PWR] %s : level (%d -> %d), delay (%u)\n", __func__, step_curr, p_lv, delay);
step_curr = p_lv;
diff -X FILE -U 3 -H -d -r -N -- Kernel-stock/drivers/cpufreq/cpufreq.c Kernel/drivers/cpufreq/cpufreq.c
--- Kernel-stock/drivers/cpufreq/cpufreq.c 2010-10-05 18:13:41.000000000 +0800
+++ Kernel/drivers/cpufreq/cpufreq.c 2010-11-15 23:43:10.954887003 +0800
@@ -32,6 +32,8 @@
#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, \
"cpufreq-core", msg)
+int exp_UV_mV[6];
+
/**
* The "cpufreq driver" - the arch- or hardware-dependent low
* level driver of CPUFreq support, and its spinlock. This lock
@@ -573,6 +575,24 @@
return -EINVAL;
}
+static ssize_t show_UV_mV_table(struct cpufreq_policy *policy, char *buf)
+{
+ return sprintf(buf, "%d %d %d %d %d %d\n", exp_UV_mV[0],exp_UV_mV[1],exp_UV_mV[2],exp_UV_mV[3],exp_UV_mV[4],exp_UV_mV[5]);
+// return -EINVAL;
+}
+
+static ssize_t store_UV_mV_table(struct cpufreq_policy *policy,
+ const char *buf, size_t count)
+{
+ unsigned int ret = -EINVAL;
+
+ ret = sscanf(buf, "%d %d %d %d %d %d", &exp_UV_mV[0],&exp_UV_mV[1],&exp_UV_mV[2],&exp_UV_mV[3],&exp_UV_mV[4],&exp_UV_mV[5]);
+ if (ret != 1)
+ return -EINVAL;
+ else
+ return count;
+
+}
/**
* store_scaling_governor - store policy for the specified CPU
@@ -746,6 +766,7 @@
define_one_rw(scaling_min_freq);
define_one_rw(scaling_max_freq);
define_one_rw(scaling_governor);
+define_one_rw(UV_mV_table);
define_one_rw(scaling_setspeed);
define_one_rw(scaling_setlog);
#if defined SET_AUDIO_LOG
@@ -761,6 +782,7 @@
&affected_cpus.attr,
&related_cpus.attr,
&scaling_governor.attr,
+ &UV_mV_table.attr,
&scaling_driver.attr,
&scaling_available_governors.attr,
&scaling_setspeed.attr,
diff -X FILE -U 3 -H -d -r -N -- Kernel-stock/drivers/input/keyboard/cypress/cypress-touchkey.c Kernel/drivers/input/keyboard/cypress/cypress-touchkey.c
--- Kernel-stock/drivers/input/keyboard/cypress/cypress-touchkey.c 2010-10-05 18:13:43.000000000 +0800
+++ Kernel/drivers/input/keyboard/cypress/cypress-touchkey.c 2010-11-18 16:34:40.273075002 +0800
@@ -2,6 +2,7 @@
* Driver for keys on GPIO lines capable of generating interrupts.
*
* Copyright 2005 Phil Blundell
+ * Copyright (C) 2010 Michael Richter (alias neldar)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -56,6 +57,14 @@
#define DEVICE_NAME "melfas-touchkey"
+#ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
+//todo: update this everytime you modify BacklightNotification
+#define BACKLIGHTNOTIFICATION_VERSION 6
+
+#define BACKLIGHT_ON 1
+#define BACKLIGHT_OFF 2
+#endif
+
static int touchkey_keycode[5] =
{ NULL, KEY_BACK, KEY_MENU, KEY_ENTER, KEY_END };
@@ -90,6 +99,14 @@
extern int get_touchkey_firmware(char *version);
static int touchkey_led_status = 0;
+
+#ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
+static bool touchkey_controller_vdd_on = false;
+static bool backlight_notification_allowed = false; //indicates if BLN function is enabled/allowed
+bool BacklightNotification_enabled= false; //indicates ongoing LED Notification
+EXPORT_SYMBOL(BacklightNotification_enabled); //export for mach-aries.c
+#endif
+
struct i2c_driver touchkey_i2c_driver = {
.driver = {
.name = "melfas_touchkey_driver",
@@ -109,6 +126,30 @@
touchkey_debug_count++;
}
+#ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
+static void touchkey_power_on(void){
+ gpio_direction_output(_3_GPIO_TOUCH_EN, 1);
+#if !defined(CONFIG_ARIES_NTT)
+ gpio_direction_output(_3_GPIO_TOUCH_CE, 1);
+#endif
+ touchkey_controller_vdd_on = true;
+}
+
+static void touchkey_power_off(void){
+ touchkey_controller_vdd_on = false;
+ gpio_direction_output(_3_GPIO_TOUCH_EN, 0);
+#if !defined(CONFIG_ARIES_NTT)
+ gpio_direction_output(_3_GPIO_TOUCH_CE, 0);
+#endif
+}
+
+static void touchkey_power_off_with_i2c(void){
+ touchkey_power_off();
+ gpio_direction_output(_3_TOUCH_SDA_28V, 0);
+ gpio_direction_output(_3_TOUCH_SCL_28V, 0);
+}
+#endif
+
static int i2c_touchkey_read(u8 reg, u8 * val, unsigned int len)
{
int err;
@@ -142,7 +183,11 @@
unsigned char data[2];
int retry = 2;
+#ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
+ if (touchkey_driver == NULL) {
+#else
if ((touchkey_driver == NULL) || !(touchkey_enable == 1)) {
+#endif
printk(KERN_DEBUG "touchkey is not enabled.W\n");
return -ENODEV;
}
@@ -189,7 +234,11 @@
touchkey_keycode[2], 0);
retry = 10;
while (retry--) {
+#ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
+ touchkey_power_off();
+#else
gpio_direction_output(_3_GPIO_TOUCH_EN, 0);
+#endif
mdelay(300);
init_hw();
if (i2c_touchkey_read(KEYCODE_REG, data, 3) >=
@@ -206,12 +255,16 @@
//touchkey die , do not enable touchkey
//enable_irq(IRQ_TOUCH_INT);
touchkey_enable = -1;
+#ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
+ touchkey_power_off_with_i2c();
+#else
gpio_direction_output(_3_GPIO_TOUCH_EN, 0);
#if !defined(CONFIG_ARIES_NTT)
gpio_direction_output(_3_GPIO_TOUCH_CE, 0);
#endif
gpio_direction_output(_3_TOUCH_SDA_28V, 0);
gpio_direction_output(_3_TOUCH_SCL_28V, 0);
+#endif
printk("%s touchkey died\n", __func__);
set_touchkey_debug('D');
return;
@@ -298,12 +351,16 @@
}
disable_irq(IRQ_TOUCH_INT);
+#ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
+ touchkey_power_off_with_i2c();
+#else
gpio_direction_output(_3_GPIO_TOUCH_EN, 0);
#if !defined(CONFIG_ARIES_NTT)
gpio_direction_output(_3_GPIO_TOUCH_CE, 0);
#endif
gpio_direction_output(_3_TOUCH_SDA_28V, 0);
gpio_direction_output(_3_TOUCH_SCL_28V, 0);
+#endif
}
static void melfas_touchkey_early_resume(struct early_suspend *h)
@@ -315,10 +372,14 @@
touchkey_enable);
return;
}
+#ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
+ touchkey_power_on();
+#else
gpio_direction_output(_3_GPIO_TOUCH_EN, 1);
#if !defined(CONFIG_ARIES_NTT)
gpio_direction_output(_3_GPIO_TOUCH_CE, 1);
#endif
+#endif
msleep(50);
//clear interrupt
@@ -406,10 +467,14 @@
static void init_hw(void)
{
+#ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
+ touchkey_power_on();
+#else
gpio_direction_output(_3_GPIO_TOUCH_EN, 1);
#if !defined(CONFIG_ARIES_NTT)
gpio_direction_output(_3_GPIO_TOUCH_CE, 1);
#endif
+#endif
msleep(200);
s3c_gpio_setpull(_3_GPIO_TOUCH_INT, S3C_GPIO_PULL_NONE);
set_irq_type(IRQ_TOUCH_INT, IRQ_TYPE_LEVEL_LOW);
@@ -560,6 +625,15 @@
return count;
}
+#ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
+static void set_backlight(u8 backlight_status){
+ if (touchkey_controller_vdd_on){
+ touchkey_led_status = backlight_status;
+ i2c_touchkey_write(&backlight_status, 1);
+ }
+}
+#endif
+
static ssize_t touch_led_control(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t size)
@@ -567,8 +641,18 @@
unsigned char data;
if (sscanf(buf, "%d\n", &data) == 1) {
printk(KERN_DEBUG "touch_led_control: %d \n", data);
+#ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
+ if ((touchkey_enable == 1)) {
+ if (data == 1)
+ set_backlight(BACKLIGHT_ON);
+ if (data == 2)
+ set_backlight(BACKLIGHT_OFF);
+ } else
+ printk(KERN_DEBUG "touchkey is not enabled.W\n");
+#else
i2c_touchkey_write(&data, 1);
touchkey_led_status = data;
+#endif
} else
printk("touch_led_control Error\n");
@@ -584,18 +668,26 @@
if (*buf == '0') {
set_touchkey_debug('d');
disable_irq(IRQ_TOUCH_INT);
+#ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
+ touchkey_power_off();
+#else
gpio_direction_output(_3_GPIO_TOUCH_EN, 0);
#if !defined(CONFIG_ARIES_NTT)
gpio_direction_output(_3_GPIO_TOUCH_CE, 0);
#endif
+#endif
touchkey_enable = -2;
} else if (*buf == '1') {
if (touchkey_enable == -2) {
set_touchkey_debug('e');
+#ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
+ touchkey_power_on();
+#else
gpio_direction_output(_3_GPIO_TOUCH_EN, 1);
#if !defined(CONFIG_ARIES_NTT)
gpio_direction_output(_3_GPIO_TOUCH_CE, 1);
#endif
+#endif
touchkey_enable = 1;
enable_irq(IRQ_TOUCH_INT);
}
@@ -606,6 +698,118 @@
return size;
}
+
+#ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
+
+static void enable_led_notification(void){
+ if (backlight_notification_allowed){
+ if (touchkey_enable != 1){
+ touchkey_power_on();
+ mdelay(100);
+
+ /* enable touchkey vdd in sleep mode */
+ BacklightNotification_enabled = true;
+
+ /* write to i2cbus, enable backlights */
+ set_backlight(BACKLIGHT_ON);
+
+ printk(KERN_DEBUG "%s: notification led enabled\n", __FUNCTION__);
+ }
+ else
+ printk(KERN_DEBUG "%s: cannot set notification led, touchkeys are enabled\n",__FUNCTION__);
+ }
+}
+
+static void disable_led_notification(void){
+ printk(KERN_DEBUG "%s: notification led disabled\n", __FUNCTION__);
+ /* disable touchkey vdd in sleep mode */
+ BacklightNotification_enabled = false;
+
+ if (touchkey_enable != 1){
+ /* write to i2cbus, disable backlights */
+ set_backlight(BACKLIGHT_OFF);
+ }
+}
+
+static ssize_t backlightnotification_status_read(struct device *dev, struct device_attribute *attr, char *buf) {
+ return sprintf(buf,"%u\n",(backlight_notification_allowed ? 1 : 0));
+}
+static ssize_t backlightnotification_status_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
+{
+ unsigned int data;
+ if(sscanf(buf, "%u\n", &data) == 1) {
+ printk(KERN_DEBUG "%s: %u \n", __FUNCTION__, data);
+ if(data == 0 || data == 1){
+
+ if(data == 1){
+ printk(KERN_DEBUG "%s: backlightnotification function enabled\n", __FUNCTION__);
+ backlight_notification_allowed = true;
+ }
+
+ if(data == 0){
+ printk(KERN_DEBUG "%s: backlightnotification function disabled\n", __FUNCTION__);
+ backlight_notification_allowed = false;
+ if (BacklightNotification_enabled){
+ disable_led_notification();
+ }
+ }
+ }
+ else
+ printk(KERN_DEBUG "%s: wrong input %u\n", __FUNCTION__, data);
+ }
+ else
+ printk("%s: input error\n", __FUNCTION__);
+
+ return size;
+}
+
+static ssize_t notification_led_status_read(struct device *dev, struct device_attribute *attr, char *buf) {
+ return sprintf(buf,"%u\n", (BacklightNotification_enabled ? 1 : 0)); //todo: boolean for notification_led
+}
+
+static ssize_t notification_led_status_write(struct device *dev, struct device_attribute *attr, const char *buf, size_t size)
+{
+ unsigned int data;
+
+ if(sscanf(buf, "%u\n", &data) == 1) {
+ if(data == 0 || data == 1){
+ printk(KERN_DEBUG "%s: %u \n", __FUNCTION__, data);
+ if (data == 1)
+ enable_led_notification();
+
+ if(data == 0)
+ disable_led_notification();
+
+ } else
+ printk(KERN_DEBUG "%s: wrong input %u\n", __FUNCTION__, data);
+ } else
+ printk("%s: input error\n", __FUNCTION__);
+
+ return size;
+}
+
+static ssize_t backlightnotification_version(struct device *dev, struct device_attribute *attr, char *buf) {
+ return sprintf(buf, "%u\n", BACKLIGHTNOTIFICATION_VERSION);
+}
+
+static DEVICE_ATTR(enabled, S_IRUGO | S_IWUGO , backlightnotification_status_read, backlightnotification_status_write);
+static DEVICE_ATTR(notification_led, S_IRUGO | S_IWUGO , notification_led_status_read, notification_led_status_write);
+static DEVICE_ATTR(version, S_IRUGO , backlightnotification_version, NULL);
+
+/*
+struct file_operations backlightnotification_device_fops = {
+ .owner = THIS_MODULE,
+ .read = null,
+};
+*/
+
+static struct miscdevice backlightnotification_device = {
+ .minor = MISC_DYNAMIC_MINOR,
+ .name = "backlightnotification",
+// .fops = &mymisc_fops,
+};
+#endif
+
static DEVICE_ATTR(touch_version, S_IRUGO | S_IWUSR | S_IWOTH | S_IXOTH,
touch_version_read, touch_version_write);
static DEVICE_ATTR(touch_update, S_IRUGO | S_IWUSR | S_IWOTH | S_IXOTH,
@@ -615,6 +819,7 @@
static DEVICE_ATTR(enable_disable, S_IRUGO | S_IWUSR | S_IWOTH | S_IXOTH, NULL,
touchkey_enable_disable);
+
static int __init touchkey_init(void)
{
int ret = 0;
@@ -672,6 +877,29 @@
pr_err("Failed to create device file(%s)!\n",
dev_attr_enable_disable.attr.name);
}
+#ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
+ ret = 0;
+ ret = misc_register(&backlightnotification_device);
+ if (ret) {
+ printk("%s misc_register fail\n", __FUNCTION__, backlightnotification_device.name);
+ }
+ //add the backlightnotification attributes
+ if (device_create_file(backlightnotification_device.this_device, &dev_attr_enabled) < 0)
+ {
+ printk("%s device_create_file fail dev_attr_touch_update\n", __FUNCTION__);
+ pr_err("Failed to create device file(%s)!\n", dev_attr_enabled.attr.name);
+ }
+ if (device_create_file(backlightnotification_device.this_device, &dev_attr_notification_led) < 0)
+ {
+ printk("%s device_create_file fail dev_attr_touch_update\n", __FUNCTION__);
+ pr_err("Failed to create device file(%s)!\n", dev_attr_notification_led.attr.name);
+ }
+ if (device_create_file(backlightnotification_device.this_device, &dev_attr_version) < 0)
+ {
+ printk("%s device_create_file fail dev_attr_touch_update\n", __FUNCTION__);
+ pr_err("Failed to create device file(%s)!\n", dev_attr_version.attr.name);
+ }
+#endif
touchkey_wq = create_singlethread_workqueue("melfas_touchkey_wq");
if (!touchkey_wq)
@@ -703,10 +931,14 @@
set_touchkey_debug('f');
}
if (retry <= 0) {
+#ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
+ touchkey_power_off();
+#else
gpio_direction_output(_3_GPIO_TOUCH_EN, 0);
#if !defined(CONFIG_ARIES_NTT)
gpio_direction_output(_3_GPIO_TOUCH_CE, 0);
#endif
+#endif
msleep(300);
}
init_hw(); //after update, re initalize.
@@ -727,6 +959,9 @@
printk("%s \n", __FUNCTION__);
i2c_del_driver(&touchkey_i2c_driver);
misc_deregister(&touchkey_update_device);
+#ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
+ misc_deregister(&backlightnotification_device);
+#endif
if (touchkey_wq)
destroy_workqueue(touchkey_wq);
#if !defined(CONFIG_ARIES_NTT)
diff -X FILE -U 3 -H -d -r -N -- Kernel-stock/drivers/input/keyboard/Kconfig Kernel/drivers/input/keyboard/Kconfig
--- Kernel-stock/drivers/input/keyboard/Kconfig 2010-10-05 18:13:43.000000000 +0800
+++ Kernel/drivers/input/keyboard/Kconfig 2010-11-18 16:34:40.273075002 +0800
@@ -484,5 +484,13 @@
To compile this driver as a module, choose M here: the
module will be called melfas-touchkey.
+
+config KEYPAD_CYPRESS_TOUCH_USE_BLN
+ bool "Cypress touch keypad: use backlight notification"
+ depends on KEYPAD_CYPRESS_TOUCH
+ default y
+ help
+ Say Y here to enable the backlight notification
+ for android led-notification (modified liblight needed)
endif
diff -X FILE -U 3 -H -d -r -N -- Kernel-stock/drivers/input/touchscreen/qt602240.c Kernel/drivers/input/touchscreen/qt602240.c
--- Kernel-stock/drivers/input/touchscreen/qt602240.c 2010-10-05 18:13:43.000000000 +0800
+++ Kernel/drivers/input/touchscreen/qt602240.c 2010-11-15 23:43:10.954887003 +0800
@@ -2938,7 +2938,7 @@
fingerInfo[id].size_id= (id<<8)|size;
fingerInfo[id].pressure= 0;
bChangeUpDn= 1;
- printk(KERN_DEBUG "[TSP]### Finger[%d] Up (%d,%d) - touch num is (%d) status=0x%02x\n", id, fingerInfo[id].x, fingerInfo[id].y , --qt_touch_num_state[id], quantum_msg[1]);
+ //printk(KERN_DEBUG "[TSP]### Finger[%d] Up (%d,%d) - touch num is (%d) status=0x%02x\n", id, fingerInfo[id].x, fingerInfo[id].y , --qt_touch_num_state[id], quantum_msg[1]);
}
else if ( (quantum_msg[1] & 0x80) && (quantum_msg[1] & 0x40) ) // Detect & Press
{
@@ -2961,7 +2961,7 @@
fingerInfo[id].x= (int16_t)x;
fingerInfo[id].y= (int16_t)y;
bChangeUpDn= 1;
- printk(KERN_DEBUG "[TSP]### Finger[%d] Down (%d,%d) - touch num is (%d) status=0x%02x\n", id, fingerInfo[id].x, fingerInfo[id].y , ++qt_touch_num_state[id], quantum_msg[1] );
+ //printk(KERN_DEBUG "[TSP]### Finger[%d] Down (%d,%d) - touch num is (%d) status=0x%02x\n", id, fingerInfo[id].x, fingerInfo[id].y , ++qt_touch_num_state[id], quantum_msg[1] );
}
else if ( (quantum_msg[1] & 0x80) && (quantum_msg[1] & 0x10) ) // Detect & Move
{