devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Elder <elder@riscstar.com>
To: Vivian Wang <wangruikang@iscas.ac.cn>,
	lee@kernel.org, lgirdwood@gmail.com, broonie@kernel.org,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	dlan@gentoo.org
Cc: paul.walmsley@sifive.com, palmer@dabbelt.com,
	aou@eecs.berkeley.edu, alex@ghiti.fr, troymitchell988@gmail.com,
	guodong@riscstar.com, devicetree@vger.kernel.org,
	linux-riscv@lists.infradead.org, spacemit@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/6] regulator: spacemit: support SpacemiT P1 regulators
Date: Thu, 19 Jun 2025 08:23:51 -0500	[thread overview]
Message-ID: <6504c609-f8b5-42e3-88ad-5cbee30a52ed@riscstar.com> (raw)
In-Reply-To: <acac9522-fb19-4659-8e1a-544bf75f3864@iscas.ac.cn>

On 6/19/25 1:15 AM, Vivian Wang wrote:
> On 6/14/25 05:01, Alex Elder wrote:
>> <snip>
>>
>> diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
>> index 6d8988387da45..7bb7b8fad24f2 100644
>> --- a/drivers/regulator/Kconfig
>> +++ b/drivers/regulator/Kconfig
>> @@ -1384,6 +1384,15 @@ config REGULATOR_SLG51000
>>   	  The SLG51000 is seven compact and customizable low dropout
>>   	  regulators.
>>   
>> +config REGULATOR_SPACEMIT_P1
>> +	tristate "SpacemiT P1 regulators"
>> +	depends on ARCH_SPACEMIT || COMPILE_TEST
>> +	default ARCH_SPACEMIT
>> +	help
>> +	  Enable support for regulators implemented by the SpacemiT P1
>> +	  power controller.  The P1 implements 6 high-efficiency buck
>> +	  converters and 12 programmable LDO regulators.
> Needs module name in help text, as is the case with spacemit-pmic.

I will add this text.

>> +
>>   config REGULATOR_STM32_BOOSTER
>>   	tristate "STMicroelectronics STM32 BOOSTER"
>>   	depends on ARCH_STM32 || COMPILE_TEST
>>
>> <snip>
>>
>> +static struct platform_driver p1_regulator_driver = {
>> +	.probe = p1_regulator_probe,
>> +	.driver = {
>> +		.name = "spacemit-p1-regulator",
>> +	},
>> +};
>> +
>> +module_platform_driver(p1_regulator_driver);
>> +
>> +MODULE_DESCRIPTION("SpacemiT P1 regulator driver");
>> +MODULE_LICENSE("GPL");
> 
> If this driver is compiled as a module, it needs to be found by modalias
> so the driver auto-loads after spacemit-pmic registers the regulator
> device, so you need:
> 
> +MODULE_ALIAS("platform:spacemit-p1-regulator");
> 
> Also, consider extracting the name to a macro:
> 
> #define DRV_NAME "spacemit-p1-regulator"

I will implement both of these suggestions (and will do so in
the PMIC driver as well).

> Also, consider naming this consistently: "spacemit-p1", or
> "spacemit-p1-regulator"?

Let me see if I understand your comment, by explaining the
naming I used.

The PMIC driver could support a different PMIC.  Its OF
match table specifies a compatible string with matching
data, and the data describes attributes of the P1 PMIC.
So that driver uses MOD_NAME "spacemit-pmic".

This driver describes specifically the regulators found
in the P1 PMIC, so it uses "spacemit-p1-regulator" as
its MOD_NAME.

You might still be right; but does this change what you
are suggesting?

Thanks.

					-Alex

> 
> Regards,
> Vivian "dramforever" Wang
> 


  reply	other threads:[~2025-06-19 13:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-13 21:01 [PATCH 0/6] spacemit: introduce P1 PMIC and regulator support Alex Elder
2025-06-13 21:01 ` [PATCH 1/6] dt-bindings: mfd: add support the SpacmiT P1 PMIC Alex Elder
2025-06-19  6:03   ` Vivian Wang
2025-06-19 13:23     ` Alex Elder
2025-06-13 21:01 ` [PATCH 2/6] mfd: spacemit: add support for SpacemiT PMICs Alex Elder
2025-06-19  5:46   ` Vivian Wang
2025-06-19 13:23     ` Alex Elder
2025-06-19 14:40   ` Lee Jones
2025-06-19 14:41     ` Lee Jones
2025-06-20 14:10       ` Alex Elder
2025-06-20 14:10     ` Alex Elder
2025-06-25  8:21       ` Lee Jones
2025-06-25 11:48         ` Alex Elder
2025-06-25 13:33           ` Lee Jones
2025-06-13 21:01 ` [PATCH 3/6] regulator: spacemit: support SpacemiT P1 regulators Alex Elder
2025-06-14 11:03   ` Mark Brown
2025-06-19  6:15   ` Vivian Wang
2025-06-19 13:23     ` Alex Elder [this message]
2025-06-19 14:13       ` Vivian Wang
2025-06-13 21:01 ` [PATCH 4/6] riscv: dts: spacemit: enable the i2c8 adapter Alex Elder
2025-06-13 21:01 ` [PATCH 5/6] riscv: dts: spacemit: define fixed regulators Alex Elder
2025-06-13 21:01 ` [PATCH 6/6] riscv: dts: spacemit: define regulator constraints Alex Elder

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=6504c609-f8b5-42e3-88ad-5cbee30a52ed@riscstar.com \
    --to=elder@riscstar.com \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlan@gentoo.org \
    --cc=guodong@riscstar.com \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh@kernel.org \
    --cc=spacemit@lists.linux.dev \
    --cc=troymitchell988@gmail.com \
    --cc=wangruikang@iscas.ac.cn \
    /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;
as well as URLs for NNTP newsgroup(s).