aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd/da9063/registers.h
blob: 2e0ba6d5fbc3c4496f70b2204fc13fd895e98580 (plain) (blame)
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
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
/*
 * Registers definition for DA9063 modules
 *
 * Copyright 2012 Dialog Semiconductor Ltd.
 *
 * Author: Michal Hajduk <michal.hajduk@diasemi.com>
 *	   Krystian Garbaciak <krystian.garbaciak@diasemi.com>
 *
 *  This program is free software; you can redistribute  it and/or modify it
 *  under  the terms of  the GNU General  Public License as published by the
 *  Free Software Foundation;  either version 2 of the  License, or (at your
 *  option) any later version.
 *
 */

#ifndef _DA9063_REG_H
#define	_DA9063_REG_H

#define DA9063_I2C_PAGE_SEL_SHIFT	1
#define	DA9063_EVENT_REG_NUM		4

/* Page selection I2C or SPI always in the begining of any page. */
/* Page 0 : I2C access 0x000 - 0x0FF	SPI access 0x000 - 0x07F */
/* Page 1 :				SPI access 0x080 - 0x0FF */
/* Page 2 : I2C access 0x100 - 0x1FF	SPI access 0x100 - 0x17F */
/* Page 3 :				SPI access 0x180 - 0x1FF */
#define	DA9063_REG_PAGE_CON		0x00

/* System Control and Event Registers */
#define	DA9063_REG_STATUS_A		0x01
#define	DA9063_REG_STATUS_B		0x02
#define	DA9063_REG_STATUS_C		0x03
#define	DA9063_REG_STATUS_D		0x04
#define	DA9063_REG_FAULT_LOG		0x05
#define	DA9063_REG_EVENT_A		0x06
#define	DA9063_REG_EVENT_B		0x07
#define	DA9063_REG_EVENT_C		0x08
#define	DA9063_REG_EVENT_D		0x09
#define	DA9063_REG_IRQ_MASK_A		0x0A
#define	DA9063_REG_IRQ_MASK_B		0x0B
#define	DA9063_REG_IRQ_MASK_C		0x0C
#define	DA9063_REG_IRQ_MASK_D		0x0D
#define	DA9063_REG_CONTROL_A		0x0E
#define	DA9063_REG_CONTROL_B		0x0F
#define	DA9063_REG_CONTROL_C		0x10
#define	DA9063_REG_CONTROL_D		0x11
#define	DA9063_REG_CONTROL_E		0x12
#define	DA9063_REG_CONTROL_F		0x13
#define	DA9063_REG_PD_DIS		0x14

/* GPIO Control Registers */
#define	DA9063_REG_GPIO_0_1		0x15
#define	DA9063_REG_GPIO_2_3		0x16
#define	DA9063_REG_GPIO_4_5		0x17
#define	DA9063_REG_GPIO_6_7		0x18
#define	DA9063_REG_GPIO_8_9		0x19
#define	DA9063_REG_GPIO_10_11		0x1A
#define	DA9063_REG_GPIO_12_13		0x1B
#define	DA9063_REG_GPIO_14_15		0x1C
#define	DA9063_REG_GPIO_MODE0_7		0x1D
#define	DA9063_REG_GPIO_MODE8_15	0x1E
#define	DA9063_REG_SWITCH_CONT		0x1F

/* Regulator Control Registers */
#define	DA9063_REG_BCORE2_CONT		0x20
#define	DA9063_REG_BCORE1_CONT		0x21
#define	DA9063_REG_BPRO_CONT		0x22
#define	DA9063_REG_BMEM_CONT		0x23
#define	DA9063_REG_BIO_CONT		0x24
#define	DA9063_REG_BPERI_CONT		0x25
#define	DA9063_REG_LDO1_CONT		0x26
#define	DA9063_REG_LDO2_CONT		0x27
#define	DA9063_REG_LDO3_CONT		0x28
#define	DA9063_REG_LDO4_CONT		0x29
#define	DA9063_REG_LDO5_CONT		0x2A
#define	DA9063_REG_LDO6_CONT		0x2B
#define	DA9063_REG_LDO7_CONT		0x2C
#define	DA9063_REG_LDO8_CONT		0x2D
#define	DA9063_REG_LDO9_CONT		0x2E
#define	DA9063_REG_LDO10_CONT		0x2F
#define	DA9063_REG_LDO11_CONT		0x30
#define	DA9063_REG_SUPPLIES		0x31
#define	DA9063_REG_DVC_1		0x32
#define	DA9063_REG_DVC_2		0x33

