| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Maxim MAX77620 Regulator driver |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Author: Mallikarjun Kasoju <mkasoju@nvidia.com> |
|---|
| 7 | 8 | * Laxman Dewangan <ldewangan@nvidia.com> |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 10 | | - * under the terms and conditions of the GNU General Public License, |
|---|
| 11 | | - * version 2, as published by the Free Software Foundation. |
|---|
| 12 | 9 | */ |
|---|
| 13 | 10 | |
|---|
| 14 | 11 | #include <linux/init.h> |
|---|
| .. | .. |
|---|
| 470 | 467 | { |
|---|
| 471 | 468 | struct max77620_regulator *pmic = rdev_get_drvdata(rdev); |
|---|
| 472 | 469 | int id = rdev_get_id(rdev); |
|---|
| 473 | | - int ret = 1; |
|---|
| 470 | + int ret; |
|---|
| 474 | 471 | |
|---|
| 475 | 472 | if (pmic->active_fps_src[id] != MAX77620_FPS_SRC_NONE) |
|---|
| 476 | 473 | return 1; |
|---|
| .. | .. |
|---|
| 690 | 687 | .active_discharge_mask = MAX77620_SD_CFG1_ADE_MASK, \ |
|---|
| 691 | 688 | .active_discharge_reg = MAX77620_REG_##_id##_CFG, \ |
|---|
| 692 | 689 | .type = REGULATOR_VOLTAGE, \ |
|---|
| 690 | + .owner = THIS_MODULE, \ |
|---|
| 693 | 691 | }, \ |
|---|
| 694 | 692 | } |
|---|
| 695 | 693 | |
|---|
| .. | .. |
|---|
| 721 | 719 | .active_discharge_mask = MAX77620_LDO_CFG2_ADE_MASK, \ |
|---|
| 722 | 720 | .active_discharge_reg = MAX77620_REG_##_id##_CFG2, \ |
|---|
| 723 | 721 | .type = REGULATOR_VOLTAGE, \ |
|---|
| 722 | + .owner = THIS_MODULE, \ |
|---|
| 724 | 723 | }, \ |
|---|
| 725 | 724 | } |
|---|
| 726 | 725 | |
|---|
| .. | .. |
|---|
| 744 | 743 | static struct max77620_regulator_info max20024_regs_info[MAX77620_NUM_REGS] = { |
|---|
| 745 | 744 | RAIL_SD(SD0, sd0, "in-sd0", SD0, 800000, 1587500, 12500, 0x22, SD0), |
|---|
| 746 | 745 | RAIL_SD(SD1, sd1, "in-sd1", SD1, 600000, 3387500, 12500, 0x22, SD1), |
|---|
| 746 | + RAIL_SD(SD2, sd2, "in-sd2", SDX, 600000, 3787500, 12500, 0xFF, NONE), |
|---|
| 747 | + RAIL_SD(SD3, sd3, "in-sd3", SDX, 600000, 3787500, 12500, 0xFF, NONE), |
|---|
| 748 | + RAIL_SD(SD4, sd4, "in-sd4", SDX, 600000, 3787500, 12500, 0xFF, NONE), |
|---|
| 749 | + |
|---|
| 750 | + RAIL_LDO(LDO0, ldo0, "in-ldo0-1", N, 800000, 2375000, 25000), |
|---|
| 751 | + RAIL_LDO(LDO1, ldo1, "in-ldo0-1", N, 800000, 2375000, 25000), |
|---|
| 752 | + RAIL_LDO(LDO2, ldo2, "in-ldo2", P, 800000, 3950000, 50000), |
|---|
| 753 | + RAIL_LDO(LDO3, ldo3, "in-ldo3-5", P, 800000, 3950000, 50000), |
|---|
| 754 | + RAIL_LDO(LDO4, ldo4, "in-ldo4-6", P, 800000, 1587500, 12500), |
|---|
| 755 | + RAIL_LDO(LDO5, ldo5, "in-ldo3-5", P, 800000, 3950000, 50000), |
|---|
| 756 | + RAIL_LDO(LDO6, ldo6, "in-ldo4-6", P, 800000, 3950000, 50000), |
|---|
| 757 | + RAIL_LDO(LDO7, ldo7, "in-ldo7-8", N, 800000, 3950000, 50000), |
|---|
| 758 | + RAIL_LDO(LDO8, ldo8, "in-ldo7-8", N, 800000, 3950000, 50000), |
|---|
| 759 | +}; |
|---|
| 760 | + |
|---|
| 761 | +static struct max77620_regulator_info max77663_regs_info[MAX77620_NUM_REGS] = { |
|---|
| 762 | + RAIL_SD(SD0, sd0, "in-sd0", SD0, 600000, 3387500, 12500, 0xFF, NONE), |
|---|
| 763 | + RAIL_SD(SD1, sd1, "in-sd1", SD1, 800000, 1587500, 12500, 0xFF, NONE), |
|---|
| 747 | 764 | RAIL_SD(SD2, sd2, "in-sd2", SDX, 600000, 3787500, 12500, 0xFF, NONE), |
|---|
| 748 | 765 | RAIL_SD(SD3, sd3, "in-sd3", SDX, 600000, 3787500, 12500, 0xFF, NONE), |
|---|
| 749 | 766 | RAIL_SD(SD4, sd4, "in-sd4", SDX, 600000, 3787500, 12500, 0xFF, NONE), |
|---|
| .. | .. |
|---|
| 783 | 800 | case MAX77620: |
|---|
| 784 | 801 | rinfo = max77620_regs_info; |
|---|
| 785 | 802 | break; |
|---|
| 786 | | - default: |
|---|
| 803 | + case MAX20024: |
|---|
| 787 | 804 | rinfo = max20024_regs_info; |
|---|
| 788 | 805 | break; |
|---|
| 806 | + case MAX77663: |
|---|
| 807 | + rinfo = max77663_regs_info; |
|---|
| 808 | + break; |
|---|
| 809 | + default: |
|---|
| 810 | + return -EINVAL; |
|---|
| 789 | 811 | } |
|---|
| 790 | 812 | |
|---|
| 791 | 813 | config.regmap = pmic->rmap; |
|---|
| .. | .. |
|---|
| 808 | 830 | continue; |
|---|
| 809 | 831 | |
|---|
| 810 | 832 | rdesc = &rinfo[id].desc; |
|---|
| 811 | | - pmic->rinfo[id] = &max77620_regs_info[id]; |
|---|
| 833 | + pmic->rinfo[id] = &rinfo[id]; |
|---|
| 812 | 834 | pmic->enable_power_mode[id] = MAX77620_POWER_MODE_NORMAL; |
|---|
| 813 | 835 | pmic->reg_pdata[id].active_fps_src = -1; |
|---|
| 814 | 836 | pmic->reg_pdata[id].active_fps_pd_slot = -1; |
|---|
| .. | .. |
|---|
| 886 | 908 | static const struct platform_device_id max77620_regulator_devtype[] = { |
|---|
| 887 | 909 | { .name = "max77620-pmic", }, |
|---|
| 888 | 910 | { .name = "max20024-pmic", }, |
|---|
| 911 | + { .name = "max77663-pmic", }, |
|---|
| 889 | 912 | {}, |
|---|
| 890 | 913 | }; |
|---|
| 891 | 914 | MODULE_DEVICE_TABLE(platform, max77620_regulator_devtype); |
|---|