@@ -42,6 +42,7 @@ static const char * const axp20x_model_names[] = {
4242 "AXP223" ,
4343 "AXP288" ,
4444 "AXP313a" ,
45+ "AXP717" ,
4546 "AXP803" ,
4647 "AXP806" ,
4748 "AXP809" ,
@@ -207,6 +208,25 @@ static const struct regmap_access_table axp313a_volatile_table = {
207208 .n_yes_ranges = ARRAY_SIZE (axp313a_volatile_ranges ),
208209};
209210
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+
210230static const struct regmap_range axp806_volatile_ranges [] = {
211231 regmap_reg_range (AXP20X_IRQ1_STATE , AXP20X_IRQ2_STATE ),
212232};
@@ -317,6 +337,11 @@ static const struct resource axp313a_pek_resources[] = {
317337 DEFINE_RES_IRQ_NAMED (AXP313A_IRQ_PEK_FAL_EDGE , "PEK_DBF" ),
318338};
319339
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+
320345static const struct resource axp803_pek_resources [] = {
321346 DEFINE_RES_IRQ_NAMED (AXP803_IRQ_PEK_RIS_EDGE , "PEK_DBR" ),
322347 DEFINE_RES_IRQ_NAMED (AXP803_IRQ_PEK_FAL_EDGE , "PEK_DBF" ),
@@ -391,6 +416,15 @@ static const struct regmap_config axp313a_regmap_config = {
391416 .cache_type = REGCACHE_MAPLE ,
392417};
393418
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+
394428static const struct regmap_config axp806_regmap_config = {
395429 .reg_bits = 8 ,
396430 .val_bits = 8 ,
@@ -589,6 +623,40 @@ static const struct regmap_irq axp313a_regmap_irqs[] = {
589623 INIT_REGMAP_IRQ (AXP313A , DIE_TEMP_HIGH , 0 , 0 ),
590624};
591625
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+
592660static const struct regmap_irq axp803_regmap_irqs [] = {
593661 INIT_REGMAP_IRQ (AXP803 , ACIN_OVER_V , 0 , 7 ),
594662 INIT_REGMAP_IRQ (AXP803 , ACIN_PLUGIN , 0 , 6 ),
@@ -776,6 +844,17 @@ static const struct regmap_irq_chip axp313a_regmap_irq_chip = {
776844 .num_regs = 1 ,
777845};
778846
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+
779858static const struct regmap_irq_chip axp803_regmap_irq_chip = {
780859 .name = "axp803" ,
781860 .status_base = AXP20X_IRQ1_STATE ,
@@ -941,6 +1020,11 @@ static struct mfd_cell axp313a_cells[] = {
9411020 MFD_CELL_RES ("axp313a-pek" , axp313a_pek_resources ),
9421021};
9431022
1023+ static struct mfd_cell axp717_cells [] = {
1024+ MFD_CELL_NAME ("axp20x-regulator" ),
1025+ MFD_CELL_RES ("axp20x-pek" , axp717_pek_resources ),
1026+ };
1027+
9441028static const struct resource axp288_adc_resources [] = {
9451029 DEFINE_RES_IRQ_NAMED (AXP288_IRQ_GPADC , "GPADC" ),
9461030};
@@ -1181,6 +1265,12 @@ int axp20x_match_device(struct axp20x_dev *axp20x)
11811265 axp20x -> regmap_cfg = & axp313a_regmap_config ;
11821266 axp20x -> regmap_irq_chip = & axp313a_regmap_irq_chip ;
11831267 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 ;
11841274 case AXP803_ID :
11851275 axp20x -> nr_cells = ARRAY_SIZE (axp803_cells );
11861276 axp20x -> cells = axp803_cells ;
0 commit comments