devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Courtney Cavin <courtney.cavin@sonymobile.com>
To: "Ivan T. Ivanov" <iivanov@mm-sol.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
	Lee Jones <lee.jones@linaro.org>,
	Josh Cartwright <joshc@codeaurora.org>,
	Grant Likely <grant.likely@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>
Subject: Re: [PATCH 1/2] mfd: pm8x41: add support for Qualcomm 8x41 PMICs
Date: Wed, 23 Apr 2014 15:12:00 -0700	[thread overview]
Message-ID: <20140423221200.GL17066@sonymobile.com> (raw)
In-Reply-To: <1398285272.14329.6.camel@violet>

On Wed, Apr 23, 2014 at 10:34:32PM +0200, Ivan T. Ivanov wrote:
> 
> On Wed, 2014-04-23 at 11:16 -0700, Courtney Cavin wrote:
> > On Wed, Apr 23, 2014 at 03:19:28PM +0200, Ivan T. Ivanov wrote:
> > > 
> > > Hi,
> > > 
> > > On Tue, 2014-04-22 at 17:31 -0700, Courtney Cavin wrote:
> > > > From: Josh Cartwright <joshc@codeaurora.org>
> > > > 
> > > > The Qualcomm 8941 and 8841 PMICs are components used with the Snapdragon
> > > > 800 series SoC family.  This driver exists largely as a glue mfd component,
> > > > it exists to be an owner of an SPMI regmap for children devices
> > > > described in device tree.
> > > > 
> > > 
> > > Thanks. This is exactly what I have planed to do :-)
> > > 
> > 
> > Sorry if I usurped your work!
> 
> Noting to worry. I just was surprised how close it is to my vision ;-).
> 

Well, you might notice how extremely close it is to what Josh posted in
October in his SPMI series [1], so I can't take any credit there.

> > 
> > > > Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
> > > > Signed-off-by: Courtney Cavin <courtney.cavin@sonymobile.com>
> > > > ---
> > > >  drivers/mfd/Kconfig  | 13 +++++++++++
> > > >  drivers/mfd/Makefile |  1 +
> > > >  drivers/mfd/pm8x41.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> > > >  3 files changed, 77 insertions(+)
> > > >  create mode 100644 drivers/mfd/pm8x41.c
> > > > 
> > > 
> > > <snip>
> > > 
> > > > +
> > > > +static int pm8x41_probe(struct spmi_device *sdev)
> > > > +{
> > > > +	struct regmap *regmap;
> > > > +
> > > > +	regmap = devm_regmap_init_spmi_ext(sdev, &pm8x41_regmap_config);
> > > > +	if (IS_ERR(regmap)) {
> > > > +		dev_dbg(&sdev->dev, "regmap creation failed.\n");
> > > > +		return PTR_ERR(regmap);
> > > > +	}
> > > > +
> > > > +	return of_platform_populate(sdev->dev.of_node, NULL, NULL, &sdev->dev);
> > > 
> > > I think that this will not going to work. For example in this particular
> > > case, both controllers have "qcom,qpnp-revid" peripheral which is
> > > located at offset 0x100.
> > > 
> > > And the result is:
> > > 
> > > [    0.963944] sysfs: cannot create duplicate filename '/bus/platform/devices/100.revid'
> > > 
> > [...]
> > > 
> > > Any suggestions?
> > 
> > That's expected behavior actually.  You have two nodes in DT named the
> > same thing and at the same address.  This error is due to the fact that
> > all devices are put in '/bus/platform/devices/' with a name made from
> > the unit address and name specified in DT.  There's no other unique
> > information used to differentiate the devices.
> > 
> > If you simply change the names in DT, it works.  
> 
> Sure, it will work. But they are part of different address spaces. 
> Why we should add, IMHO, artificial requirement that names should
> be unique? Is it possible to prefix child nodes with parent device 
> address? As side note, why they should be registered on the platform
> bus at all? To be honest I don't have solution.

I agree, and it would appear that the ePAPR does as well.  Feel free to
send patches!

> > [...] qcom,qpnp-revid 100.qcom,pm8841-revid: PM8841 v2.0 options: 0, 0, 2, 2
> > [...] qcom,qpnp-revid 100.qcom,pm8941-revid: PM8941 v3.0 options: 2, 0, 0, 0
> > 
> > Whether this should be "fixed" in the device/bus/sysfs core, I don't
> > know, but it isn't specifically an issue with this driver, and there's
> > little-to-nothing I can do to fix it here.
> > 
> > -Courtney

  reply	other threads:[~2014-04-23 22:12 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-23  0:31 [PATCH 1/2] mfd: pm8x41: add support for Qualcomm 8x41 PMICs Courtney Cavin
2014-04-23  0:31 ` [PATCH 2/2] mfd: pm8x41: document device tree bindings Courtney Cavin
2014-04-23 10:50 ` [PATCH 1/2] mfd: pm8x41: add support for Qualcomm 8x41 PMICs Lee Jones
2014-04-23 17:38   ` Courtney Cavin
2014-04-23 13:19 ` Ivan T. Ivanov
2014-04-23 18:16   ` Courtney Cavin
2014-04-23 20:34     ` Ivan T. Ivanov
2014-04-23 22:12       ` Courtney Cavin [this message]
2014-04-24  2:45   ` Rob Herring
2014-04-26  0:28   ` Frank Rowand
2014-04-26  0:40     ` Courtney Cavin
2014-04-26  0:53       ` Frank Rowand
2014-04-28  7:11     ` Ivan T. Ivanov
2014-05-07 18:35   ` Rob Herring
2014-04-23 21:46 ` Josh Cartwright
2014-04-23 23:36   ` Courtney Cavin
2014-04-24 18:18     ` Josh Cartwright
2014-05-09 12:45       ` Ivan T. Ivanov
2014-05-09 20:30         ` Courtney Cavin
2014-05-10  8:06           ` Ivan T. Ivanov
2014-04-26  1:38     ` David Collins

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=20140423221200.GL17066@sonymobile.com \
    --to=courtney.cavin@sonymobile.com \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=iivanov@mm-sol.com \
    --cc=joshc@codeaurora.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sameo@linux.intel.com \
    /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).