From: kernel test robot <lkp@intel.com>
To: AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
linux-mediatek@lists.infradead.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
lee@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, matthias.bgg@gmail.com,
angelogioacchino.delregno@collabora.com, lgirdwood@gmail.com,
broonie@kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, kernel@collabora.com,
wenst@chromium.org
Subject: Re: [PATCH v5 4/8] regulator: Add support for MediaTek MT6363 SPMI PMIC Regulators
Date: Wed, 16 Jul 2025 20:24:38 +0800 [thread overview]
Message-ID: <202507162012.qDNKtUiI-lkp@intel.com> (raw)
In-Reply-To: <20250715140224.206329-5-angelogioacchino.delregno@collabora.com>
Hi AngeloGioacchino,
kernel test robot noticed the following build errors:
[auto build test ERROR on broonie-regulator/for-next]
[also build test ERROR on lee-mfd/for-mfd-next lee-mfd/for-mfd-fixes lee-leds/for-leds-next linus/master v6.16-rc6 next-20250715]
[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/AngeloGioacchino-Del-Regno/dt-bindings-regulator-Document-MediaTek-MT6316-PMIC-Regulators/20250715-222516
base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
patch link: https://lore.kernel.org/r/20250715140224.206329-5-angelogioacchino.delregno%40collabora.com
patch subject: [PATCH v5 4/8] regulator: Add support for MediaTek MT6363 SPMI PMIC Regulators
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20250716/202507162012.qDNKtUiI-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250716/202507162012.qDNKtUiI-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507162012.qDNKtUiI-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/regulator/mt6363-regulator.c:519:9: error: call to undeclared function 'FIELD_PREP'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
519 | sel = FIELD_PREP(MT6363_RG_VEMC_VOSEL_1_MASK, sel);
| ^
>> drivers/regulator/mt6363-regulator.c:577:10: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
577 | vsel = FIELD_GET(MT6363_RG_VEMC_VOSEL_1_MASK, vosel);
| ^
2 errors generated.
vim +/FIELD_PREP +519 drivers/regulator/mt6363-regulator.c
481
482 static int mt6363_vemc_set_voltage_sel(struct regulator_dev *rdev, unsigned int sel)
483 {
484 const u16 tma_unlock_key = MT6363_TMA_UNLOCK_VALUE;
485 const struct regulator_desc *rdesc = rdev->desc;
486 struct regmap *regmap = rdev->regmap;
487 unsigned int range, val;
488 int i, ret;
489 u16 mask;
490
491 for (i = 0; i < rdesc->n_linear_ranges; i++) {
492 const struct linear_range *r = &rdesc->linear_ranges[i];
493 unsigned int voltages_in_range = linear_range_values_in_range(r);
494
495 if (sel < voltages_in_range)
496 break;
497 sel -= voltages_in_range;
498 }
499
500 if (i == rdesc->n_linear_ranges)
501 return -EINVAL;
502
503 ret = regmap_read(rdev->regmap, MT6363_TOP_TRAP, &val);
504 if (ret)
505 return ret;
506
507 if (val > 1)
508 return -EINVAL;
509
510 /* Unlock TMA for writing */
511 ret = regmap_bulk_write(rdev->regmap, MT6363_TOP_TMA_KEY_L,
512 &tma_unlock_key, sizeof(tma_unlock_key));
513 if (ret)
514 return ret;
515
516 /* If HW trapping value is 1, use VEMC_VOSEL_1 instead of VEMC_VOSEL_0 */
517 if (val == 1) {
518 mask = MT6363_RG_VEMC_VOSEL_1_MASK;
> 519 sel = FIELD_PREP(MT6363_RG_VEMC_VOSEL_1_MASK, sel);
520 } else {
521 mask = rdesc->vsel_mask;
522 }
523
524 sel <<= ffs(rdesc->vsel_mask) - 1;
525 sel += rdesc->linear_ranges[i].min_sel;
526
527 range = rdesc->linear_range_selectors_bitfield[i];
528 range <<= ffs(rdesc->vsel_range_mask) - 1;
529
530 /* Write to the vreg calibration register for voltage finetuning */
531 ret = regmap_update_bits(regmap, rdesc->vsel_range_reg,
532 rdesc->vsel_range_mask, range);
533 if (ret)
534 goto lock_tma;
535
536 /* Function must return the result of this write operation */
537 ret = regmap_update_bits(regmap, rdesc->vsel_reg, mask, sel);
538
539 lock_tma:
540 /* Unconditionally re-lock TMA */
541 val = 0;
542 regmap_bulk_write(rdev->regmap, MT6363_TOP_TMA_KEY_L, &val, 2);
543
544 return ret;
545 }
546
547 static int mt6363_vemc_get_voltage_sel(struct regulator_dev *rdev)
548 {
549 const struct regulator_desc *rdesc = rdev->desc;
550 unsigned int vosel, trap, calsel;
551 int vcal, vsel, range, ret;
552
553 ret = regmap_read(rdev->regmap, rdesc->vsel_reg, &vosel);
554 if (ret)
555 return ret;
556
557 ret = regmap_read(rdev->regmap, rdesc->vsel_range_reg, &calsel);
558 if (ret)
559 return ret;
560
561 calsel &= rdesc->vsel_range_mask;
562 for (range = 0; range < rdesc->n_linear_ranges; range++)
563 if (rdesc->linear_range_selectors_bitfield[range] != calsel)
564 break;
565
566 if (range == rdesc->n_linear_ranges)
567 return -EINVAL;
568
569 ret = regmap_read(rdev->regmap, MT6363_TOP_TRAP, &trap);
570 if (ret)
571 return ret;
572
573 /* If HW trapping value is 1, use VEMC_VOSEL_1 instead of VEMC_VOSEL_0 */
574 if (trap > 1)
575 return -EINVAL;
576 else if (trap == 1)
> 577 vsel = FIELD_GET(MT6363_RG_VEMC_VOSEL_1_MASK, vosel);
578 else
579 vsel = vosel & rdesc->vsel_mask;
580
581 vcal = linear_range_values_in_range_array(rdesc->linear_ranges, range);
582
583 return vsel + vcal;
584 }
585
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2025-07-16 12:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-15 14:02 [PATCH v5 0/8] Add support MT6316/6363/MT6373 PMICs regulators and MFD AngeloGioacchino Del Regno
2025-07-15 14:02 ` [PATCH v5 1/8] dt-bindings: regulator: Document MediaTek MT6316 PMIC Regulators AngeloGioacchino Del Regno
2025-07-22 4:58 ` Chen-Yu Tsai
2025-07-22 5:11 ` Chen-Yu Tsai
2025-07-15 14:02 ` [PATCH v5 2/8] regulator: Add support for MediaTek MT6316 SPMI " AngeloGioacchino Del Regno
2025-07-22 5:18 ` Chen-Yu Tsai
2025-07-15 14:02 ` [PATCH v5 3/8] dt-bindings: regulator: Document MediaTek MT6363 " AngeloGioacchino Del Regno
2025-07-15 15:41 ` Rob Herring (Arm)
2025-07-17 15:29 ` Rob Herring
2025-07-22 5:24 ` Chen-Yu Tsai
2025-07-15 14:02 ` [PATCH v5 4/8] regulator: Add support for MediaTek MT6363 SPMI " AngeloGioacchino Del Regno
2025-07-16 12:24 ` kernel test robot [this message]
2025-07-15 14:02 ` [PATCH v5 5/8] dt-bindings: regulator: Document MediaTek MT6373 " AngeloGioacchino Del Regno
2025-07-15 15:41 ` Rob Herring (Arm)
2025-07-15 14:02 ` [PATCH v5 6/8] regulator: Add support for MediaTek MT6373 SPMI " AngeloGioacchino Del Regno
2025-07-15 14:02 ` [PATCH v5 7/8] dt-bindings: mfd: Add binding for MediaTek MT6363 series SPMI PMIC AngeloGioacchino Del Regno
2025-07-15 15:41 ` Rob Herring (Arm)
2025-07-15 14:02 ` [PATCH v5 8/8] drivers: mfd: Add support for MediaTek SPMI PMICs and MT6363/73 AngeloGioacchino Del Regno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202507162012.qDNKtUiI-lkp@intel.com \
--to=lkp@intel.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=kernel@collabora.com \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=matthias.bgg@gmail.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=robh@kernel.org \
--cc=wenst@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®