Message ID | 20221114162459.1802174-1-martin.botka@somainline.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2236623wru; Mon, 14 Nov 2022 08:28:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Tu44M2WL+Xc0Q0/ek7S+5mcxMHuYGhNNTJTS4iWvD0a2AFGKIw5NSq03q2FrU7bmk5eEN X-Received: by 2002:a17:90a:c712:b0:213:c04:42be with SMTP id o18-20020a17090ac71200b002130c0442bemr14245815pjt.61.1668443305818; Mon, 14 Nov 2022 08:28:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668443305; cv=none; d=google.com; s=arc-20160816; b=HV8L2f9hb02Guo8m5CbtgE5uVHfWux6MLvZVNoH/ecR4wy4KVpEJvY2WGOOcGIpTUO eibrpaDnCIJm+cqZflDzYIcjh2+ihbta/XDwW+o6K07AkDbnvuPOv89LJ1+7u6j9J0OE IHWAMrPIDd6ab0C6uB4p00yZUjNkCHJeRlrPja5tIJXaf8BMtfN+wR631RxEx0Z95nWf NY1JtYQh320rOwQWZsmL2O2Xiaj/GBS4IFN5KvEUEvRJ4wbA1F3/H+31a7tsfmd9CWix VRgIXcsO0vySYbbfbdqJ37qiX5qcgh4/ONot0m1hGJe46oXPZ8WmoTSfWNI119HslGPM xJ5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=+y8VjqH9uIa81M5M9wGBPYE+MUGpe3h5EgWfl+mHbL8=; b=wYocqM/j90JeC3KK/YKanz6DR2NtmSrZJf4vGUNvMZV/CB6veh8cd9/eAdmarueA3M qMtYqGSz8kuBiJ87qWqNpBL14I36ZqBhf3fs1TxPqQJu5lOdDZkEWSTVbYZYuezYRQS4 deDaQyQWLwEMwhtzH3vlnQOP1sYWnVybzoxDIBjhtsmrX18UmUnzC975TakgbGAFAJT1 B27JSbNrbzW9Mf9CI7nueK/X9L/zESHGLG6zeSlyyfHThFmeWguuKRpLSERQcSSA3B8T xCNfxEmzmfQSAH2Mj+EUY3Go+xi3PM1utC57xeZX+vvA5dMSLnUaYvwfPtNuFN0jrq8F /FxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q7-20020a056a00150700b00555463cd9e6si10800867pfu.238.2022.11.14.08.27.49; Mon, 14 Nov 2022 08:28:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237458AbiKNQZP (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Mon, 14 Nov 2022 11:25:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237373AbiKNQZK (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 14 Nov 2022 11:25:10 -0500 X-Greylist: delayed 70 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 14 Nov 2022 08:25:09 PST Received: from relay06.th.seeweb.it (relay06.th.seeweb.it [5.144.164.167]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D83893A6 for <linux-kernel@vger.kernel.org>; Mon, 14 Nov 2022 08:25:09 -0800 (PST) Received: from TimeMachine.lan (bband-dyn193.178-41-216.t-com.sk [178.41.216.193]) by m-r2.th.seeweb.it (Postfix) with ESMTPA id BDD7040190; Mon, 14 Nov 2022 17:25:07 +0100 (CET) From: Martin Botka <martin.botka@somainline.org> To: martin.botka1@gmail.com Cc: ~postmarketos/upstreaming@lists.sr.ht, Konrad Dybcio <konrad.dybcio@somainline.org>, AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>, Marijn Suijten <marijn.suijten@somainline.org>, Jami Kettunen <jamipkettunen@somainline.org>, Paul Bouchara <paul.bouchara@somainline.org>, Yenda <jtrmal@gmail.com>, Martin Botka <martin.botka@somainline.org>, Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Chen-Yu Tsai <wens@csie.org>, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] regulator: axp20x: Add support for AXP1530 variant Date: Mon, 14 Nov 2022 17:24:58 +0100 Message-Id: <20221114162459.1802174-1-martin.botka@somainline.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749489607807246461?= X-GMAIL-MSGID: =?utf-8?q?1749489607807246461?= |
Series |
[1/1] regulator: axp20x: Add support for AXP1530 variant
|
|
Commit Message
Martin Botka
Nov. 14, 2022, 4:24 p.m. UTC
AXP1530 has a few regulators that are controlled via I2C or RSB Bus.
Add support for them.
Signed-off-by: Martin Botka <martin.botka@somainline.org>
---
drivers/regulator/axp20x-regulator.c | 44 ++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
Comments
Hi Martin, Thank you for the patch! Yet something to improve: [auto build test ERROR on broonie-regulator/for-next] [also build test ERROR on linus/master v6.1-rc5 next-20221114] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Martin-Botka/regulator-axp20x-Add-support-for-AXP1530-variant/20221115-002644 base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next patch link: https://lore.kernel.org/r/20221114162459.1802174-1-martin.botka%40somainline.org patch subject: [PATCH 1/1] regulator: axp20x: Add support for AXP1530 variant config: x86_64-randconfig-k001-20221114 compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/7f0eb274b33943549c38a0eb160748d3754ad1e7 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Martin-Botka/regulator-axp20x-Add-support-for-AXP1530-variant/20221115-002644 git checkout 7f0eb274b33943549c38a0eb160748d3754ad1e7 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/regulator/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): >> drivers/regulator/axp20x-regulator.c:1021:2: error: use of undeclared identifier 'AXP1530_DCDC1' AXP_DESC_RANGES(AXP1530, DCDC1, "dcdc1", "vin1", axp1530_dcdc1_ranges, ^ drivers/regulator/axp20x-regulator.c:351:10: note: expanded from macro 'AXP_DESC_RANGES' .id = _family##_##_id, \ ^ <scratch space>:53:1: note: expanded from here AXP1530_DCDC1 ^ >> drivers/regulator/axp20x-regulator.c:1022:12: error: use of undeclared identifier 'AXP1530_DCDC1_CONRTOL' 0x6B, AXP1530_DCDC1_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, ^ >> drivers/regulator/axp20x-regulator.c:1022:41: error: use of undeclared identifier 'AXP1530_OUTPUT_CONTROL' 0x6B, AXP1530_DCDC1_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, ^ >> drivers/regulator/axp20x-regulator.c:1024:2: error: use of undeclared identifier 'AXP1530_DCDC2' AXP_DESC_RANGES(AXP1530, DCDC2, "dcdc2", "vin2", axp1530_dcdc2_ranges, ^ drivers/regulator/axp20x-regulator.c:351:10: note: expanded from macro 'AXP_DESC_RANGES' .id = _family##_##_id, \ ^ <scratch space>:58:1: note: expanded from here AXP1530_DCDC2 ^ >> drivers/regulator/axp20x-regulator.c:1025:12: error: use of undeclared identifier 'AXP1530_DCDC2_CONRTOL' 0x58, AXP1530_DCDC2_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, ^ drivers/regulator/axp20x-regulator.c:1025:41: error: use of undeclared identifier 'AXP1530_OUTPUT_CONTROL' 0x58, AXP1530_DCDC2_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, ^ >> drivers/regulator/axp20x-regulator.c:1027:2: error: use of undeclared identifier 'AXP1530_DCDC3' AXP_DESC_RANGES(AXP1530, DCDC3, "dcdc3", "vin3", axp1530_dcdc3_ranges, ^ drivers/regulator/axp20x-regulator.c:351:10: note: expanded from macro 'AXP_DESC_RANGES' .id = _family##_##_id, \ ^ <scratch space>:63:1: note: expanded from here AXP1530_DCDC3 ^ >> drivers/regulator/axp20x-regulator.c:1028:12: error: use of undeclared identifier 'AXP1530_DCDC3_CONRTOL' 0x58, AXP1530_DCDC3_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, ^ drivers/regulator/axp20x-regulator.c:1028:41: error: use of undeclared identifier 'AXP1530_OUTPUT_CONTROL' 0x58, AXP1530_DCDC3_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, ^ >> drivers/regulator/axp20x-regulator.c:1030:2: error: use of undeclared identifier 'AXP1530_LDO1' AXP_DESC(AXP1530, LDO1, "ldo1", "ldo1in", 500, 3500, 100, ^ drivers/regulator/axp20x-regulator.c:303:10: note: expanded from macro 'AXP_DESC' .id = _family##_##_id, \ ^ <scratch space>:68:1: note: expanded from here AXP1530_LDO1 ^ >> drivers/regulator/axp20x-regulator.c:1031:6: error: use of undeclared identifier 'AXP1530_ALDO1_CONRTOL' AXP1530_ALDO1_CONRTOL, 0x1f, AXP1530_OUTPUT_CONTROL, ^ drivers/regulator/axp20x-regulator.c:1031:35: error: use of undeclared identifier 'AXP1530_OUTPUT_CONTROL' AXP1530_ALDO1_CONRTOL, 0x1f, AXP1530_OUTPUT_CONTROL, ^ >> drivers/regulator/axp20x-regulator.c:1033:2: error: use of undeclared identifier 'AXP1530_LDO2' AXP_DESC(AXP1530, LDO2, "ldo2", "ldo2in", 500, 3500, 100, ^ drivers/regulator/axp20x-regulator.c:303:10: note: expanded from macro 'AXP_DESC' .id = _family##_##_id, \ ^ <scratch space>:73:1: note: expanded from here AXP1530_LDO2 ^ >> drivers/regulator/axp20x-regulator.c:1034:6: error: use of undeclared identifier 'AXP1530_DLDO1_CONRTOL' AXP1530_DLDO1_CONRTOL, 0x1f, AXP1530_OUTPUT_CONTROL, ^ drivers/regulator/axp20x-regulator.c:1034:35: error: use of undeclared identifier 'AXP1530_OUTPUT_CONTROL' AXP1530_DLDO1_CONRTOL, 0x1f, AXP1530_OUTPUT_CONTROL, ^ >> drivers/regulator/axp20x-regulator.c:1077:7: error: use of undeclared identifier 'AXP1530_ID'; did you mean 'AXP152_ID'? case AXP1530_ID: ^~~~~~~~~~ AXP152_ID include/linux/mfd/axp20x.h:14:2: note: 'AXP152_ID' declared here AXP152_ID = 0, ^ drivers/regulator/axp20x-regulator.c:1295:8: error: use of undeclared identifier 'AXP1530_ID'; did you mean 'AXP152_ID'? case AXP1530_ID: ^~~~~~~~~~ AXP152_ID include/linux/mfd/axp20x.h:14:2: note: 'AXP152_ID' declared here AXP152_ID = 0, ^ >> drivers/regulator/axp20x-regulator.c:1297:17: error: use of undeclared identifier 'AXP1530_REG_ID_MAX' nregulators = AXP1530_REG_ID_MAX; ^ >> drivers/regulator/axp20x-regulator.c:1021:2: error: use of undeclared identifier 'AXP1530_DCDC1' AXP_DESC_RANGES(AXP1530, DCDC1, "dcdc1", "vin1", axp1530_dcdc1_ranges, ^ drivers/regulator/axp20x-regulator.c:345:3: note: expanded from macro 'AXP_DESC_RANGES' [_family##_##_id] = { \ ^ <scratch space>:51:1: note: expanded from here AXP1530_DCDC1 ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. vim +/AXP1530_DCDC1 +1021 drivers/regulator/axp20x-regulator.c 1019 1020 static const struct regulator_desc axp1530_regulators[] = { > 1021 AXP_DESC_RANGES(AXP1530, DCDC1, "dcdc1", "vin1", axp1530_dcdc1_ranges, > 1022 0x6B, AXP1530_DCDC1_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, 1023 BIT(0)), > 1024 AXP_DESC_RANGES(AXP1530, DCDC2, "dcdc2", "vin2", axp1530_dcdc2_ranges, > 1025 0x58, AXP1530_DCDC2_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, 1026 BIT(1)), > 1027 AXP_DESC_RANGES(AXP1530, DCDC3, "dcdc3", "vin3", axp1530_dcdc3_ranges, > 1028 0x58, AXP1530_DCDC3_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, 1029 BIT(2)), > 1030 AXP_DESC(AXP1530, LDO1, "ldo1", "ldo1in", 500, 3500, 100, > 1031 AXP1530_ALDO1_CONRTOL, 0x1f, AXP1530_OUTPUT_CONTROL, 1032 BIT(3)), > 1033 AXP_DESC(AXP1530, LDO2, "ldo2", "ldo2in", 500, 3500, 100, > 1034 AXP1530_DLDO1_CONRTOL, 0x1f, AXP1530_OUTPUT_CONTROL, 1035 BIT(4)), 1036 }; 1037 1038 static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq) 1039 { 1040 struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); 1041 unsigned int reg = AXP20X_DCDC_FREQ; 1042 u32 min, max, def, step; 1043 1044 switch (axp20x->variant) { 1045 case AXP202_ID: 1046 case AXP209_ID: 1047 min = 750; 1048 max = 1875; 1049 def = 1500; 1050 step = 75; 1051 break; 1052 case AXP803_ID: 1053 case AXP813_ID: 1054 /* 1055 * AXP803/AXP813 DCDC work frequency setting has the same 1056 * range and step as AXP22X, but at a different register. 1057 * (See include/linux/mfd/axp20x.h) 1058 */ 1059 reg = AXP803_DCDC_FREQ_CTRL; 1060 fallthrough; /* to the check below */ 1061 case AXP806_ID: 1062 /* 1063 * AXP806 also have DCDC work frequency setting register at a 1064 * different position. 1065 */ 1066 if (axp20x->variant == AXP806_ID) 1067 reg = AXP806_DCDC_FREQ_CTRL; 1068 fallthrough; 1069 case AXP221_ID: 1070 case AXP223_ID: 1071 case AXP809_ID: 1072 min = 1800; 1073 max = 4050; 1074 def = 3000; 1075 step = 150; 1076 break; > 1077 case AXP1530_ID: 1078 /* 1079 * Do not set the DCDC frequency on AXP1530 1080 */ 1081 return 0; 1082 break; 1083 default: 1084 dev_err(&pdev->dev, 1085 "Setting DCDC frequency for unsupported AXP variant\n"); 1086 return -EINVAL; 1087 } 1088 1089 if (dcdcfreq == 0) 1090 dcdcfreq = def; 1091 1092 if (dcdcfreq < min) { 1093 dcdcfreq = min; 1094 dev_warn(&pdev->dev, "DCDC frequency too low. Set to %ukHz\n", 1095 min); 1096 } 1097 1098 if (dcdcfreq > max) { 1099 dcdcfreq = max; 1100 dev_warn(&pdev->dev, "DCDC frequency too high. Set to %ukHz\n", 1101 max); 1102 } 1103 1104 dcdcfreq = (dcdcfreq - min) / step; 1105 1106 return regmap_update_bits(axp20x->regmap, reg, 1107 AXP20X_FREQ_DCDC_MASK, dcdcfreq); 1108 } 1109
Patch depends on the MFD driver which introduces also the regulator definitions. On Tue, Nov 15 2022 at 06:52:24 AM +08:00:00, kernel test robot <lkp@intel.com> wrote: > Hi Martin, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on broonie-regulator/for-next] > [also build test ERROR on linus/master v6.1-rc5 next-20221114] > [If your patch is applied to the wrong git tree, kindly drop us a > note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > url: > https://github.com/intel-lab-lkp/linux/commits/Martin-Botka/regulator-axp20x-Add-support-for-AXP1530-variant/20221115-002644 > base: > https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git > for-next > patch link: > https://lore.kernel.org/r/20221114162459.1802174-1-martin.botka%40somainline.org > patch subject: [PATCH 1/1] regulator: axp20x: Add support for AXP1530 > variant > config: x86_64-randconfig-k001-20221114 > compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project > f28c006a5895fc0e329fe15fead81e37457cb1d1) > reproduce (this is a W=1 build): > wget > https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross > -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # > https://github.com/intel-lab-lkp/linux/commit/7f0eb274b33943549c38a0eb160748d3754ad1e7 > git remote add linux-review > https://github.com/intel-lab-lkp/linux > git fetch --no-tags linux-review > Martin-Botka/regulator-axp20x-Add-support-for-AXP1530-variant/20221115-002644 > git checkout 7f0eb274b33943549c38a0eb160748d3754ad1e7 > # save the config file > mkdir build_dir && cp config build_dir/.config > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross > W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/regulator/ > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot <lkp@intel.com> > > All errors (new ones prefixed by >>): > >>> drivers/regulator/axp20x-regulator.c:1021:2: error: use of >>> undeclared identifier 'AXP1530_DCDC1' > AXP_DESC_RANGES(AXP1530, DCDC1, "dcdc1", "vin1", > axp1530_dcdc1_ranges, > ^ > drivers/regulator/axp20x-regulator.c:351:10: note: expanded from > macro 'AXP_DESC_RANGES' > .id = _family##_##_id, > \ > ^ > <scratch space>:53:1: note: expanded from here > AXP1530_DCDC1 > ^ >>> drivers/regulator/axp20x-regulator.c:1022:12: error: use of >>> undeclared identifier 'AXP1530_DCDC1_CONRTOL' > 0x6B, > AXP1530_DCDC1_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, > ^ >>> drivers/regulator/axp20x-regulator.c:1022:41: error: use of >>> undeclared identifier 'AXP1530_OUTPUT_CONTROL' > 0x6B, > AXP1530_DCDC1_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, > > ^ >>> drivers/regulator/axp20x-regulator.c:1024:2: error: use of >>> undeclared identifier 'AXP1530_DCDC2' > AXP_DESC_RANGES(AXP1530, DCDC2, "dcdc2", "vin2", > axp1530_dcdc2_ranges, > ^ > drivers/regulator/axp20x-regulator.c:351:10: note: expanded from > macro 'AXP_DESC_RANGES' > .id = _family##_##_id, > \ > ^ > <scratch space>:58:1: note: expanded from here > AXP1530_DCDC2 > ^ >>> drivers/regulator/axp20x-regulator.c:1025:12: error: use of >>> undeclared identifier 'AXP1530_DCDC2_CONRTOL' > 0x58, > AXP1530_DCDC2_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, > ^ > drivers/regulator/axp20x-regulator.c:1025:41: error: use of > undeclared identifier 'AXP1530_OUTPUT_CONTROL' > 0x58, > AXP1530_DCDC2_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, > > ^ >>> drivers/regulator/axp20x-regulator.c:1027:2: error: use of >>> undeclared identifier 'AXP1530_DCDC3' > AXP_DESC_RANGES(AXP1530, DCDC3, "dcdc3", "vin3", > axp1530_dcdc3_ranges, > ^ > drivers/regulator/axp20x-regulator.c:351:10: note: expanded from > macro 'AXP_DESC_RANGES' > .id = _family##_##_id, > \ > ^ > <scratch space>:63:1: note: expanded from here > AXP1530_DCDC3 > ^ >>> drivers/regulator/axp20x-regulator.c:1028:12: error: use of >>> undeclared identifier 'AXP1530_DCDC3_CONRTOL' > 0x58, > AXP1530_DCDC3_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, > ^ > drivers/regulator/axp20x-regulator.c:1028:41: error: use of > undeclared identifier 'AXP1530_OUTPUT_CONTROL' > 0x58, > AXP1530_DCDC3_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, > > ^ >>> drivers/regulator/axp20x-regulator.c:1030:2: error: use of >>> undeclared identifier 'AXP1530_LDO1' > AXP_DESC(AXP1530, LDO1, "ldo1", "ldo1in", 500, 3500, 100, > ^ > drivers/regulator/axp20x-regulator.c:303:10: note: expanded from > macro 'AXP_DESC' > .id = _family##_##_id, > \ > ^ > <scratch space>:68:1: note: expanded from here > AXP1530_LDO1 > ^ >>> drivers/regulator/axp20x-regulator.c:1031:6: error: use of >>> undeclared identifier 'AXP1530_ALDO1_CONRTOL' > AXP1530_ALDO1_CONRTOL, > 0x1f, AXP1530_OUTPUT_CONTROL, > ^ > drivers/regulator/axp20x-regulator.c:1031:35: error: use of > undeclared identifier 'AXP1530_OUTPUT_CONTROL' > AXP1530_ALDO1_CONRTOL, > 0x1f, AXP1530_OUTPUT_CONTROL, > > ^ >>> drivers/regulator/axp20x-regulator.c:1033:2: error: use of >>> undeclared identifier 'AXP1530_LDO2' > AXP_DESC(AXP1530, LDO2, "ldo2", "ldo2in", 500, 3500, 100, > ^ > drivers/regulator/axp20x-regulator.c:303:10: note: expanded from > macro 'AXP_DESC' > .id = _family##_##_id, > \ > ^ > <scratch space>:73:1: note: expanded from here > AXP1530_LDO2 > ^ >>> drivers/regulator/axp20x-regulator.c:1034:6: error: use of >>> undeclared identifier 'AXP1530_DLDO1_CONRTOL' > AXP1530_DLDO1_CONRTOL, > 0x1f, AXP1530_OUTPUT_CONTROL, > ^ > drivers/regulator/axp20x-regulator.c:1034:35: error: use of > undeclared identifier 'AXP1530_OUTPUT_CONTROL' > AXP1530_DLDO1_CONRTOL, > 0x1f, AXP1530_OUTPUT_CONTROL, > > ^ >>> drivers/regulator/axp20x-regulator.c:1077:7: error: use of >>> undeclared identifier 'AXP1530_ID'; did you mean 'AXP152_ID'? > case AXP1530_ID: > ^~~~~~~~~~ > AXP152_ID > include/linux/mfd/axp20x.h:14:2: note: 'AXP152_ID' declared here > AXP152_ID = 0, > ^ > drivers/regulator/axp20x-regulator.c:1295:8: error: use of > undeclared identifier 'AXP1530_ID'; did you mean 'AXP152_ID'? > case AXP1530_ID: > ^~~~~~~~~~ > AXP152_ID > include/linux/mfd/axp20x.h:14:2: note: 'AXP152_ID' declared here > AXP152_ID = 0, > ^ >>> drivers/regulator/axp20x-regulator.c:1297:17: error: use of >>> undeclared identifier 'AXP1530_REG_ID_MAX' > nregulators = AXP1530_REG_ID_MAX; > ^ >>> drivers/regulator/axp20x-regulator.c:1021:2: error: use of >>> undeclared identifier 'AXP1530_DCDC1' > AXP_DESC_RANGES(AXP1530, DCDC1, "dcdc1", "vin1", > axp1530_dcdc1_ranges, > ^ > drivers/regulator/axp20x-regulator.c:345:3: note: expanded from > macro 'AXP_DESC_RANGES' > [_family##_##_id] = { > \ > ^ > <scratch space>:51:1: note: expanded from here > AXP1530_DCDC1 > ^ > fatal error: too many errors emitted, stopping now [-ferror-limit=] > 20 errors generated. > > > vim +/AXP1530_DCDC1 +1021 drivers/regulator/axp20x-regulator.c > > 1019 > 1020 static const struct regulator_desc axp1530_regulators[] = { >> 1021 AXP_DESC_RANGES(AXP1530, DCDC1, "dcdc1", "vin1", >> axp1530_dcdc1_ranges, >> 1022 0x6B, AXP1530_DCDC1_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, > 1023 BIT(0)), >> 1024 AXP_DESC_RANGES(AXP1530, DCDC2, "dcdc2", "vin2", >> axp1530_dcdc2_ranges, >> 1025 0x58, AXP1530_DCDC2_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, > 1026 BIT(1)), >> 1027 AXP_DESC_RANGES(AXP1530, DCDC3, "dcdc3", "vin3", >> axp1530_dcdc3_ranges, >> 1028 0x58, AXP1530_DCDC3_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, > 1029 BIT(2)), >> 1030 AXP_DESC(AXP1530, LDO1, "ldo1", "ldo1in", 500, 3500, 100, >> 1031 AXP1530_ALDO1_CONRTOL, 0x1f, AXP1530_OUTPUT_CONTROL, > 1032 BIT(3)), >> 1033 AXP_DESC(AXP1530, LDO2, "ldo2", "ldo2in", 500, 3500, 100, >> 1034 AXP1530_DLDO1_CONRTOL, 0x1f, AXP1530_OUTPUT_CONTROL, > 1035 BIT(4)), > 1036 }; > 1037 > 1038 static int axp20x_set_dcdc_freq(struct platform_device *pdev, > u32 dcdcfreq) > 1039 { > 1040 struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); > 1041 unsigned int reg = AXP20X_DCDC_FREQ; > 1042 u32 min, max, def, step; > 1043 > 1044 switch (axp20x->variant) { > 1045 case AXP202_ID: > 1046 case AXP209_ID: > 1047 min = 750; > 1048 max = 1875; > 1049 def = 1500; > 1050 step = 75; > 1051 break; > 1052 case AXP803_ID: > 1053 case AXP813_ID: > 1054 /* > 1055 * AXP803/AXP813 DCDC work frequency setting has the same > 1056 * range and step as AXP22X, but at a different register. > 1057 * (See include/linux/mfd/axp20x.h) > 1058 */ > 1059 reg = AXP803_DCDC_FREQ_CTRL; > 1060 fallthrough; /* to the check below */ > 1061 case AXP806_ID: > 1062 /* > 1063 * AXP806 also have DCDC work frequency setting register at a > 1064 * different position. > 1065 */ > 1066 if (axp20x->variant == AXP806_ID) > 1067 reg = AXP806_DCDC_FREQ_CTRL; > 1068 fallthrough; > 1069 case AXP221_ID: > 1070 case AXP223_ID: > 1071 case AXP809_ID: > 1072 min = 1800; > 1073 max = 4050; > 1074 def = 3000; > 1075 step = 150; > 1076 break; >> 1077 case AXP1530_ID: > 1078 /* > 1079 * Do not set the DCDC frequency on AXP1530 > 1080 */ > 1081 return 0; > 1082 break; > 1083 default: > 1084 dev_err(&pdev->dev, > 1085 "Setting DCDC frequency for unsupported AXP variant\n"); > 1086 return -EINVAL; > 1087 } > 1088 > 1089 if (dcdcfreq == 0) > 1090 dcdcfreq = def; > 1091 > 1092 if (dcdcfreq < min) { > 1093 dcdcfreq = min; > 1094 dev_warn(&pdev->dev, "DCDC frequency too low. Set to > %ukHz\n", > 1095 min); > 1096 } > 1097 > 1098 if (dcdcfreq > max) { > 1099 dcdcfreq = max; > 1100 dev_warn(&pdev->dev, "DCDC frequency too high. Set to > %ukHz\n", > 1101 max); > 1102 } > 1103 > 1104 dcdcfreq = (dcdcfreq - min) / step; > 1105 > 1106 return regmap_update_bits(axp20x->regmap, reg, > 1107 AXP20X_FREQ_DCDC_MASK, dcdcfreq); > 1108 } > 1109 > > -- > 0-DAY CI Kernel Test Service > https://01.org/lkp
Hi Martin, Thank you for the patch! Yet something to improve: [auto build test ERROR on broonie-regulator/for-next] [also build test ERROR on linus/master v6.1-rc5 next-20221114] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Martin-Botka/regulator-axp20x-Add-support-for-AXP1530-variant/20221115-002644 base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next patch link: https://lore.kernel.org/r/20221114162459.1802174-1-martin.botka%40somainline.org patch subject: [PATCH 1/1] regulator: axp20x: Add support for AXP1530 variant config: arc-randconfig-r043-20221114 compiler: arceb-elf-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/7f0eb274b33943549c38a0eb160748d3754ad1e7 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Martin-Botka/regulator-axp20x-Add-support-for-AXP1530-variant/20221115-002644 git checkout 7f0eb274b33943549c38a0eb160748d3754ad1e7 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arc SHELL=/bin/bash drivers/regulator/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): >> drivers/regulator/axp20x-regulator.c:1021:25: error: 'AXP1530_DCDC1' undeclared here (not in a function); did you mean 'AXP813_DCDC1'? 1021 | AXP_DESC_RANGES(AXP1530, DCDC1, "dcdc1", "vin1", axp1530_dcdc1_ranges, | ^~~~~~~ drivers/regulator/axp20x-regulator.c:345:10: note: in definition of macro 'AXP_DESC_RANGES' 345 | [_family##_##_id] = { \ | ^~~~~~~ >> drivers/regulator/axp20x-regulator.c:1021:25: error: array index in initializer not of integer type 1021 | AXP_DESC_RANGES(AXP1530, DCDC1, "dcdc1", "vin1", axp1530_dcdc1_ranges, | ^~~~~~~ drivers/regulator/axp20x-regulator.c:345:10: note: in definition of macro 'AXP_DESC_RANGES' 345 | [_family##_##_id] = { \ | ^~~~~~~ drivers/regulator/axp20x-regulator.c:1021:25: note: (near initialization for 'axp1530_regulators') 1021 | AXP_DESC_RANGES(AXP1530, DCDC1, "dcdc1", "vin1", axp1530_dcdc1_ranges, | ^~~~~~~ drivers/regulator/axp20x-regulator.c:345:10: note: in definition of macro 'AXP_DESC_RANGES' 345 | [_family##_##_id] = { \ | ^~~~~~~ >> drivers/regulator/axp20x-regulator.c:1022:47: error: 'AXP1530_DCDC1_CONRTOL' undeclared here (not in a function) 1022 | 0x6B, AXP1530_DCDC1_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, | ^~~~~~~~~~~~~~~~~~~~~ drivers/regulator/axp20x-regulator.c:354:36: note: in definition of macro 'AXP_DESC_RANGES' 354 | .vsel_reg = (_vreg), \ | ^~~~~ >> drivers/regulator/axp20x-regulator.c:1022:76: error: 'AXP1530_OUTPUT_CONTROL' undeclared here (not in a function) 1022 | 0x6B, AXP1530_DCDC1_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, | ^~~~~~~~~~~~~~~~~~~~~~ drivers/regulator/axp20x-regulator.c:356:36: note: in definition of macro 'AXP_DESC_RANGES' 356 | .enable_reg = (_ereg), \ | ^~~~~ >> drivers/regulator/axp20x-regulator.c:1024:25: error: 'AXP1530_DCDC2' undeclared here (not in a function); did you mean 'AXP813_DCDC2'? 1024 | AXP_DESC_RANGES(AXP1530, DCDC2, "dcdc2", "vin2", axp1530_dcdc2_ranges, | ^~~~~~~ drivers/regulator/axp20x-regulator.c:345:10: note: in definition of macro 'AXP_DESC_RANGES' 345 | [_family##_##_id] = { \ | ^~~~~~~ drivers/regulator/axp20x-regulator.c:1024:25: error: array index in initializer not of integer type 1024 | AXP_DESC_RANGES(AXP1530, DCDC2, "dcdc2", "vin2", axp1530_dcdc2_ranges, | ^~~~~~~ drivers/regulator/axp20x-regulator.c:345:10: note: in definition of macro 'AXP_DESC_RANGES' 345 | [_family##_##_id] = { \ | ^~~~~~~ drivers/regulator/axp20x-regulator.c:1024:25: note: (near initialization for 'axp1530_regulators') 1024 | AXP_DESC_RANGES(AXP1530, DCDC2, "dcdc2", "vin2", axp1530_dcdc2_ranges, | ^~~~~~~ drivers/regulator/axp20x-regulator.c:345:10: note: in definition of macro 'AXP_DESC_RANGES' 345 | [_family##_##_id] = { \ | ^~~~~~~ >> drivers/regulator/axp20x-regulator.c:1025:47: error: 'AXP1530_DCDC2_CONRTOL' undeclared here (not in a function) 1025 | 0x58, AXP1530_DCDC2_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, | ^~~~~~~~~~~~~~~~~~~~~ drivers/regulator/axp20x-regulator.c:354:36: note: in definition of macro 'AXP_DESC_RANGES' 354 | .vsel_reg = (_vreg), \ | ^~~~~ >> drivers/regulator/axp20x-regulator.c:1027:25: error: 'AXP1530_DCDC3' undeclared here (not in a function); did you mean 'AXP813_DCDC3'? 1027 | AXP_DESC_RANGES(AXP1530, DCDC3, "dcdc3", "vin3", axp1530_dcdc3_ranges, | ^~~~~~~ drivers/regulator/axp20x-regulator.c:345:10: note: in definition of macro 'AXP_DESC_RANGES' 345 | [_family##_##_id] = { \ | ^~~~~~~ drivers/regulator/axp20x-regulator.c:1027:25: error: array index in initializer not of integer type 1027 | AXP_DESC_RANGES(AXP1530, DCDC3, "dcdc3", "vin3", axp1530_dcdc3_ranges, | ^~~~~~~ drivers/regulator/axp20x-regulator.c:345:10: note: in definition of macro 'AXP_DESC_RANGES' 345 | [_family##_##_id] = { \ | ^~~~~~~ drivers/regulator/axp20x-regulator.c:1027:25: note: (near initialization for 'axp1530_regulators') 1027 | AXP_DESC_RANGES(AXP1530, DCDC3, "dcdc3", "vin3", axp1530_dcdc3_ranges, | ^~~~~~~ drivers/regulator/axp20x-regulator.c:345:10: note: in definition of macro 'AXP_DESC_RANGES' 345 | [_family##_##_id] = { \ | ^~~~~~~ >> drivers/regulator/axp20x-regulator.c:1028:47: error: 'AXP1530_DCDC3_CONRTOL' undeclared here (not in a function) 1028 | 0x58, AXP1530_DCDC3_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, | ^~~~~~~~~~~~~~~~~~~~~ drivers/regulator/axp20x-regulator.c:354:36: note: in definition of macro 'AXP_DESC_RANGES' 354 | .vsel_reg = (_vreg), \ | ^~~~~ >> drivers/regulator/axp20x-regulator.c:1030:18: error: 'AXP1530_LDO1' undeclared here (not in a function); did you mean 'AXP813_FLDO1'? 1030 | AXP_DESC(AXP1530, LDO1, "ldo1", "ldo1in", 500, 3500, 100, | ^~~~~~~ drivers/regulator/axp20x-regulator.c:297:10: note: in definition of macro 'AXP_DESC' 297 | [_family##_##_id] = { \ | ^~~~~~~ drivers/regulator/axp20x-regulator.c:1030:18: error: array index in initializer not of integer type 1030 | AXP_DESC(AXP1530, LDO1, "ldo1", "ldo1in", 500, 3500, 100, | ^~~~~~~ drivers/regulator/axp20x-regulator.c:297:10: note: in definition of macro 'AXP_DESC' 297 | [_family##_##_id] = { \ | ^~~~~~~ drivers/regulator/axp20x-regulator.c:1030:18: note: (near initialization for 'axp1530_regulators') 1030 | AXP_DESC(AXP1530, LDO1, "ldo1", "ldo1in", 500, 3500, 100, | ^~~~~~~ drivers/regulator/axp20x-regulator.c:297:10: note: in definition of macro 'AXP_DESC' 297 | [_family##_##_id] = { \ | ^~~~~~~ >> drivers/regulator/axp20x-regulator.c:1031:41: error: 'AXP1530_ALDO1_CONRTOL' undeclared here (not in a function) 1031 | AXP1530_ALDO1_CONRTOL, 0x1f, AXP1530_OUTPUT_CONTROL, | ^~~~~~~~~~~~~~~~~~~~~ drivers/regulator/axp20x-regulator.c:308:36: note: in definition of macro 'AXP_DESC' 308 | .vsel_reg = (_vreg), \ | ^~~~~ >> drivers/regulator/axp20x-regulator.c:1033:18: error: 'AXP1530_LDO2' undeclared here (not in a function); did you mean 'AXP813_FLDO2'? 1033 | AXP_DESC(AXP1530, LDO2, "ldo2", "ldo2in", 500, 3500, 100, | ^~~~~~~ drivers/regulator/axp20x-regulator.c:297:10: note: in definition of macro 'AXP_DESC' 297 | [_family##_##_id] = { \ | ^~~~~~~ drivers/regulator/axp20x-regulator.c:1033:18: error: array index in initializer not of integer type 1033 | AXP_DESC(AXP1530, LDO2, "ldo2", "ldo2in", 500, 3500, 100, | ^~~~~~~ drivers/regulator/axp20x-regulator.c:297:10: note: in definition of macro 'AXP_DESC' 297 | [_family##_##_id] = { \ | ^~~~~~~ drivers/regulator/axp20x-regulator.c:1033:18: note: (near initialization for 'axp1530_regulators') 1033 | AXP_DESC(AXP1530, LDO2, "ldo2", "ldo2in", 500, 3500, 100, | ^~~~~~~ drivers/regulator/axp20x-regulator.c:297:10: note: in definition of macro 'AXP_DESC' 297 | [_family##_##_id] = { \ | ^~~~~~~ >> drivers/regulator/axp20x-regulator.c:1034:41: error: 'AXP1530_DLDO1_CONRTOL' undeclared here (not in a function) 1034 | AXP1530_DLDO1_CONRTOL, 0x1f, AXP1530_OUTPUT_CONTROL, | ^~~~~~~~~~~~~~~~~~~~~ drivers/regulator/axp20x-regulator.c:308:36: note: in definition of macro 'AXP_DESC' 308 | .vsel_reg = (_vreg), \ | ^~~~~ drivers/regulator/axp20x-regulator.c: In function 'axp20x_set_dcdc_freq': >> drivers/regulator/axp20x-regulator.c:1077:14: error: 'AXP1530_ID' undeclared (first use in this function); did you mean 'AXP152_ID'? 1077 | case AXP1530_ID: | ^~~~~~~~~~ | AXP152_ID drivers/regulator/axp20x-regulator.c:1077:14: note: each undeclared identifier is reported only once for each function it appears in drivers/regulator/axp20x-regulator.c: In function 'axp20x_regulator_probe': drivers/regulator/axp20x-regulator.c:1295:22: error: 'AXP1530_ID' undeclared (first use in this function); did you mean 'AXP152_ID'? 1295 | case AXP1530_ID: | ^~~~~~~~~~ | AXP152_ID >> drivers/regulator/axp20x-regulator.c:1297:31: error: 'AXP1530_REG_ID_MAX' undeclared (first use in this function); did you mean 'AXP813_REG_ID_MAX'? 1297 | nregulators = AXP1530_REG_ID_MAX; | ^~~~~~~~~~~~~~~~~~ | AXP813_REG_ID_MAX vim +1021 drivers/regulator/axp20x-regulator.c 1019 1020 static const struct regulator_desc axp1530_regulators[] = { > 1021 AXP_DESC_RANGES(AXP1530, DCDC1, "dcdc1", "vin1", axp1530_dcdc1_ranges, > 1022 0x6B, AXP1530_DCDC1_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, 1023 BIT(0)), > 1024 AXP_DESC_RANGES(AXP1530, DCDC2, "dcdc2", "vin2", axp1530_dcdc2_ranges, > 1025 0x58, AXP1530_DCDC2_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, 1026 BIT(1)), > 1027 AXP_DESC_RANGES(AXP1530, DCDC3, "dcdc3", "vin3", axp1530_dcdc3_ranges, > 1028 0x58, AXP1530_DCDC3_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, 1029 BIT(2)), > 1030 AXP_DESC(AXP1530, LDO1, "ldo1", "ldo1in", 500, 3500, 100, > 1031 AXP1530_ALDO1_CONRTOL, 0x1f, AXP1530_OUTPUT_CONTROL, 1032 BIT(3)), > 1033 AXP_DESC(AXP1530, LDO2, "ldo2", "ldo2in", 500, 3500, 100, > 1034 AXP1530_DLDO1_CONRTOL, 0x1f, AXP1530_OUTPUT_CONTROL, 1035 BIT(4)), 1036 }; 1037 1038 static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq) 1039 { 1040 struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); 1041 unsigned int reg = AXP20X_DCDC_FREQ; 1042 u32 min, max, def, step; 1043 1044 switch (axp20x->variant) { 1045 case AXP202_ID: 1046 case AXP209_ID: 1047 min = 750; 1048 max = 1875; 1049 def = 1500; 1050 step = 75; 1051 break; 1052 case AXP803_ID: 1053 case AXP813_ID: 1054 /* 1055 * AXP803/AXP813 DCDC work frequency setting has the same 1056 * range and step as AXP22X, but at a different register. 1057 * (See include/linux/mfd/axp20x.h) 1058 */ 1059 reg = AXP803_DCDC_FREQ_CTRL; 1060 fallthrough; /* to the check below */ 1061 case AXP806_ID: 1062 /* 1063 * AXP806 also have DCDC work frequency setting register at a 1064 * different position. 1065 */ 1066 if (axp20x->variant == AXP806_ID) 1067 reg = AXP806_DCDC_FREQ_CTRL; 1068 fallthrough; 1069 case AXP221_ID: 1070 case AXP223_ID: 1071 case AXP809_ID: 1072 min = 1800; 1073 max = 4050; 1074 def = 3000; 1075 step = 150; 1076 break; > 1077 case AXP1530_ID: 1078 /* 1079 * Do not set the DCDC frequency on AXP1530 1080 */ 1081 return 0; 1082 break; 1083 default: 1084 dev_err(&pdev->dev, 1085 "Setting DCDC frequency for unsupported AXP variant\n"); 1086 return -EINVAL; 1087 } 1088 1089 if (dcdcfreq == 0) 1090 dcdcfreq = def; 1091 1092 if (dcdcfreq < min) { 1093 dcdcfreq = min; 1094 dev_warn(&pdev->dev, "DCDC frequency too low. Set to %ukHz\n", 1095 min); 1096 } 1097 1098 if (dcdcfreq > max) { 1099 dcdcfreq = max; 1100 dev_warn(&pdev->dev, "DCDC frequency too high. Set to %ukHz\n", 1101 max); 1102 } 1103 1104 dcdcfreq = (dcdcfreq - min) / step; 1105 1106 return regmap_update_bits(axp20x->regmap, reg, 1107 AXP20X_FREQ_DCDC_MASK, dcdcfreq); 1108 } 1109
Hi Martin, On 11/14/22 16:56, Martin Botka wrote: > Patch depends on the MFD driver which introduces also the regulator > definitions. Then you need to either send them together as a series, or wait until the MFD portion lands in linux-next. Regards, Samuel
On November 15, 2022 8:02:00 AM GMT+01:00, Samuel Holland <samuel@sholland.org> wrote: >Hi Martin, > >On 11/14/22 16:56, Martin Botka wrote: >> Patch depends on the MFD driver which introduces also the regulator >> definitions. > >Then you need to either send them together as a series, or wait until >the MFD portion lands in linux-next. > >Regards, >Samuel > Will do. Regards, Martin
diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c index d260c442b788..ca422311a996 100644 --- a/drivers/regulator/axp20x-regulator.c +++ b/drivers/regulator/axp20x-regulator.c @@ -1001,6 +1001,40 @@ static const struct regulator_desc axp813_regulators[] = { AXP22X_PWR_OUT_CTRL2, AXP22X_PWR_OUT_DC1SW_MASK), }; +static const struct linear_range axp1530_dcdc1_ranges[] = { + REGULATOR_LINEAR_RANGE(500000, 0x0, 0x46, 10000), + REGULATOR_LINEAR_RANGE(1220000, 0x47, 0x57, 20000), + REGULATOR_LINEAR_RANGE(1600000, 0x58, 0x6A, 100000), +}; + +static const struct linear_range axp1530_dcdc2_ranges[] = { + REGULATOR_LINEAR_RANGE(500000, 0x0, 0x46, 10000), + REGULATOR_LINEAR_RANGE(1220000, 0x47, 0x57, 20000), +}; + +static const struct linear_range axp1530_dcdc3_ranges[] = { + REGULATOR_LINEAR_RANGE(500000, 0x0, 0x46, 10000), + REGULATOR_LINEAR_RANGE(1220000, 0x47, 0x66, 20000), +}; + +static const struct regulator_desc axp1530_regulators[] = { + AXP_DESC_RANGES(AXP1530, DCDC1, "dcdc1", "vin1", axp1530_dcdc1_ranges, + 0x6B, AXP1530_DCDC1_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, + BIT(0)), + AXP_DESC_RANGES(AXP1530, DCDC2, "dcdc2", "vin2", axp1530_dcdc2_ranges, + 0x58, AXP1530_DCDC2_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, + BIT(1)), + AXP_DESC_RANGES(AXP1530, DCDC3, "dcdc3", "vin3", axp1530_dcdc3_ranges, + 0x58, AXP1530_DCDC3_CONRTOL, 0x7f, AXP1530_OUTPUT_CONTROL, + BIT(2)), + AXP_DESC(AXP1530, LDO1, "ldo1", "ldo1in", 500, 3500, 100, + AXP1530_ALDO1_CONRTOL, 0x1f, AXP1530_OUTPUT_CONTROL, + BIT(3)), + AXP_DESC(AXP1530, LDO2, "ldo2", "ldo2in", 500, 3500, 100, + AXP1530_DLDO1_CONRTOL, 0x1f, AXP1530_OUTPUT_CONTROL, + BIT(4)), +}; + static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq) { struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); @@ -1040,6 +1074,12 @@ static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq) def = 3000; step = 150; break; + case AXP1530_ID: + /* + * Do not set the DCDC frequency on AXP1530 + */ + return 0; + break; default: dev_err(&pdev->dev, "Setting DCDC frequency for unsupported AXP variant\n"); @@ -1252,6 +1292,10 @@ static int axp20x_regulator_probe(struct platform_device *pdev) drivevbus = of_property_read_bool(pdev->dev.parent->of_node, "x-powers,drive-vbus-en"); break; + case AXP1530_ID: + regulators = axp1530_regulators; + nregulators = AXP1530_REG_ID_MAX; + break; default: dev_err(&pdev->dev, "Unsupported AXP variant: %ld\n", axp20x->variant);