From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Ivan Vecera <ivecera@redhat.com>
Cc: netdev@vger.kernel.org,
Vadim Fedorenko <vadim.fedorenko@linux.dev>,
Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>,
Jiri Pirko <jiri@resnulli.us>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Prathosh Satish <Prathosh.Satish@microchip.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, Lee Jones <lee@kernel.org>,
Michal Schmidt <mschmidt@redhat.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org
Subject: Re: [PATCH net-next v7 8/8] mfd: zl3073x: Register DPLL sub-device during init
Date: Wed, 7 May 2025 17:59:03 +0300 [thread overview]
Message-ID: <aBt1N6TcSckYj23A@smile.fi.intel.com> (raw)
In-Reply-To: <2e3eb9e3-151d-42ef-9043-998e762d3ba6@redhat.com>
On Wed, May 07, 2025 at 03:56:37PM +0200, Ivan Vecera wrote:
> On 07. 05. 25 3:41 odp., Andy Shevchenko wrote:
> > On Wed, May 7, 2025 at 3:45 PM Ivan Vecera <ivecera@redhat.com> wrote:
...
> > > +static const struct zl3073x_pdata zl3073x_pdata[ZL3073X_MAX_CHANNELS] = {
> > > + { .channel = 0, },
> > > + { .channel = 1, },
> > > + { .channel = 2, },
> > > + { .channel = 3, },
> > > + { .channel = 4, },
> > > +};
> >
> > > +static const struct mfd_cell zl3073x_devs[] = {
> > > + ZL3073X_CELL("zl3073x-dpll", 0),
> > > + ZL3073X_CELL("zl3073x-dpll", 1),
> > > + ZL3073X_CELL("zl3073x-dpll", 2),
> > > + ZL3073X_CELL("zl3073x-dpll", 3),
> > > + ZL3073X_CELL("zl3073x-dpll", 4),
> > > +};
> >
> > > +#define ZL3073X_MAX_CHANNELS 5
> >
> > Btw, wouldn't be better to keep the above lists synchronised like
> >
> > 1. Make ZL3073X_CELL() to use indexed variant
> >
> > [idx] = ...
> >
> > 2. Define the channel numbers
> >
> > and use them in both data structures.
> >
> > ...
>
> WDYM?
>
> > OTOH, I'm not sure why we even need this. If this is going to be
> > sequential, can't we make a core to decide which cell will be given
> > which id?
>
> Just a note that after introduction of PHC sub-driver the array will look
> like:
> static const struct mfd_cell zl3073x_devs[] = {
> ZL3073X_CELL("zl3073x-dpll", 0), // DPLL sub-dev for chan 0
> ZL3073X_CELL("zl3073x-phc", 0), // PHC sub-dev for chan 0
> ZL3073X_CELL("zl3073x-dpll", 1), // ...
> ZL3073X_CELL("zl3073x-phc", 1),
> ZL3073X_CELL("zl3073x-dpll", 2),
> ZL3073X_CELL("zl3073x-phc", 2),
> ZL3073X_CELL("zl3073x-dpll", 3),
> ZL3073X_CELL("zl3073x-phc", 3),
> ZL3073X_CELL("zl3073x-dpll", 4),
> ZL3073X_CELL("zl3073x-phc", 4), // PHC sub-dev for chan 4
> };
Ah, this is very important piece. Then I mean only this kind of change
enum {
// this or whatever meaningful names
..._CH_0 0
..._CH_1 1
...
};
static const struct zl3073x_pdata zl3073x_pdata[ZL3073X_MAX_CHANNELS] = {
{ .channel = ..._CH_0, },
...
};
static const struct mfd_cell zl3073x_devs[] = {
ZL3073X_CELL("zl3073x-dpll", ..._CH_0),
ZL3073X_CELL("zl3073x-phc", ..._CH_0),
...
};
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-05-07 14:59 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-07 12:43 [PATCH net-next v7 0/8] Add Microchip ZL3073x support (part 1) Ivan Vecera
2025-05-07 12:43 ` [PATCH net-next v7 1/8] dt-bindings: dpll: Add DPLL device and pin Ivan Vecera
2025-05-07 12:43 ` [PATCH net-next v7 2/8] dt-bindings: dpll: Add support for Microchip Azurite chip family Ivan Vecera
2025-05-07 12:43 ` [PATCH net-next v7 3/8] mfd: Add Microchip ZL3073x support Ivan Vecera
2025-05-07 12:43 ` [PATCH net-next v7 4/8] mfd: zl3073x: Add support for devlink device info Ivan Vecera
2025-05-07 12:43 ` [PATCH net-next v7 5/8] mfd: zl3073x: Protect operations requiring multiple register accesses Ivan Vecera
2025-05-07 12:43 ` [PATCH net-next v7 6/8] mfd: zl3073x: Fetch invariants during probe Ivan Vecera
2025-05-07 12:43 ` [PATCH net-next v7 7/8] mfd: zl3073x: Add clock_id field Ivan Vecera
2025-05-07 12:43 ` [PATCH net-next v7 8/8] mfd: zl3073x: Register DPLL sub-device during init Ivan Vecera
2025-05-07 13:30 ` Andy Shevchenko
2025-05-07 13:41 ` Andy Shevchenko
2025-05-07 13:56 ` Ivan Vecera
2025-05-07 14:59 ` Andy Shevchenko [this message]
2025-05-07 15:26 ` Lee Jones
2025-05-12 11:55 ` Ivan Vecera
2025-05-13 9:41 ` Lee Jones
2025-05-13 10:47 ` Ivan Vecera
2025-05-19 16:59 ` Ivan Vecera
2025-05-22 7:39 ` Lee Jones
2025-05-22 8:54 ` Ivan Vecera
2025-05-22 10:45 ` Lee Jones
2025-05-22 11:23 ` Ivan Vecera
2025-06-12 10:26 ` Lee Jones
2025-05-07 14:19 ` Ivan Vecera
2025-05-07 15:00 ` Andy Shevchenko
2025-05-07 15:23 ` Ivan Vecera
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=aBt1N6TcSckYj23A@smile.fi.intel.com \
--to=andy.shevchenko@gmail.com \
--cc=Prathosh.Satish@microchip.com \
--cc=arkadiusz.kubalewski@intel.com \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=horms@kernel.org \
--cc=ivecera@redhat.com \
--cc=jiri@resnulli.us \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=lee@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mschmidt@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=vadim.fedorenko@linux.dev \
/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).