[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1438602218.3726.45.camel@tiscali.nl>
Date: Mon, 03 Aug 2015 13:43:38 +0200
From: Paul Bolle <pebolle@...cali.nl>
To: Javier Martinez Canillas <javier@....samsung.com>
Cc: Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 15/27] regulator: fan53555: Export I2C module alias
information
Hi Javier,
(Mark already applied this patch. Still, I couldn't wrap my head around
it. So maybe you'd still like to answer a question or two, basically to
educate me.)
On do, 2015-07-30 at 18:18 +0200, Javier Martinez Canillas wrote:
> The I2C core always reports the MODALIAS uevent as "i2c:<client name"
> regardless if the driver was matched using the I2C id_table or the
> of_match_table.
It's the other way round, I think.
Both MODULE_DEVICE_TABLE() macros add a set of aliases to this module.
These aliases are used by userspace to load the fan53555 module if it
notices a uevent that contains the proper "MODALIAS=" string. Only after
this module is loaded by userspace will the I2C id_table and the
of_match_table be available to match this driver to the hardware found
in the machine and, if matching hardware is found, call
fan53555_regulator_probe() to get this module to actually do something.
That being said, before this patch the fan53555 module contained these
aliases:
alias: of:N*T*Csilergy,syr828*
alias: of:N*T*Csilergy,syr827*
alias: of:N*T*Cfcs,fan53555*
While this patch ad these two aliases:
alias: i2c:syr82x
alias: i2c:fan53555
Now I don't have an "of" or "i2c" capable machine at hand, which makes
it a bit hard to figure out how all of this is supposed to fit together.
But I'm guessing that parsing a device tree blob that contains strings
like
compatible = "silergy,syr828"
would add strings like
MODALIAS=of:N[...]T[...]Csilergy,syr828
to the related uevents. (Likewise for the two other aliases.) Doesn't
that happen here?
> So the driver needs to export the I2C table and this
> be built into the module or udev won't have the necessary information
> to auto load the correct module when the device is added.
s/the correct module/this module/, right?
> --- a/drivers/regulator/fan53555.c
> +++ b/drivers/regulator/fan53555.c
> +MODULE_DEVICE_TABLE(i2c, fan53555_id);
As I said above this patch adds two aliases to the fan53555 module:
alias: i2c:syr82x
alias: i2c:fan53555
But neither the string "fan53555" nor the string "syr82x" generate
interesting hits in current linux-next. Are these strings perhaps only
used in out of tree device tree source files?
Thanks,
Paul Bolle
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists