All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cathy Xu (许华婷)" <ot_cathy.xu@mediatek.com>
To: "wenst@chromium.org" <wenst@chromium.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"Lei Xue (薛磊)" <Lei.Xue@mediatek.com>,
	"krzk@kernel.org" <krzk@kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"Wenbin Mei (梅文彬)" <Wenbin.Mei@mediatek.com>,
	"linus.walleij@linaro.org" <linus.walleij@linaro.org>,
	"Guodong Liu (刘国栋)" <Guodong.Liu@mediatek.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"robh@kernel.org" <robh@kernel.org>,
	"sean.wang@kernel.org" <sean.wang@kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>
Subject: Re: [PATCH v3 1/2] dt-bindings: pinctrl: mediatek: add support for mt8196
Date: Mon, 20 Jan 2025 09:12:35 +0000	[thread overview]
Message-ID: <113617eae8b4341b6546d9a7ed0eac069d4c19a1.camel@mediatek.com> (raw)
In-Reply-To: <CAGXv+5FtA7KCPE1FQ1Wp=M_11=20n432zSWTkeBasUa4fdpm8A@mail.gmail.com>

On Thu, 2025-01-16 at 16:33 +0800, Chen-Yu Tsai wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> On Thu, Jan 16, 2025 at 4:19 PM Cathy Xu (许华婷) <
> ot_cathy.xu@mediatek.com> wrote:
> > 
> > On Thu, 2025-01-16 at 08:28 +0100, Krzysztof Kozlowski wrote:
> > > External email : Please do not click links or open attachments
> > > until
> > > you have verified the sender or the content.
> > > 
> > > 
> > > On 16/01/2025 03:20, Cathy Xu (许华婷) wrote:
> > > > > > +          bias-pull-down:
> > > > > > +            oneOf:
> > > > > > +              - type: boolean
> > > > > > +              - enum: [100, 101, 102, 103]
> > > > > > +                description: mt8196 pull down PUPD/R0/R1
> > > > > > type
> > > > > > define value.
> > > > > > +              - enum: [200, 201, 202, 203, 204, 205, 206,
> > > > > > 207]
> > > > > > +                description: mt8196 pull down RSEL type
> > > > > > define
> > > > > > value.
> > > > > 
> > > > > Not much improved.
> > > > 
> > > >   I have removed the content related to 'resistance value', we
> > > > use
> > > > 'RSEL' instead of 'resistance value'.
> > > 
> > > So the value in Ohms was removed? I assume above do not have
> > > known
> > > value
> > > in Ohms?
> > 
> >   Yes, value in Ohns was removed, no code have knowm value.
> 
> That's sad. We went through a lot during the MT8195 cycle to get the
> paris driver library to support proper SI unit values [1] to replace
> the RSEL values (200 ~ 207). Why can't this be supported anymore?
> 
> Also we never got around to getting rid the PUPD/R0/R1 values (100 ~
> 103).

  Sorry, I didn't see any parsing of 'mediatek,rsel-resistence-in-si-
unit' in driver, and I noticed that in driver, the final value written
to the rsel register is based on the value of RSEL(200 ~ 207).

  Additionally, I don't understand why we abandon the RSEL/R0/R1 values
(200 ~ 207/100 ~ 103). Is it to prevent confusion? Perhaps adding some
comments would help?
  