/* GP-ADC Control Registers */
#define	DA9063_REG_ADC_MAN		0x34
#define	DA9063_REG_ADC_CONT		0x35
#define	DA9063_REG_VSYS_MON		0x36
#define	DA9063_REG_ADC_RES_L		0x37
#define	DA9063_REG_ADC_RES_H		0x38
#define	DA9063_REG_VSYS_RES		0x39
#define	DA9063_REG_ADCIN1_RES		0x3A
#define	DA9063_REG_ADCIN2_RES		0x3B
#define	DA9063_REG_ADCIN3_RES		0x3C
#define	DA9063_REG_MON_A8_RES		0x3D
#define	DA9063_REG_MON_A9_RES		0x3E
#define	DA9063_REG_MON_A10_RES		0x3F

/* RTC Calendar and Alarm Registers */
#define	DA9063_REG_COUNT_S		0x40
#define	DA9063_REG_COUNT_MI		0x41
#define	DA9063_REG_COUNT_H		0x42
#define	DA9063_REG_COUNT_D		0x43
#define	DA9063_REG_COUNT_MO		0x44
#define	DA9063_REG_COUNT_Y		0x45

#define	DA9063_AD_REG_ALARM_MI		0x46
#define	DA9063_AD_REG_ALARM_H		0x47
#define	DA9063_AD_REG_ALARM_D		0x48
#define	DA9063_AD_REG_ALARM_MO		0x49
#define	DA9063_AD_REG_ALARM_Y		0x4A
#define	DA9063_AD_REG_SECOND_A		0x4B
#define	DA9063_AD_REG_SECOND_B		0x4C
#define	DA9063_AD_REG_SECOND_C		0x4D
#define	DA9063_AD_REG_SECOND_D		0x4E

#define	DA9063_BB_REG_ALARM_S		0x46
#define	DA9063_BB_REG_ALARM_MI		0x47
#define	DA9063_BB_REG_ALARM_H		0x48
#define	DA9063_BB_REG_ALARM_D		0x49
#define	DA9063_BB_REG_ALARM_MO		0x4A
#define	DA9063_BB_REG_ALARM_Y		0x4B
#define	DA9063_BB_REG_SECOND_A		0x4C
#define	DA9063_BB_REG_SECOND_B		0x4D
#define	DA9063_BB_REG_SECOND_C		0x4E
#define	DA9063_BB_REG_SECOND_D		0x4F

/* Sequencer Control Registers */
#define	DA9063_REG_SEQ			0x81
#define	DA9063_REG_SEQ_TIMER		0x82
#define	DA9063_REG_ID_2_1		0x83
#define	DA9063_REG_ID_4_3		0x84
#define	DA9063_REG_ID_6_5		0x85
#define	DA9063_REG_ID_8_7		0x86
#define	DA9063_REG_ID_10_9		0x87
#define	DA9063_REG_ID_12_11		0x88
#define	DA9063_REG_ID_14_13		0x89
#define	DA9063_REG_ID_16_15		0x8A
#define	DA9063_REG_ID_18_17		0x8B
#define	DA9063_REG_ID_20_19		0x8C
#define	DA9063_REG_ID_22_21		0x8D
#define	DA9063_REG_ID_24_23		0x8E
#define	DA9063_REG_ID_26_25		0x8F
#define	DA9063_REG_ID_28_27		0x90
#define	DA9063_REG_ID_30_29		0x91
#define	DA9063_REG_ID_32_31		0x92
#define	DA9063_REG_SEQ_A		0x95
#define	DA9063_REG_SEQ_B		0x96
#define	DA9063_REG_WAIT			0x97
#define	DA9063_REG_EN_32K		0x98
#define	DA9063_REG_RESET		0x99

