Linux-PHY Archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Peter Griffin <peter.griffin@linaro.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Arnd Bergmann <arnd@arndb.de>,
	lee@kernel.org
Cc: "André Draszik" <andre.draszik@linaro.org>,
	"Vinod Koul" <vkoul@kernel.org>,
	"Kishon Vijay Abraham I" <kishon@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Marek Szyprowski" <m.szyprowski@samsung.com>,
	"Sylwester Nawrocki" <s.nawrocki@samsung.com>,
	"Alim Akhtar" <alim.akhtar@samsung.com>,
	"Sam Protsenko" <semen.protsenko@linaro.org>,
	"Tudor Ambarus" <tudor.ambarus@linaro.org>,
	"Will McVicker" <willmcvicker@google.com>,
	"Roy Luo" <royluo@google.com>,
	kernel-team@android.com, linux-phy@lists.infradead.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org
Subject: Re: [PATCH 2/7] phy: exynos5-usbdrd: use exynos_get_pmu_regmap_by_phandle() for PMU regs
Date: Thu, 25 Apr 2024 12:16:48 +0200	[thread overview]
Message-ID: <06383015-51b2-4f4c-9fd8-e4f7ce12f44e@kernel.org> (raw)
In-Reply-To: <CADrjBPpQEbxVbDwat1fn=2tYk9r-0up0+SARFZA=qkoeFYz1Mg@mail.gmail.com>

On 25/04/2024 12:02, Peter Griffin wrote:
>> I prefer to keep the syscon
>> API and change the syscon driver to expose proper regmap. IOW, use
>> generic API syscon_regmap_lookup_by_phandle() and the type of regmap
>> returned is defined by the provider (so node pointed by phandle).
>>
> 
> @Arnd - any more thoughts on Krzysztof idea above ^^
> 
> @Krzysztof - I did speak to Arnd about the idea you proposed (or my
> understanding of it at least), which was external drivers like
> exynos-pmu or altera-sysmgr.c could create the regmap and register it
> with syscon so it can be returned by
> syscon_regmap_lookup_by_phandle(). Arnd's initial feedback was he
> would prefer to keep the complexity out of syscon, and have the client
> driver support multiple backends (so syscon-reboot for example would
> support using either syscon_regmap_lookup_by_phandle() or
> exynos_get_pmu_regmap_by_phandle() to obtain it's regmap). There were
> also some concerns about syscon having to probe very early for some
> platforms.

mfd/syscon.c is postcore_initcall, so it is not that very early,
although earlier than drivers. However it does not support deferred
probe and sometimes syscon providers might need clocks and resets.

One syscon consumer (so regular driver like phy here) might work with
different providers. E.g. on earlier arm and arm64 Exynos this was
simple regmap. On Google GS this is SMC. On some foo-bar it might be
call to hypervisor or something needing clocks.

For me therefore the syscon consumer is like regmap consumer. You do not
care who provides the regmap, just want i2c or mmio regmap. Of course
the specific driver, so the consumer of regmap, knows the type of regmap
it uses, so it requests i2c or mmio.

Here we want to hide two different interfaces - mmio and SMC - behind
one regmap. We solve it by using same regmap interface for consumer, but
different syscon calls returning different regmaps.

Anyway, I want to sort it out and have some sort of global policy,
before we start doing such changes for Google GS. I am sure soon
Qualcomm will come with their need for hypervisor quirks/regmaps etc.
And then TI will come with some need.

Best regards,
Krzysztof


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

  reply	other threads:[~2024-04-25 10:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23 17:06 [PATCH 0/7] USB31DRD phy support for Google Tensor gs101 (HS & SS) André Draszik
2024-04-23 17:06 ` [PATCH 1/7] dt-bindings: phy: samsung,usb3-drd-phy: add gs101 compatible André Draszik
2024-04-24 19:43   ` Rob Herring
2024-04-23 17:06 ` [PATCH 2/7] phy: exynos5-usbdrd: use exynos_get_pmu_regmap_by_phandle() for PMU regs André Draszik
2024-04-25  7:47   ` Krzysztof Kozlowski
2024-04-25 10:02     ` Peter Griffin
2024-04-25 10:16       ` Krzysztof Kozlowski [this message]
2024-04-23 17:06 ` [PATCH 3/7] phy: exynos5-usbdrd: support isolating HS and SS ports independently André Draszik
2024-04-23 17:06 ` [PATCH 4/7] phy: exynos5-usbdrd: set ref clk freq in exynos850_usbdrd_utmi_init() André Draszik
2024-04-24  5:03   ` kernel test robot
2024-04-24  7:41   ` kernel test robot
2024-04-23 17:06 ` [PATCH 5/7] phy: exynos5-usbdrd: uniform order of register bit macros André Draszik
2024-04-23 17:06 ` [PATCH 6/7] phy: exynos5-usbdrd: convert to clk_bulk for phy (register) access André Draszik
2024-04-23 17:06 ` [PATCH 7/7] phy: exynos5-usbdrd: support Exynos USBDRD 3.1 combo phy (HS & SS) André Draszik
2024-04-24  5:55   ` kernel test robot

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=06383015-51b2-4f4c-9fd8-e4f7ce12f44e@kernel.org \
    --to=krzk@kernel.org \
    --cc=alim.akhtar@samsung.com \
    --cc=andre.draszik@linaro.org \
    --cc=arnd@arndb.de \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel-team@android.com \
    --cc=kishon@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=peter.griffin@linaro.org \
    --cc=robh@kernel.org \
    --cc=royluo@google.com \
    --cc=s.nawrocki@samsung.com \
    --cc=semen.protsenko@linaro.org \
    --cc=tudor.ambarus@linaro.org \
    --cc=vkoul@kernel.org \
    --cc=willmcvicker@google.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).