mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Elder <elder@riscstar.com>
To: Conor Dooley <conor@kernel.org>
Cc: p.zabel@pengutronix.de, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, mohd.anwar@oss.qualcomm.com,
	lorenzo.bianconi@oss.qualcomm.com, danielt@kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Daniel Thompson <daniel@riscstar.com>
Subject: Re: [PATCH 1/2] dt-bindings: reset: introduce toshiba,tc9564-reset.yaml
Date: Thu, 22 Oct 2026 14:05:12 -0500	[thread overview]
Message-ID: <638e0f29-1ec9-4a6a-8777-fecef1bff409@riscstar.com> (raw)
In-Reply-To: <20261022-clench-drum-5907c17cb8d2@spud>

On 10/22/26 1:34 PM, Conor Dooley wrote:
> On Wed, Oct 21, 2026 at 02:50:41PM -0500, Alex Elder wrote:

. . .

>> OK.  Let's see if I understand what you're saying.
>>
>> This approach uses:
>> - A single top-level syscon driver (under drivers/mfd?) which
>>    probes based on a devicetree node compatible string ("toshiba,...")
> 
> I'm not sure if it needs to be under mfd (there's some in soc/foo too)
> but I guess so.

I'll look at both places and will choose the one that seems
most similar to what I end up with.

>> - That compatible string will require a (fairly simple) devicetree
>>    binding
>> - That driver initializes a regmap which will cover the space
>>    defined in its devicetree node (<0x0 0x2000>)
> 
> I don't think the driver has to even do this at all, e.g.
> sg2044-topsys.c doesn't. Whenever someone requests the regmap it will
> get created automatically since you're a syscon.

You're right.

>> - That driver has an array that uses MFD_CELL_NAME() to define
>>    cells for clock and reset
>> - That driver will call some form of mfd_add_devices() using the
>>    MFD cell array
>> - The stmmac driver can refer to this device node with a phandle
>>    property to specify the syscon that provides the regmap it needs
>>
>> And then, for the clock and reset devices:
>> - A clock platform driver (under drivers/clk) will match based
>>    on the driver name (matching what's supplied by MFD_CELL_NAME())
>> - A reset driver will be similar (under drivers/reset)
>> - As you mentioned, these drivers get at the regmap they need using
>>    device_node_to_regmap() (or dev_get_regmap() or something)
> 
> I think "regmap = device_node_to_regmap(pdev->dev.parent->of_node);" is
> the correct way to do it.

     regmap = device_node_to_regmap(dev_of_node(dev->parent));

>> - And despite these being separate drivers (from the syscon driver)
>>    they don't have devicetree nodes, and the syscon node itself
>>    defines the clock-controller and reset-controller properties.
>>
>> Does that sound right?  Am I missing anything?
> 
> Sounds about right.

This is awesome.  I went ahead with this plan and it's working
fine now.

This syscon driver and "sg2044-topsys.c" are awfully trivial,
and they seem like they could be wrapped in something along
the lines of "simple-mfd-i2c.c".

Thank you very much for your help on this Conor.

					-Alex

. . .

  reply	other threads:[~2026-10-22 19:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-12 16:43 [PATCH 0/2] reset: introduce TC9564 reset support Alex Elder
2026-10-12 16:43 ` [PATCH 1/2] dt-bindings: reset: introduce toshiba,tc9564-reset.yaml Alex Elder
2026-10-12 18:51   ` Conor Dooley
2026-10-12 19:10     ` Alex Elder
2026-10-12 21:22       ` Conor Dooley
2026-10-13 13:22         ` Alex Elder
2026-10-13 17:51           ` Conor Dooley
2026-10-21 19:50             ` Alex Elder
2026-10-22 18:34               ` Conor Dooley
2026-10-22 19:05                 ` Alex Elder [this message]
2026-10-23 18:00                   ` Conor Dooley
2026-10-23 19:22                     ` Alex Elder
2026-10-13  9:25     ` Krzysztof Kozlowski
2026-10-12 16:43 ` [PATCH 2/2] reset: toshiba: introduce a TC9564 SoC reset driver Alex Elder
2026-10-13 13:28   ` Philipp Zabel

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=638e0f29-1ec9-4a6a-8777-fecef1bff409@riscstar.com \
    --to=elder@riscstar.com \
    --cc=conor+dt@kernel.org \
    --cc=conor@kernel.org \
    --cc=daniel@riscstar.com \
    --cc=danielt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.bianconi@oss.qualcomm.com \
    --cc=mohd.anwar@oss.qualcomm.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.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®