> 
> > > 
> > > > 
> > > > > 
> > > > > 
> > > > > > +            description: |
> > > > > > +              For pull down type is normal, it doesn't
> > > > > > need
> > > > > > add
> > > > > > RSEL & R1R0.
> > > > > > +              For pull down type is PUPD/R0/R1 type, it
> > > > > > can
> > > > > > add
> > > > > > R1R0 define to
> > > > > > +              set different resistance. It can support
> > > > > > "MTK_PUPD_SET_R1R0_00" &
> > > > > > +              "MTK_PUPD_SET_R1R0_01" &
> > > > > > "MTK_PUPD_SET_R1R0_10"
> > > > > > &
> > > > > > +              "MTK_PUPD_SET_R1R0_11" define in mt8196.
> > > > > > +              For pull down type is PD/RSEL, it can add
> > > > > > RSEL
> > > > > > define to set
> > > > > > +              different resistance. It can support
> > > > > > +              "MTK_PULL_SET_RSEL_000" &
> > > > > > "MTK_PULL_SET_RSEL_001" &
> > > > > > +              "MTK_PULL_SET_RSEL_010" &
> > > > > > "MTK_PULL_SET_RSEL_011" &
> > > > > > +              "MTK_PULL_SET_RSEL_100" &
> > > > > > "MTK_PULL_SET_RSEL_101" &
> > > > > > +              "MTK_PULL_SET_RSEL_110" &
> > > > > > "MTK_PULL_SET_RSEL_111"
> > > > > > define in
> > > > > > +              mt8196.
> > > > > > diff --git a/include/dt-bindings/pinctrl/mt8196-pinfunc.h
> > > > > > b/include/dt-bindings/pinctrl/mt8196-pinfunc.h
> > > > > > new file mode 100644
> > > > > > index 000000000000..bf0c8374407c
> > > > > > --- /dev/null
> > > > > > +++ b/include/dt-bindings/pinctrl/mt8196-pinfunc.h
> > > > > > @@ -0,0 +1,1572 @@
> > > > > > +/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> > > > > > */
> > > > > > +/*
> > > > > > + * Copyright (C) 2025 Mediatek Inc.
> > > > > > + * Author: Guodong Liu <Guodong.Liu@mediatek.com>
> > > > > > + */
> > > > > > +
> > > > > > +#ifndef __MT8196_PINFUNC_H
> > > > > > +#define __MT8196_PINFUNC_H
> > > > > > +
> > > > > > +#include <dt-bindings/pinctrl/mt65xx.h>
> > > > > > +
> > > > > > +#define PINMUX_GPIO0__FUNC_GPIO0 (MTK_PIN_NO(0) | 0)
> > > > > > +#define PINMUX_GPIO0__FUNC_DMIC1_CLK (MTK_PIN_NO(0) | 1)
> > > > > > +#define PINMUX_GPIO0__FUNC_SPI3_A_MO (MTK_PIN_NO(0) | 3)
> > > > > > +#define PINMUX_GPIO0__FUNC_FMI2S_B_LRCK (MTK_PIN_NO(0) |
> > > > > > 4)
> > > > > > +#define PINMUX_GPIO0__FUNC_SCP_DMIC1_CLK (MTK_PIN_NO(0) |
> > > > > > 5)
> > > > > > +#define PINMUX_GPIO0__FUNC_TP_GPIO14_AO (MTK_PIN_NO(0) |
> > > > > > 6)
> > > > > 
> > > > > I do not see how you resolved my comment from v1. In v2 I
> > > > > reminded
> > > > > about
> > > > > it, so you responded that yopu will change something, but I
> > > > > do
> > > > > not
> > > > > see
> > > > > any changes.
> > > > > 
> > > > > So explain: how did you resolve my comment?
> > > > > 
> > > > > These two examples where you claim you will change something,
> > > > > but
> > > > > send
> > > > > the same. I skipped the rest of the patch.
> > > > 
> > > >   Thank you for your patient response, here is my explanation
> > > > for
> > > > you
> > > > question:
> > > > 
> > > >   In v1, I undertand that you meant I didn't sent a real
> > > > binding,
> > > > and
> > > 
> > > 
> > > The comment is under specific lines, so I said these defines are
> > > not
> > > a
> > > real binding. You sent them again, but they are still not
> > > bindings,
> > > because they are not used in the driver. Maybe the usage is
> > > convoluted,
> > > so which part of implementation are these connecting with DTS?
> > > IOW,
> > > which part of driver relies on the binding?
> > 
> >   I got you. This binding define many macros, which will be used
> > for
> > 'pinmux' setting in the DTS. The usage like this:
> > 
> >   adsp_uart_pins: adsp-uart-pins {
> >                 pins-tx-rx {
> >                         pinmux =
> > <PINMUX_GPIO35__FUNC_O_ADSP_UTXD0>,
> >                                  <PINMUX_GPIO36__FUNC_I1_ADSP_URXD0
> > >;
> >                 };
> >         };
> 
> The only binding between the DT and the driver is the structure of
> the value, given as "(MTK_PIN_NO(<N>) | <function mux value>)".
> 
> The whole list of "PINMUX_GPIOxxx__FUNC_xyz" macros is just a
> convenience
> table for developers, and not used by the driver. The driver simply
> takes
> the values from the two bit fields and uses them directly.
> 
> That's why Krzysztof is saying the macros are not used in the driver
> and therefore not a binding.
> 
> Please move the header file to under "arch/arm64/boot/dts/mediatek",
> and split it out as a separate commit with a subject like:
> 
>     arm64: dts: mediatek: mt8196: Add pinmux macro header file

  ok, got it, I will fix in next version. However, the previous 'xxx-
