Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1550720

Re: [PATCH V5 4/8] mfd: da9061: MFD core support

Path csiph.com!eternal-september.org!feeder.eternal-september.org!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Lee Jones <lee.jones@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH V5 4/8] mfd: da9061: MFD core support
Date Wed, 04 Jan 2017 13:30:02 +0100
Message-ID <sVSRA-4Ct-29@gated-at.bofh.it> (permalink)
References <sOK2K-1nh-15@gated-at.bofh.it> <sOKcq-1qS-27@gated-at.bofh.it> <sVQG6-3e8-15@gated-at.bofh.it> <sVSHU-4z2-11@gated-at.bofh.it>
X-Original-To Steve Twiss <stwiss.opensource@diasemi.com>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=eRcOw0sTksM5PROCnR7wKgQS5mkicIeGfsP4SeQwsLo=; b=NKe6cu0dTSegkxJopty2sZ/9doA5omtJbVwM34sgJQTdM6dEtmZDHgtgiiDeq0oEmu rl67pG9FpjOUma0lp9G2pCwuXyI15ceAFSz9fsI2/wzKK6wFn1TWBJ7kPbR7XMBosOYF w6SnqqWGXh1fcImLK3xuQK3pX30vruSYLUcPA=
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=eRcOw0sTksM5PROCnR7wKgQS5mkicIeGfsP4SeQwsLo=; b=QztzFpyHHwz3Kt06fhJduiSIVZBJ5ieiNAHJfpmyl3B/b4nNj0Uz2rnaa9l/y9LDo6 bdv/XMRMGab1BskLGphmBgqe3dkE5JQXqXPhp0CH+PbL162QdYpozPXnlXJrW7/4ss+U MZ7yyBgf+5Gih2HHdW37H2jtGfjuzopDG/iYwALR1hrKcAuH/+uF70Mx3nZ8n+CmnJDI hEMQupMduYjExpxRvdYOQcI5rPkfzgIMd3Y80fFQ0a2/G4pRtrM7iDV6Gp7mGX0Wve0/ ftTsic80rVH9r1RsQrh/zGEAkjDT8VScqzhMAnYkois69AtdIqZMyU/QK9oEpybHP8Dg CqyA==
X-Gm-Message-State AIkVDXIItuXLhWNc8C57o9+0rYbwrbEmhfNGgxmVhNGKuacTxUSU/9eGfr5PzPzDGqVzumRb
X-Received by 10.194.66.37 with SMTP id c5mr55964122wjt.138.1483532087223; Wed, 04 Jan 2017 04:14:47 -0800 (PST)
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Disposition inline
Content-Transfer-Encoding 8bit
User-Agent Mutt/1.6.2 (2016-07-01)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 68
Organization linux.* mail to news gateway
X-Original-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>
X-Original-Date Wed, 4 Jan 2017 12:18:30 +0000
X-Original-Message-ID <20170104121830.GB24225@dell>
X-Original-References <cover.1481828921.git.stwiss.opensource@diasemi.com> <ad649a91daa6191f2385dfe79c6ec8ca339f597c.1481828921.git.stwiss.opensource@diasemi.com> <20170104101221.GT27589@dell> <6ED8E3B22081A4459DAC7699F3695FB7018CD3BBC9@SW-EX-MBX02.diasemi.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1550720

Show key headers only | View raw


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

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: [PATCH V5 4/8] mfd: da9061: MFD core support Lee Jones <lee.jones@linaro.org> - 2017-01-04 11:10 +0100
  RE: [PATCH V5 4/8] mfd: da9061: MFD core support Steve Twiss <stwiss.opensource@diasemi.com> - 2017-01-04 13:20 +0100
    Re: [PATCH V5 4/8] mfd: da9061: MFD core support Lee Jones <lee.jones@linaro.org> - 2017-01-04 13:30 +0100

csiph-web