regulator: fan53555: add tcs4526
authorRudi Heitbaum <rudi@heitbaum.com>
Wed, 2 Jun 2021 11:29:47 +0000 (11:29 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 4 Jun 2021 14:27:10 +0000 (15:27 +0100)
For rk3399pro boards the tcs4526 regulator supports the vdd_gpu
regulator. The tcs4526 regulator has a chip id of <0>.
Add the compatibile tcs,tcs4526

without this patch, the dmesg output is:
  fan53555-regulator 0-0010: Chip ID 0 not supported!
  fan53555-regulator 0-0010: Failed to setup device!
  fan53555-regulator: probe of 0-0010 failed with error -22
with this patch, the dmesg output is:
  vdd_gpu: supplied by vcc5v0_sys

The regulators are described as:
- Dedicated power management IC TCS4525
- Lithium battery protection chip TCS4526

This has been tested with a Radxa Rock Pi N10.

Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
Link: https://lore.kernel.org/r/20210602112943.GA119@5f9be87369f8
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/fan53555.c

index eb67500ad279e6de43541084a35e73bad5b69b3a..dac1fb584fa35decbab9334f47a673cc5ecbb084 100644 (file)
@@ -92,6 +92,10 @@ enum {
        TCS4525_CHIP_ID_12 = 12,
 };
 
+enum {
+       TCS4526_CHIP_ID_00 = 0,
+};
+
 /* IC mask revision */
 enum {
        FAN53555_CHIP_REV_00 = 0x3,
@@ -341,6 +345,7 @@ static int fan53526_voltages_setup_tcs(struct fan53555_device_info *di)
 {
        switch (di->chip_id) {
        case TCS4525_CHIP_ID_12:
+       case TCS4526_CHIP_ID_00:
                di->slew_reg = TCS4525_TIME;
                di->slew_mask = TCS_SLEW_MASK;
                di->ramp_delay_table = tcs_slew_rates;
@@ -536,6 +541,9 @@ static const struct of_device_id __maybe_unused fan53555_dt_ids[] = {
        }, {
                .compatible = "tcs,tcs4525",
                .data = (void *)FAN53526_VENDOR_TCS
+       }, {
+               .compatible = "tcs,tcs4526",
+               .data = (void *)FAN53526_VENDOR_TCS
        },
        { }
 };
@@ -644,6 +652,9 @@ static const struct i2c_device_id fan53555_id[] = {
        }, {
                .name = "tcs4525",
                .driver_data = FAN53526_VENDOR_TCS
+       }, {
+               .name = "tcs4526",
+               .driver_data = FAN53526_VENDOR_TCS
        },
        { },
 };