@@ -42,6 +42,7 @@ static const char * const axp20x_model_names[] = {
42
42
"AXP223" ,
43
43
"AXP288" ,
44
44
"AXP313a" ,
45
+ "AXP717" ,
45
46
"AXP803" ,
46
47
"AXP806" ,
47
48
"AXP809" ,
@@ -207,6 +208,25 @@ static const struct regmap_access_table axp313a_volatile_table = {
207
208
.n_yes_ranges = ARRAY_SIZE (axp313a_volatile_ranges ),
208
209
};
209
210
211
+ static const struct regmap_range axp717_writeable_ranges [] = {
212
+ regmap_reg_range (AXP717_IRQ0_EN , AXP717_IRQ4_EN ),
213
+ regmap_reg_range (AXP717_DCDC_OUTPUT_CONTROL , AXP717_CPUSLDO_CONTROL ),
214
+ };
215
+
216
+ static const struct regmap_range axp717_volatile_ranges [] = {
217
+ regmap_reg_range (AXP717_IRQ0_STATE , AXP717_IRQ4_STATE ),
218
+ };
219
+
220
+ static const struct regmap_access_table axp717_writeable_table = {
221
+ .yes_ranges = axp717_writeable_ranges ,
222
+ .n_yes_ranges = ARRAY_SIZE (axp717_writeable_ranges ),
223
+ };
224
+
225
+ static const struct regmap_access_table axp717_volatile_table = {
226
+ .yes_ranges = axp717_volatile_ranges ,
227
+ .n_yes_ranges = ARRAY_SIZE (axp717_volatile_ranges ),
228
+ };
229
+
210
230
static const struct regmap_range axp806_volatile_ranges [] = {
211
231
regmap_reg_range (AXP20X_IRQ1_STATE , AXP20X_IRQ2_STATE ),
212
232
};
@@ -317,6 +337,11 @@ static const struct resource axp313a_pek_resources[] = {
317
337
DEFINE_RES_IRQ_NAMED (AXP313A_IRQ_PEK_FAL_EDGE , "PEK_DBF" ),
318
338
};
319
339
340
+ static const struct resource axp717_pek_resources [] = {
341
+ DEFINE_RES_IRQ_NAMED (AXP717_IRQ_PEK_RIS_EDGE , "PEK_DBR" ),
342
+ DEFINE_RES_IRQ_NAMED (AXP717_IRQ_PEK_FAL_EDGE , "PEK_DBF" ),
343
+ };
344
+
320
345
static const struct resource axp803_pek_resources [] = {
321
346
DEFINE_RES_IRQ_NAMED (AXP803_IRQ_PEK_RIS_EDGE , "PEK_DBR" ),
322
347
DEFINE_RES_IRQ_NAMED (AXP803_IRQ_PEK_FAL_EDGE , "PEK_DBF" ),
@@ -391,6 +416,15 @@ static const struct regmap_config axp313a_regmap_config = {
391
416
.cache_type = REGCACHE_MAPLE ,
392
417
};
393
418
419
+ static const struct regmap_config axp717_regmap_config = {
420
+ .reg_bits = 8 ,
421
+ .val_bits = 8 ,
422
+ .wr_table = & axp717_writeable_table ,
423
+ .volatile_table = & axp717_volatile_table ,
424
+ .max_register = AXP717_CPUSLDO_CONTROL ,
425
+ .cache_type = REGCACHE_RBTREE ,
426
+ };
427
+
394
428
static const struct regmap_config axp806_regmap_config = {
395
429
.reg_bits = 8 ,
396
430
.val_bits = 8 ,
@@ -589,6 +623,40 @@ static const struct regmap_irq axp313a_regmap_irqs[] = {
589
623
INIT_REGMAP_IRQ (AXP313A , DIE_TEMP_HIGH , 0 , 0 ),
590
624
};
591
625
626
+ static const struct regmap_irq axp717_regmap_irqs [] = {
627
+ INIT_REGMAP_IRQ (AXP717 , SOC_DROP_LVL2 , 0 , 7 ),
628
+ INIT_REGMAP_IRQ (AXP717 , SOC_DROP_LVL1 , 0 , 6 ),
629
+ INIT_REGMAP_IRQ (AXP717 , GAUGE_NEW_SOC , 0 , 4 ),
630
+ INIT_REGMAP_IRQ (AXP717 , BOOST_OVER_V , 0 , 2 ),
631
+ INIT_REGMAP_IRQ (AXP717 , VBUS_OVER_V , 0 , 1 ),
632
+ INIT_REGMAP_IRQ (AXP717 , VBUS_FAULT , 0 , 0 ),
633
+ INIT_REGMAP_IRQ (AXP717 , VBUS_PLUGIN , 1 , 7 ),
634
+ INIT_REGMAP_IRQ (AXP717 , VBUS_REMOVAL , 1 , 6 ),
635
+ INIT_REGMAP_IRQ (AXP717 , BATT_PLUGIN , 1 , 5 ),
636
+ INIT_REGMAP_IRQ (AXP717 , BATT_REMOVAL , 1 , 4 ),
637
+ INIT_REGMAP_IRQ (AXP717 , PEK_SHORT , 1 , 3 ),
638
+ INIT_REGMAP_IRQ (AXP717 , PEK_LONG , 1 , 2 ),
639
+ INIT_REGMAP_IRQ (AXP717 , PEK_FAL_EDGE , 1 , 1 ),
640
+ INIT_REGMAP_IRQ (AXP717 , PEK_RIS_EDGE , 1 , 0 ),
641
+ INIT_REGMAP_IRQ (AXP717 , WDOG_EXPIRE , 2 , 7 ),
642
+ INIT_REGMAP_IRQ (AXP717 , LDO_OVER_CURR , 2 , 6 ),
643
+ INIT_REGMAP_IRQ (AXP717 , BATT_OVER_CURR , 2 , 5 ),
644
+ INIT_REGMAP_IRQ (AXP717 , CHARG_DONE , 2 , 4 ),
645
+ INIT_REGMAP_IRQ (AXP717 , CHARG , 2 , 3 ),
646
+ INIT_REGMAP_IRQ (AXP717 , DIE_TEMP_HIGH , 2 , 2 ),
647
+ INIT_REGMAP_IRQ (AXP717 , CHARG_TIMER , 2 , 1 ),
648
+ INIT_REGMAP_IRQ (AXP717 , BATT_OVER_V , 2 , 0 ),
649
+ INIT_REGMAP_IRQ (AXP717 , BC_USB_DONE , 3 , 7 ),
650
+ INIT_REGMAP_IRQ (AXP717 , BC_USB_CHNG , 3 , 6 ),
651
+ INIT_REGMAP_IRQ (AXP717 , BATT_QUIT_TEMP_HIGH , 3 , 4 ),
652
+ INIT_REGMAP_IRQ (AXP717 , BATT_CHG_TEMP_HIGH , 3 , 3 ),
653
+ INIT_REGMAP_IRQ (AXP717 , BATT_CHG_TEMP_LOW , 3 , 2 ),
654
+ INIT_REGMAP_IRQ (AXP717 , BATT_ACT_TEMP_HIGH , 3 , 1 ),
655
+ INIT_REGMAP_IRQ (AXP717 , BATT_ACT_TEMP_LOW , 3 , 0 ),
656
+ INIT_REGMAP_IRQ (AXP717 , TYPEC_REMOVE , 4 , 6 ),
657
+ INIT_REGMAP_IRQ (AXP717 , TYPEC_PLUGIN , 4 , 5 ),
658
+ };
659
+
592
660
static const struct regmap_irq axp803_regmap_irqs [] = {
593
661
INIT_REGMAP_IRQ (AXP803 , ACIN_OVER_V , 0 , 7 ),
594
662
INIT_REGMAP_IRQ (AXP803 , ACIN_PLUGIN , 0 , 6 ),
@@ -776,6 +844,17 @@ static const struct regmap_irq_chip axp313a_regmap_irq_chip = {
776
844
.num_regs = 1 ,
777
845
};
778
846
847
+ static const struct regmap_irq_chip axp717_regmap_irq_chip = {
848
+ .name = "axp717_irq_chip" ,
849
+ .status_base = AXP717_IRQ0_STATE ,
850
+ .ack_base = AXP717_IRQ0_STATE ,
851
+ .unmask_base = AXP717_IRQ0_EN ,
852
+ .init_ack_masked = true,
853
+ .irqs = axp717_regmap_irqs ,
854
+ .num_irqs = ARRAY_SIZE (axp717_regmap_irqs ),
855
+ .num_regs = 5 ,
856
+ };
857
+
779
858
static const struct regmap_irq_chip axp803_regmap_irq_chip = {
780
859
.name = "axp803" ,
781
860
.status_base = AXP20X_IRQ1_STATE ,
@@ -941,6 +1020,11 @@ static struct mfd_cell axp313a_cells[] = {
941
1020
MFD_CELL_RES ("axp313a-pek" , axp313a_pek_resources ),
942
1021
};
943
1022
1023
+ static struct mfd_cell axp717_cells [] = {
1024
+ MFD_CELL_NAME ("axp20x-regulator" ),
1025
+ MFD_CELL_RES ("axp20x-pek" , axp717_pek_resources ),
1026
+ };
1027
+
944
1028
static const struct resource axp288_adc_resources [] = {
945
1029
DEFINE_RES_IRQ_NAMED (AXP288_IRQ_GPADC , "GPADC" ),
946
1030
};
@@ -1181,6 +1265,12 @@ int axp20x_match_device(struct axp20x_dev *axp20x)
1181
1265
axp20x -> regmap_cfg = & axp313a_regmap_config ;
1182
1266
axp20x -> regmap_irq_chip = & axp313a_regmap_irq_chip ;
1183
1267
break ;
1268
+ case AXP717_ID :
1269
+ axp20x -> nr_cells = ARRAY_SIZE (axp717_cells );
1270
+ axp20x -> cells = axp717_cells ;
1271
+ axp20x -> regmap_cfg = & axp717_regmap_config ;
1272
+ axp20x -> regmap_irq_chip = & axp717_regmap_irq_chip ;
1273
+ break ;
1184
1274
case AXP803_ID :
1185
1275
axp20x -> nr_cells = ARRAY_SIZE (axp803_cells );
1186
1276
axp20x -> cells = axp803_cells ;
0 commit comments