/* Regulator Setting Registers */
#define	DA9063_REG_BUCK_ILIM_A		0x9A
#define	DA9063_REG_BUCK_ILIM_B		0x9B
#define	DA9063_REG_BUCK_ILIM_C		0x9C
#define	DA9063_REG_BCORE2_CFG		0x9D
#define	DA9063_REG_BCORE1_CFG		0x9E
#define	DA9063_REG_BPRO_CFG		0x9F
#define	DA9063_REG_BIO_CFG		0xA0
#define	DA9063_REG_BMEM_CFG		0xA1
#define	DA9063_REG_BPERI_CFG		0xA2
#define	DA9063_REG_VBCORE2_A		0xA3
#define	DA9063_REG_VBCORE1_A		0xA4
#define	DA9063_REG_VBPRO_A		0xA5
#define	DA9063_REG_VBMEM_A		0xA6
#define	DA9063_REG_VBIO_A		0xA7
#define	DA9063_REG_VBPERI_A		0xA8
#define	DA9063_REG_VLDO1_A		0xA9
#define	DA9063_REG_VLDO2_A		0xAA
#define	DA9063_REG_VLDO3_A		0xAB
#define	DA9063_REG_VLDO4_A		0xAC
#define	DA9063_REG_VLDO5_A		0xAD
#define	DA9063_REG_VLDO6_A		0xAE
#define	DA9063_REG_VLDO7_A		0xAF
#define	DA9063_REG_VLDO8_A		0xB0
#define	DA9063_REG_VLDO9_A		0xB1
#define	DA9063_REG_VLDO10_A		0xB2
#define	DA9063_REG_VLDO11_A		0xB3
#define	DA9063_REG_VBCORE2_B		0xB4
#define	DA9063_REG_VBCORE1_B		0xB5
#define	DA9063_REG_VBPRO_B		0xB6
#define	DA9063_REG_VBMEM_B		0xB7
#define	DA9063_REG_VBIO_B		0xB8
#define	DA9063_REG_VBPERI_B		0xB9
#define	DA9063_REG_VLDO1_B		0xBA
#define	DA9063_REG_VLDO2_B		0xBB
#define	DA9063_REG_VLDO3_B		0xBC
#define	DA9063_REG_VLDO4_B		0xBD
#define	DA9063_REG_VLDO5_B		0xBE
#define	DA9063_REG_VLDO6_B		0xBF
#define	DA9063_REG_VLDO7_B		0xC0
#define	DA9063_REG_VLDO8_B		0xC1
#define	DA9063_REG_VLDO9_B		0xC2
#define	DA9063_REG_VLDO10_B		0xC3
#define	DA9063_REG_VLDO11_B		0xC4

/* Backup Battery Charger Control Register */
#define	DA9063_REG_BBAT_CONT		0xC5

/* GPIO PWM (LED) */
#define	DA9063_REG_GPO11_LED		0xC6
#define	DA9063_REG_GPO14_LED		0xC7
#define	DA9063_REG_GPO15_LED		0xC8

/* GP-ADC Threshold Registers */
#define	DA9063_REG_ADC_CFG		0xC9
#define	DA9063_REG_AUTO1_HIGH		0xCA
#define	DA9063_REG_AUTO1_LOW		0xCB
#define	DA9063_REG_AUTO2_HIGH		0xCC
#define	DA9063_REG_AUTO2_LOW		0xCD
#define	DA9063_REG_AUTO3_HIGH		0xCE
#define	DA9063_REG_AUTO3_LOW		0xCF

/* DA9063 Configuration registers */
/* OTP */
#define	DA9063_REG_OPT_COUNT		0x101
#define	DA9063_REG_OPT_ADDR		0x102
#define	DA9063_REG_OPT_DATA		0x103

/* Customer Trim and Configuration */
#define	DA9063_REG_T_OFFSET		0x104
#define	DA9063_REG_INTERFACE		0x105
#define	DA9063_REG_CONFIG_A		0x106
#define	DA9063_REG_CONFIG_B		0x107
#define	DA9063_REG_CONFIG_C		0x108
#define	DA9063_REG_CONFIG_D		0x109
#define	DA9063_REG_CONFIG_E		0x10A
#define	DA9063_REG_CONFIG_F		0x10B
#define	DA9063_REG_CONFIG_G		0x10C
#define	DA9063_REG_CONFIG_H		0x10D
#define	DA9063_REG_CONFIG_I		0x10E
#define	DA9063_REG_CONFIG_J		0x10F
#define	DA9063_REG_CONFIG_K		0x110
#define	DA9063_REG_CONFIG_L		0x111

#define	DA9063_AD_REG_MON_REG_1		0x112
#define	DA9063_AD_REG_MON_REG_2		0x113
#define	DA9063_AD_REG_MON_REG_3		0x114
#define	DA9063_AD_REG_MON_REG_4		0x115
#define	DA9063_AD_REG_MON_REG_5		0x116
#define	DA9063_AD_REG_MON_REG_6		0x117
#define	DA9063_AD_REG_TRIM_CLDR		0x118

