From: Lee Jones <lee.jones@linaro.org>
To: Steve Twiss <stwiss.opensource@diasemi.com>
Cc: LINUX-KERNEL <linux-kernel@vger.kernel.org>,
DEVICETREE <devicetree@vger.kernel.org>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Eduardo Valentin <edubezval@gmail.com>,
Guenter Roeck <linux@roeck-us.net>,
LINUX-INPUT <linux-input@vger.kernel.org>,
LINUX-PM <linux-pm@vger.kernel.org>,
LINUX-WATCHDOG <linux-watchdog@vger.kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Rob Herring <robh+dt@kernel.org>,
Support Opensource <Support.Opensource@diasemi.com>,
Wim Van Sebroeck <wim@iguana.be>, Zhang Rui <rui.zhang@intel.com>
Subject: Re: [PATCH V5 4/8] mfd: da9061: MFD core support
Date: Wed, 4 Jan 2017 12:18:30 +0000 [thread overview]
Message-ID: <20170104121830.GB24225@dell> (raw)
In-Reply-To: <6ED8E3B22081A4459DAC7699F3695FB7018CD3BBC9@SW-EX-MBX02.diasemi.com>
On Wed, 04 Jan 2017, Steve Twiss wrote:
> Hi Lee,
>
> On 04 January 2017 10:12, Lee Jones wrote:
>
> > Subject: Re: [PATCH V5 4/8] mfd: da9061: MFD core support
> > On Thu, 15 Dec 2016, Steve Twiss wrote:
> > > From: Steve Twiss <stwiss.opensource@diasemi.com>
>
> [...]
>
> > > +static const struct of_device_id da9062_dt_ids[] = {
> > > + { .compatible = "dlg,da9061", .data = (void *)COMPAT_TYPE_DA9061,
> > },
> > > + { .compatible = "dlg,da9062", .data = (void *)COMPAT_TYPE_DA9062,
> > },
> >
> > It looks like this device can dynamically obtain this information from
> > the device. Please use that method instead.
>
> As I mentioned in an earlier post,
> https://lkml.org/lkml/2016/11/7/418
>
> The 61/62 device type has been defined by the device tree in this case, and
> that definition is used to set the register map. With the regmap defined,
> access to the registers is then possible.
>
> It is not possible to detect the device type automatically in this case because
> it suggests a predefined regmap.
>
> This is the reason I define the chip type (DA9061 or DA9062) in the device
> tree and then assign the correct regmap first before accessing any registers.
Well at least I'm consistent. :D
> > > + if (i2c->dev.of_node) {
> > > + match = of_match_node(da9062_dt_ids, i2c->dev.of_node);
> > > + if (!match)
> > > + return -EINVAL;
> > > +
> > > + chip->chip_type = (int)match->data;
> > > + } else
> > > + chip->chip_type = id->driver_data;
> >
> > Please obtain this information from DA9062AA_VARIANT_ID.
>
> The variant ID does contain the information about whether it is a 61 or 62, but
> in order to read the register the regmap definition needs to be defined
> first.
>
> [...]
>
> > > static const struct i2c_device_id da9062_i2c_id[] = {
> > > - { "da9062", 0 },
> > > + { "da9061", COMPAT_TYPE_DA9061 },
> > > + { "da9062", COMPAT_TYPE_DA9062 },
> >
> > This too.
>
> Regards,
> Steve
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2017-01-04 12:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-15 19:08 [PATCH V5 0/8] da9061: DA9061 driver submission Steve Twiss
2016-12-15 19:08 ` [PATCH V5 2/8] Documentation: devicetree: thermal: da9062/61 TJUNC temperature binding Steve Twiss
2016-12-19 22:28 ` Rob Herring
2016-12-15 19:08 ` [PATCH V5 3/8] Documentation: devicetree: mfd: da9062/61 MFD binding Steve Twiss
2016-12-15 19:08 ` [PATCH V5 1/8] Documentation: devicetree: watchdog: da9062/61 watchdog timer binding Steve Twiss
2016-12-15 19:08 ` [PATCH V5 5/8] regulator: da9061: BUCK and LDO regulator driver Steve Twiss
2016-12-15 19:08 ` [PATCH V5 4/8] mfd: da9061: MFD core support Steve Twiss
2017-01-04 10:12 ` Lee Jones
2017-01-04 12:07 ` Steve Twiss
2017-01-04 12:18 ` Lee Jones [this message]
2017-01-04 12:19 ` Lee Jones
2016-12-15 19:08 ` [PATCH V5 8/8] MAINTAINERS: da9062/61 updates to the Dialog Semiconductor search terms Steve Twiss
2016-12-15 19:08 ` [PATCH V5 6/8] watchdog: da9062/61: watchdog driver Steve Twiss
2016-12-15 19:08 ` [PATCH V5 7/8] thermal: da9062/61: Thermal junction temperature monitoring driver Steve Twiss
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=20170104121830.GB24225@dell \
--to=lee.jones@linaro.org \
--cc=Support.Opensource@diasemi.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=edubezval@gmail.com \
--cc=lgirdwood@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
--cc=rui.zhang@intel.com \
--cc=stwiss.opensource@diasemi.com \
--cc=wim@iguana.be \
/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).