devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: "Karel Balej" <karelb@gimli.ms.mff.cuni.cz>,
	"Lee Jones" <lee@kernel.org>, "Rob Herring" <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"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: [RFC PATCH v3 4/5] input: add onkey driver for Marvell 88PM886 PMIC
Date: Sun, 10 Mar 2024 14:48:55 -0700	[thread overview]
Message-ID: <Ze4qx9KQEPU9U8JN@google.com> (raw)
In-Reply-To: <3601a374-4161-40e1-8a80-9bbfdae5bd8a@linaro.org>

On Sun, Mar 10, 2024 at 09:35:36PM +0100, Krzysztof Kozlowski wrote:
> On 10/03/2024 12:35, Karel Balej wrote:
> > Dmitry Torokhov, 2024-03-04T17:10:59-08:00:
> >> On Mon, Mar 04, 2024 at 09:28:45PM +0100, Karel Balej wrote:
> >>> Dmitry,
> >>>
> >>> Dmitry Torokhov, 2024-03-03T12:39:46-08:00:
> >>>> On Sun, Mar 03, 2024 at 11:04:25AM +0100, Karel Balej wrote:
> >>>>> From: Karel Balej <balejk@matfyz.cz>
> >>>>>
> >>>>> Marvell 88PM886 PMIC provides onkey among other things. Add client
> >>>>> driver to handle it. The driver currently only provides a basic support
> >>>>> omitting additional functions found in the vendor version, such as long
> >>>>> onkey and GPIO integration.
> >>>>>
> >>>>> Signed-off-by: Karel Balej <balejk@matfyz.cz>
> >>>>> ---
> >>>>>
> >>>>> Notes:
> >>>>>     RFC v3:
> >>>>>     - Drop wakeup-source.
> >>>>>     RFC v2:
> >>>>>     - Address Dmitry's feedback:
> >>>>>       - Sort includes alphabetically.
> >>>>>       - Drop onkey->irq.
> >>>>>       - ret -> err in irq_handler and no initialization.
> >>>>>       - Break long lines and other formatting.
> >>>>>       - Do not clobber platform_get_irq error.
> >>>>>       - Do not set device parent manually.
> >>>>>       - Use input_set_capability.
> >>>>>       - Use the wakeup-source DT property.
> >>>>>       - Drop of_match_table.
> >>>>
> >>>> I only said that you should not be using of_match_ptr(), but you still
> >>>> need to have of_match_table set and have MODULE_DEVICE_TABLE() for the
> >>>> proper module loading support.
> >>>
> >>> I removed of_match_table because I no longer need compatible for this --
> >>> there are no device tree properties and the driver is being instantiated
> >>> by the MFD driver.
> >>>
> >>> Is the MODULE_DEVICE_TABLE() entry needed for the driver to probe when
> >>> compiled as module? If that is the case, given what I write above, am I
> >>> correct that MODULE_DEVICE_TABLE(platform,...) would be the right thing
> >>> to use here?
> >>
> >> Yes, if uevent generated for the device is "platform:<name>" then
> >> MODULE_DEVICE_TABLE(platform,...) will suffice. I am not sure how MFD
> >> sets it up (OF modalias or platform), but you should be able to check
> >> the format looking at the "uevent" attribute for your device in sysfs
> >> (/sys/devices/bus/platform/...). 
> > 
> > The uevent is indeed platform.
> > 
> > But since there is only one device, perhaps having a device table is
> > superfluous and using `MODULE_ALIAS("platform:88pm886-onkey")` is more
> > fitting?
> 
> Adding aliases for standard IDs and standard cases is almost never
> correct. If you need module alias, it means your ID table is wrong (or
> missing, which is usually wrong).
> 
> > 
> > Although I don't understand why this is even necessary when the driver
> > name is such and the module is registered using
> > `module_platform_driver`...
> 
> ID table and MODULE_DEVICE_TABLE() are necessary for modprobe to work.
> Just run `modinfo`.

MODULE_DEVICE_TABLE() and MODULE_ALIAS() reduce to the same thing, but I
agree that we should not try to be too clever and simply use the ID
table.

Thanks.

-- 
Dmitry

  reply	other threads:[~2024-03-10 21:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-03 10:04 [RFC PATCH v3 0/5] initial support for Marvell 88PM886 PMIC Karel Balej
2024-03-03 10:04 ` [RFC PATCH v3 1/5] dt-bindings: mfd: add entry " Karel Balej
2024-03-04  8:03   ` Krzysztof Kozlowski
2024-03-03 10:04 ` [RFC PATCH v3 2/5] mfd: add driver " Karel Balej
2024-03-05 11:44   ` Lee Jones
2024-03-05 18:53     ` Karel Balej
2024-03-07  8:16       ` Lee Jones
2024-03-03 10:04 ` [RFC PATCH v3 3/5] regulator: add regulators " Karel Balej
2024-03-03 10:04 ` [RFC PATCH v3 4/5] input: add onkey " Karel Balej
2024-03-03 20:39   ` Dmitry Torokhov
2024-03-04 20:28     ` Karel Balej
2024-03-05  1:10       ` Dmitry Torokhov
2024-03-10 11:35         ` Karel Balej
2024-03-10 20:35           ` Krzysztof Kozlowski
2024-03-10 21:48             ` Dmitry Torokhov [this message]
2024-03-11 10:26             ` Karel Balej
2024-03-11 10:41               ` Krzysztof Kozlowski
2024-03-11 12:12                 ` Karel Balej
2024-03-11 16:18               ` Dmitry Torokhov
2024-03-03 10:04 ` [RFC PATCH v3 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=Ze4qx9KQEPU9U8JN@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=duje.mihanovic@skole.hr \
    --cc=karelb@gimli.ms.mff.cuni.cz \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lee@kernel.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+dt@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 NNTP newsgroup(s).