Phone-Devel Archive mirror.
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: Karel Balej <balejk@matfyz.cz>
Cc: "Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Mark Brown" <broonie@kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-input@vger.kernel.org,
	"Duje Mihanović" <duje.mihanovic@skole.hr>,
	~postmarketos/upstreaming@lists.sr.ht,
	phone-devel@vger.kernel.org
Subject: Re: [PATCH 2/5] mfd: add driver for Marvell 88PM886 PMIC
Date: Thu, 11 Apr 2024 17:39:11 +0100	[thread overview]
Message-ID: <20240411163911.GJ2399047@google.com> (raw)
In-Reply-To: <D0HE07BHD1T8.HQLIBUHTRVGT@matfyz.cz>

On Thu, 11 Apr 2024, Karel Balej wrote:

> Lee Jones, 2024-04-11T12:37:26+01:00:
> [...]
> > > diff --git a/drivers/mfd/88pm886.c b/drivers/mfd/88pm886.c
> > > new file mode 100644
> > > index 000000000000..e06d418a5da9
> > > --- /dev/null
> > > +++ b/drivers/mfd/88pm886.c
> > > @@ -0,0 +1,157 @@
> > > +// SPDX-License-Identifier: GPL-2.0-only
> > > +#include <linux/i2c.h>
> > > +#include <linux/mfd/core.h>
> > > +#include <linux/module.h>
> > > +#include <linux/notifier.h>
> > > +#include <linux/of.h>
> > > +#include <linux/reboot.h>
> > > +#include <linux/regmap.h>
> > > +
> > > +#include <linux/mfd/88pm886.h>
> > > +
> > > +#define PM886_REG_INT_STATUS1			0x05
> > > +
> > > +#define PM886_REG_INT_ENA_1			0x0a
> > > +#define PM886_INT_ENA1_ONKEY			BIT(0)
> > > +
> > > +#define PM886_IRQ_ONKEY				0
> > > +
> > > +#define PM886_REGMAP_CONF_MAX_REG		0xef
> >
> > Why have you split the defines up between here and the header?
> 
> I tried to keep defines tied to the code which uses them and only put
> defines needed in multiple places in the header. With the exception of
> closely related things, such as register bits which I am keeping
> together with the respective register definitions for clarity. Does that
> not make sense?

It makes sense and it's a nice thought, but I think it's nicer to keep
them all together, rather than have to worry about which ones are and
which ones are not used here or there.  Also, there will be holes in the
definitions, etc.

> > Please place them all in the header.
> 
> Would you then also have me move all the definitions from the regulators
> driver there?

I think it would be nice to have them all nice and contiguous.

So, yes.

> [...]
> 
> > > +	err = devm_mfd_add_devices(dev, 0, pm886_devs, ARRAY_SIZE(pm886_devs),
> >
> > Why 0?
> 
> PLATFORM_DEVID_AUTO then? Or will PLATFORM_DEVID_NONE suffice since the
> cells all have different names now (it would probably cause problems
> though if the driver was used multiple times for some reason, wouldn't
> it?)?

You tell me.  Please try and understand the code you author. :)

-- 
Lee Jones [李琼斯]

  reply	other threads:[~2024-04-11 16:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-31 10:46 [PATCH 0/5] initial support for Marvell 88PM886 PMIC Karel Balej
2024-03-31 10:46 ` [PATCH 1/5] dt-bindings: mfd: add entry " Karel Balej
2024-04-11 12:08   ` Krzysztof Kozlowski
2024-03-31 10:46 ` [PATCH 2/5] mfd: add driver " Karel Balej
2024-04-11 11:37   ` Lee Jones
2024-04-11 15:09     ` Karel Balej
2024-04-11 16:39       ` Lee Jones [this message]
2024-03-31 10:46 ` [PATCH 3/5] regulator: add regulators " Karel Balej
2024-03-31 10:46 ` [PATCH 4/5] input: add onkey " Karel Balej
2024-03-31 10:46 ` [PATCH 5/5] MAINTAINERS: add myself " Karel Balej

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=20240411163911.GJ2399047@google.com \
    --to=lee@kernel.org \
    --cc=balejk@matfyz.cz \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=duje.mihanovic@skole.hr \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phone-devel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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).