pinfunc.h' file were placed under binding.

> 
> 
> ChenYu
> 
> > > 
> > > 
> > > 
> > > > the bindings should be separated from driver. In addition, I
> > > > should
> > > > run scripts/checkpatch.pl and scripts/get_maintainers.pl. So in
> > > > v2,
> > > > I
> > > > sent a real binding(mediatek,mt8196-pinctrl.yaml), and sent two
> > > > separate patches, one for driver and one for bindings, also ran
> > > > scripts/get_maintainers.pl get necessary people and sent to
> > > > them.
> > > > 
> > > >   In v2, I understand that I need refer to git history to
> > > > modify
> > > > the
> > > > commit msgs, so I made the changes in v3. Then you asked me
> > > > about
> > > > the
> > > > difference between 'RSEL' and 'resistance value'. I replied
> > > > that
> > > > the
> > > > 'resistance value' method is no longer use, so in v3, I removed
> > > > all
> > > > content about it(include entire 'rsel-resistance-in-si-unit'
> > > > property
> > > > and the parts mentioned in bias-pull-up/down).
> > > 
> > > Yes, thank you this I saw, the comments appear under specific
> > > places,
> > > so
> > > only these places are discussed.
> > 
> >   ok, thank you, we can discuss if there are any issues.
> > 
> > > 
> > > 
> > > 
> > > Best regards,
> > > Krzysztof

  reply	other threads:[~2025-01-20  9:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-15  6:35 [PATCH v3 0/2] MediaTek pinctrl patch on mt8196 Cathy Xu
2025-01-15  6:35 ` [PATCH v3 1/2] dt-bindings: pinctrl: mediatek: add support for mt8196 Cathy Xu
2025-01-15  9:50   ` Krzysztof Kozlowski
2025-01-16  2:20     ` Cathy Xu (许华婷)
2025-01-16  7:28       ` Krzysztof Kozlowski
2025-01-16  8:18         ` Cathy Xu (许华婷)
2025-01-16  8:33           ` Chen-Yu Tsai
2025-01-20  9:12             ` Cathy Xu (许华婷) [this message]
2025-01-16 10:20           ` Krzysztof Kozlowski
2025-01-20  9:17             ` Cathy Xu (许华婷)
2025-01-20 12:42               ` AngeloGioacchino Del Regno
2025-01-21  9:56                 ` Cathy Xu (许华婷)
2025-01-21 10:03                   ` Chen-Yu Tsai
2025-02-17  9:45                     ` Cathy Xu (许华婷)
2025-02-17 10:24                       ` Chen-Yu Tsai
2025-02-19  8:54                         ` Cathy Xu (许华婷)
2025-01-15  6:35 ` [PATCH v3 2/2] pinctrl: mediatek: add mt8196 driver Cathy Xu

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=113617eae8b4341b6546d9a7ed0eac069d4c19a1.camel@mediatek.com \
    --to=ot_cathy.xu@mediatek.com \
    --cc=Guodong.Liu@mediatek.com \
    --cc=Lei.Xue@mediatek.com \
    --cc=Wenbin.Mei@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=robh@kernel.org \
    --cc=sean.wang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.