Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Roman Vivchar <rva333@protonmail.com>
Cc: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Flora Fu <flora.fu@mediatek.com>,
	Alexandre Mergnat <amergnat@baylibre.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH 3/3] soc: mediatek: pwrap: add mt6572 support
Date: Wed, 15 Jul 2026 14:01:00 +0200	[thread overview]
Message-ID: <d2a9089f-9c86-4c92-8f6c-e85952ab8502@collabora.com> (raw)
In-Reply-To: <4W-fQkS-fQ5Wxua-0vkMZoLw98eklcnIN_ivaYjpWLIVX7qfCBjHGRJq8xQ59PTTIUNbzdT3EqkCsVqz_smuozi0Q3kq4antn54-rPXdmdI=@protonmail.com>

On 7/15/26 13:24, Roman Vivchar wrote:
> Hi AngeloGioacchino,
> 
> On Wednesday, July 15th, 2026 at 1:21 PM, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> wrote:
> 
>> On 7/14/26 14:42, Roman Vivchar via B4 Relay wrote:
> 
> ...
>   
>>>
>>> +static const struct pmic_wrapper_type pwrap_mt6572 = {
>>> +	.regs = mt6572_regs,
>>
>> MT6572 only has PWRAP_OP_TYPE, PWRAP_MSB_FIRST, PWRAP_GPS_STA additional registers
>> compared to MT2701, and the three are currently unused.
> 
> GPS_STA is indeed unused. As for others, downstream kernel includes mt6320 path.
> 
> //###############################
> //Enable 6320 option
> //###############################
> #ifdef SLV_6320
> WRAP_WR32(PMIC_WRAP_OP_TYPE ,OP_TYPE_CSL);
> WRAP_WR32(PMIC_WRAP_MSB_FIRST , LSB);
> #endif
> 
> Though I haven't seen any mt6572 device with the mt6320 so far, as well as
> pwrap_init_chip_select_ext is configured for the mt6323.
> 
>> Instead of adding yet one more huge array for 3 more registers, since I'm mostly
>> sure that those will never be used anyway (happy if you prove me wrong!), you can
>> at this point just use mt2701_regs for mt6572.
>>
>> Perhaps, add a comment saying that MT6572 does indeed have those additional regs
>> but were omitted because currently unused.
>>
>> So, something like
>>
>> /*
>>    * MT6572 has additional registers OP_TYPE (0x10), MSB_FIRST (0x14), GPS_STA (0x40)
>>    * which were omitted as they're currently unused in this driver.
>>    * Apart from that, the register map matches the one from MT2701.
>>    */
>> static const struct pmic_wrapper_type pwrap_mt6572 = {
>> 	.regs = mt2701_regs,
>>
> 
> I'm not a big fan of dead code, but at some point the mt6572+mt6320 may exist.
> Would you suggest keeping mt6572 array or drop it until some mt6320
> device appears?
> 

Nah, please, drop it until some MT6320 device appears.

Besides, you also said that you haven't seen any MT6572 w/6320 so far, so it's
even more unlikely that we'll ever see one.

While at it, could you please also add the information about MT6320 cases in
the commit description?
Something like "blahblah additional registers blahblah omitted, those seem to
be used only when the MT6572 is paired with a MT6320 PMIC blahblah" :-)

Cheers,
Angelo


      reply	other threads:[~2026-07-15 12:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14 12:42 [PATCH 0/3] soc: mediatek: pwrap: mt6572 support + log level fixes Roman Vivchar via B4 Relay
2026-07-14 12:42 ` [PATCH 1/3] dt-bindings: soc: mediatek: pwrap: add mt6572 Roman Vivchar via B4 Relay
2026-07-15 10:20   ` AngeloGioacchino Del Regno
2026-07-14 12:42 ` [PATCH 2/3] soc: mediatek: pwrap: use correct log level Roman Vivchar via B4 Relay
2026-07-15 10:20   ` AngeloGioacchino Del Regno
2026-07-14 12:42 ` [PATCH 3/3] soc: mediatek: pwrap: add mt6572 support Roman Vivchar via B4 Relay
2026-07-15 10:20   ` AngeloGioacchino Del Regno
2026-07-15 11:24     ` Roman Vivchar
2026-07-15 12:01       ` AngeloGioacchino Del Regno [this message]

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=d2a9089f-9c86-4c92-8f6c-e85952ab8502@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=amergnat@baylibre.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=flora.fu@mediatek.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=robh@kernel.org \
    --cc=rva333@protonmail.com \
    /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