#define	DA9063_AD_REG_GP_ID_0		0x119
#define	DA9063_AD_REG_GP_ID_1		0x11A
#define	DA9063_AD_REG_GP_ID_2		0x11B
#define	DA9063_AD_REG_GP_ID_3		0x11C
#define	DA9063_AD_REG_GP_ID_4		0x11D
#define	DA9063_AD_REG_GP_ID_5		0x11E
#define	DA9063_AD_REG_GP_ID_6		0x11F
#define	DA9063_AD_REG_GP_ID_7		0x120
#define	DA9063_AD_REG_GP_ID_8		0x121
#define	DA9063_AD_REG_GP_ID_9		0x122
#define	DA9063_AD_REG_GP_ID_10		0x123
#define	DA9063_AD_REG_GP_ID_11		0x124
#define	DA9063_AD_REG_GP_ID_12		0x125
#define	DA9063_AD_REG_GP_ID_13		0x126
#define	DA9063_AD_REG_GP_ID_14		0x127
#define	DA9063_AD_REG_GP_ID_15		0x128
#define	DA9063_AD_REG_GP_ID_16		0x129
#define	DA9063_AD_REG_GP_ID_17		0x12A
#define	DA9063_AD_REG_GP_ID_18		0x12B
#define	DA9063_AD_REG_GP_ID_19		0x12C

#define	DA9063_BB_REG_CONFIG_M		0x112
#define	DA9063_BB_REG_CONFIG_N		0x113

#define	DA9063_BB_REG_MON_REG_1		0x114
#define	DA9063_BB_REG_MON_REG_2		0x115
#define	DA9063_BB_REG_MON_REG_3		0x116
#define	DA9063_BB_REG_MON_REG_4		0x117
#define	DA9063_BB_REG_MON_REG_5		0x11E
#define	DA9063_BB_REG_MON_REG_6		0x11F
#define	DA9063_BB_REG_TRIM_CLDR		0x120
/* General Purpose Registers */
#define	DA9063_BB_REG_GP_ID_0		0x121
#define	DA9063_BB_REG_GP_ID_1		0x122
#define	DA9063_BB_REG_GP_ID_2		0x123
#define	DA9063_BB_REG_GP_ID_3		0x124
#define	DA9063_BB_REG_GP_ID_4		0x125
#define	DA9063_BB_REG_GP_ID_5		0x126
#define	DA9063_BB_REG_GP_ID_6		0x127
#define	DA9063_BB_REG_GP_ID_7		0x128
#define	DA9063_BB_REG_GP_ID_8		0x129
#define	DA9063_BB_REG_GP_ID_9		0x12A
#define	DA9063_BB_REG_GP_ID_10		0x12B
#define	DA9063_BB_REG_GP_ID_11		0x12C
#define	DA9063_BB_REG_GP_ID_12		0x12D
#define	DA9063_BB_REG_GP_ID_13		0x12E
#define	DA9063_BB_REG_GP_ID_14		0x12F
#define	DA9063_BB_REG_GP_ID_15		0x130
#define	DA9063_BB_REG_GP_ID_16		0x131
#define	DA9063_BB_REG_GP_ID_17		0x132
#define	DA9063_BB_REG_GP_ID_18		0x133
#define	DA9063_BB_REG_GP_ID_19		0x134

/* Chip ID and variant */
#define	DA9063_REG_CHIP_ID		0x181
#define	DA9063_REG_CHIP_VARIANT		0x182

/*
 * PMIC registers bits
 */
/* DA9063_REG_PAGE_CON (addr=0x00) */
#define	DA9063_PEG_PAGE_SHIFT			0
#define	DA9063_REG_PAGE_MASK			0x07
#define		DA9063_REG_PAGE0		0x00
#define		DA9063_REG_PAGE2		0x02
#define	DA9063_PAGE_WRITE_MODE			0x00
#define	DA9063_REPEAT_WRITE_MODE		0x40
#define	DA9063_PAGE_REVERT			0x80

/* DA9063_REG_STATUS_A (addr=0x01) */
#define	DA9063_NONKEY				0x01
#define	DA9063_WAKE				0x02
#define	DA9063_DVC_BUSY				0x04
#define	DA9063_COMP_1V2				0x08

/* DA9063_REG_STATUS_B (addr=0x02) */
#define	DA9063_GPI0				0x01
#define	DA9