linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC V2] mfd: da9063: Add support for production silicon variant code
@ 2014-02-14 14:08 Opensource [Steve Twiss]
  2014-02-14 16:43 ` Lee Jones
  0 siblings, 1 reply; 6+ messages in thread
From: Opensource [Steve Twiss] @ 2014-02-14 14:08 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown
  Cc: David Dajun Chen, LKML, Lee Jones, Philipp Zabel

From: Opensource [Steve Twiss] <stwiss.opensource@diasemi.com>

Add the correct silicon variant code ID (0x5) to the driver. This
new code is the 'production' variant code ID for DA9063.

This patch will remove the older variant code ID which matches the
pre-production silicon ID (0x3) for the DA9063 chip.

There is also some small amount of correction done in this patch:
it splits the revision code and correctly names it according to
the hardware specification and moves the dev_info() call before
the variant ID test.

Signed-off-by: Opensource [Steve Twiss] <stwiss.opensource@diasemi.com>
---
Checks performed with next-20140214/scripts/checkpatch.pl
 da9063-core.c             total: 0 errors, 0 warnings, 188 lines checked
 core.h                    total: 0 errors, 0 warnings, 97 lines checked
This patch applies against kernel version linux-next next-20140214

These changes are meant to be a pre-cursor to the upcoming patch set to 
support the new silicon revision.

The previous test silicon was only sent out in sample form and no longer
available. Only the production variant (0x5) of DA9063 PMIC will be
available from Dialog Semiconductor Ltd.

Changes made after RFC V1:
 - Lee Jones: https://lkml.org/lkml/2014/2/14/140
  . Removed whitespace at the top of the files
  . Removed the chip_id change since this should be made as part of a
    different patch set and it confuses the intention of this patch.



 drivers/mfd/da9063-core.c       | 25 ++++++++++++++-----------
 include/linux/mfd/da9063/core.h |  6 +++++-
 2 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/drivers/mfd/da9063-core.c b/drivers/mfd/da9063-core.c
index 26937cd..e70ae31 100644
--- a/drivers/mfd/da9063-core.c
+++ b/drivers/mfd/da9063-core.c
@@ -110,7 +110,7 @@ static const struct mfd_cell da9063_devs[] = {
 int da9063_device_init(struct da9063 *da9063, unsigned int irq)
 {
 	struct da9063_pdata *pdata = da9063->dev->platform_data;
-	int model, revision;
+	int model, variant_id, variant_code;
 	int ret;
 
 	if (pdata) {
@@ -141,23 +141,26 @@ int da9063_device_init(struct da9063 *da9063, unsigned int irq)
 		return -ENODEV;
 	}
 
-	ret = regmap_read(da9063->regmap, DA9063_REG_CHIP_VARIANT, &revision);
+	ret = regmap_read(da9063->regmap, DA9063_REG_CHIP_VARIANT, &variant_id);
 	if (ret < 0) {
-		dev_err(da9063->dev, "Cannot read chip revision id.\n");
+		dev_err(da9063->dev, "Cannot read chip variant id.\n");
 		return -EIO;
 	}
-	revision >>= DA9063_CHIP_VARIANT_SHIFT;
-	if (revision != 3) {
-		dev_err(da9063->dev, "Unknown chip revision: %d\n", revision);
+
+	variant_code = variant_id >> DA9063_CHIP_VARIANT_SHIFT;
+
+	dev_info(da9063->dev,
+		 "Device detected (chip-ID: 0x%02X, var-ID: 0x%02X)\n",
+		 model, variant_id);
+
+	if (variant_code != PMIC_DA9063_BB) {
+		dev_err(da9063->dev, "Unknown chip variant code: 0x%02X\n",
+				variant_code);
 		return -ENODEV;
 	}
 
 	da9063->model = model;
-	da9063->revision = revision;
-
-	dev_info(da9063->dev,
-		 "Device detected (model-ID: 0x%02X  rev-ID: 0x%02X)\n",
-		 model, revision);
+	da9063->variant_code = variant_code;
 
 	ret = da9063_irq_init(da9063);
 	if (ret) {
diff --git a/include/linux/mfd/da9063/core.h b/include/linux/mfd/da9063/core.h
index 2d2a0af..00a9aac 100644
--- a/include/linux/mfd/da9063/core.h
+++ b/include/linux/mfd/da9063/core.h
@@ -33,6 +33,10 @@ enum da9063_models {
 	PMIC_DA9063 = 0x61,
 };
 
+enum da9063_variant_codes {
+	PMIC_DA9063_BB = 0x5
+};
+
 /* Interrupts */
 enum da9063_irqs {
 	DA9063_IRQ_ONKEY = 0,
@@ -72,7 +76,7 @@ struct da9063 {
 	/* Device */
 	struct device	*dev;
 	unsigned short	model;
-	unsigned short	revision;
+	unsigned char	variant_code;
 	unsigned int	flags;
 
 	/* Control interface */
-- 
end-of-patch for RFC V2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [RFC V2] mfd: da9063: Add support for production silicon variant code
  2014-02-14 14:08 [RFC V2] mfd: da9063: Add support for production silicon variant code Opensource [Steve Twiss]
@ 2014-02-14 16:43 ` Lee Jones
  2014-03-14 14:37   ` Philipp Zabel
  0 siblings, 1 reply; 6+ messages in thread
From: Lee Jones @ 2014-02-14 16:43 UTC (permalink / raw)
  To: Opensource [Steve Twiss]
  Cc: Liam Girdwood, Mark Brown, David Dajun Chen, LKML, Philipp Zabel

> From: Opensource [Steve Twiss] <stwiss.opensource@diasemi.com>
> 
> Add the correct silicon variant code ID (0x5) to the driver. This
> new code is the 'production' variant code ID for DA9063.
> 
> This patch will remove the older variant code ID which matches the
> pre-production silicon ID (0x3) for the DA9063 chip.
> 
> There is also some small amount of correction done in this patch:
> it splits the revision code and correctly names it according to
> the hardware specification and moves the dev_info() call before
> the variant ID test.
> 
> Signed-off-by: Opensource [Steve Twiss] <stwiss.opensource@diasemi.com>

Applied, thanks.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC V2] mfd: da9063: Add support for production silicon variant code
  2014-02-14 16:43 ` Lee Jones
@ 2014-03-14 14:37   ` Philipp Zabel
  2014-03-17  8:33     ` Opensource [Steve Twiss]
  2014-03-19 17:14     ` Opensource [Steve Twiss]
  0 siblings, 2 replies; 6+ messages in thread
From: Philipp Zabel @ 2014-03-14 14:37 UTC (permalink / raw)
  To: Lee Jones
  Cc: Opensource [Steve Twiss],
	Liam Girdwood, Mark Brown, David Dajun Chen, LKML

Hi,

Am Freitag, den 14.02.2014, 16:43 +0000 schrieb Lee Jones:
> > From: Opensource [Steve Twiss] <stwiss.opensource@diasemi.com>
> > 
> > Add the correct silicon variant code ID (0x5) to the driver. This
> > new code is the 'production' variant code ID for DA9063.
> > 
> > This patch will remove the older variant code ID which matches the
> > pre-production silicon ID (0x3) for the DA9063 chip.
> > 
> > There is also some small amount of correction done in this patch:
> > it splits the revision code and correctly names it according to
> > the hardware specification and moves the dev_info() call before
> > the variant ID test.
> > 
> > Signed-off-by: Opensource [Steve Twiss] <stwiss.opensource@diasemi.com>
> 
> Applied, thanks.

we have a few i.MX6 Modules (imx6q-phytec-pfla02) with DA9063 PMICs that
all report the model/revision ID as 0x61/0x03. Those are marked as
follows:
    dialog DA9063 44 1240EHDA
    dialog DA9063 44 1312ECAF
We now have received a report from Phytec that those PMICs were not
marketed as preproduction in any way, but as a normal mask revision.
Their Dialog Semiconductor contact talked about AD, BA, and BB silicon
variants. How do those relate to the variant register value and to the
markings on the chips?
There seems to be a serious miscommunication somewhere.

regards
Philipp


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [RFC V2] mfd: da9063: Add support for production silicon variant code
  2014-03-14 14:37   ` Philipp Zabel
@ 2014-03-17  8:33     ` Opensource [Steve Twiss]
  2014-03-19 17:14     ` Opensource [Steve Twiss]
  1 sibling, 0 replies; 6+ messages in thread
From: Opensource [Steve Twiss] @ 2014-03-17  8:33 UTC (permalink / raw)
  To: Philipp Zabel, Lee Jones
  Cc: Liam Girdwood, Mark Brown, David Dajun Chen, LKML

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1635 bytes --]

On 14 March 2014 14:37 Philipp Zabel wrote:

>Hi,
>
>Am Freitag, den 14.02.2014, 16:43 +0000 schrieb Lee Jones:
>> > From: Opensource [Steve Twiss] <stwiss.opensource@diasemi.com>
>> >
>> > Add the correct silicon variant code ID (0x5) to the driver. This
>> > new code is the 'production' variant code ID for DA9063.
>> >
>> > This patch will remove the older variant code ID which matches the
>> > pre-production silicon ID (0x3) for the DA9063 chip.
>> >
>> > There is also some small amount of correction done in this patch:
>> > it splits the revision code and correctly names it according to
>> > the hardware specification and moves the dev_info() call before
>> > the variant ID test.
>> >
>> > Signed-off-by: Opensource [Steve Twiss] <stwiss.opensource@diasemi.com>
>>
>> Applied, thanks.
>
>we have a few i.MX6 Modules (imx6q-phytec-pfla02) with DA9063 PMICs that
>all report the model/revision ID as 0x61/0x03. Those are marked as
>follows:
>    dialog DA9063 44 1240EHDA
>    dialog DA9063 44 1312ECAF
>We now have received a report from Phytec that those PMICs were not
>marketed as preproduction in any way, but as a normal mask revision.

I will speak with our AEs this morning and try and get an answer to this one.

>Their Dialog Semiconductor contact talked about AD, BA, and BB silicon
>variants. How do those relate to the variant register value and to the
>markings on the chips?
>There seems to be a serious miscommunication somewhere.

Regards,
Steve

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [RFC V2] mfd: da9063: Add support for production silicon variant code
  2014-03-14 14:37   ` Philipp Zabel
  2014-03-17  8:33     ` Opensource [Steve Twiss]
@ 2014-03-19 17:14     ` Opensource [Steve Twiss]
  2014-03-20 15:23       ` Robert Schwebel
  1 sibling, 1 reply; 6+ messages in thread
From: Opensource [Steve Twiss] @ 2014-03-19 17:14 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Liam Girdwood, Lee Jones, Mark Brown, David Dajun Chen, LKML

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1846 bytes --]

On 17 March 2014 08:34, Steve Twiss wrote:

>On 14 March 2014 14:37 Philipp Zabel wrote:
>>Am Freitag, den 14.02.2014, 16:43 +0000 schrieb Lee Jones:
>>> > From: Opensource [Steve Twiss] <stwiss.opensource@diasemi.com>
>>> >
>>> > Add the correct silicon variant code ID (0x5) to the driver. This
>>> > new code is the 'production' variant code ID for DA9063.
>>> >
>>> > This patch will remove the older variant code ID which matches the
>>> > pre-production silicon ID (0x3) for the DA9063 chip.
>>> >
>>> > There is also some small amount of correction done in this patch:
>>> > it splits the revision code and correctly names it according to
>>> > the hardware specification and moves the dev_info() call before
>>> > the variant ID test.
>>> >
>>> > Signed-off-by: Opensource [Steve Twiss] <stwiss.opensource@diasemi.com>
>>>
>>> Applied, thanks.
>>
>>we have a few i.MX6 Modules (imx6q-phytec-pfla02) with DA9063 PMICs that
>>all report the model/revision ID as 0x61/0x03. Those are marked as
>>follows:
>>    dialog DA9063 44 1240EHDA
>>    dialog DA9063 44 1312ECAF
>>We now have received a report from Phytec that those PMICs were not
>>marketed as preproduction in any way, but as a normal mask revision.
>>Their Dialog Semiconductor contact talked about AD, BA, and BB silicon
>>variants. How do those relate to the variant register value and to the
>>markings on the chips?
>>There seems to be a serious miscommunication somewhere.
>
>I will speak with our AEs this morning and try and get an answer to this one.

Hi Philipp,

Phytec informs us that you already asked them for this and have confirmed
that you should have all necessary information now

Best regards,
Steve

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC V2] mfd: da9063: Add support for production silicon variant code
  2014-03-19 17:14     ` Opensource [Steve Twiss]
@ 2014-03-20 15:23       ` Robert Schwebel
  0 siblings, 0 replies; 6+ messages in thread
From: Robert Schwebel @ 2014-03-20 15:23 UTC (permalink / raw)
  To: Opensource [Steve Twiss]
  Cc: Philipp Zabel, Liam Girdwood, Lee Jones, Mark Brown,
	David Dajun Chen, LKML

Hi Steve,

On Wed, Mar 19, 2014 at 05:14:54PM +0000, Opensource [Steve Twiss] wrote:
> > > > > This patch will remove the older variant code ID which matches the
> > > > > pre-production silicon ID (0x3) for the DA9063 chip.

[...]

> > > we have a few i.MX6 Modules (imx6q-phytec-pfla02) with DA9063 PMICs that
> > > all report the model/revision ID as 0x61/0x03. Those are marked as
> > > follows:
> > >    dialog DA9063 44 1240EHDA
> > >    dialog DA9063 44 1312ECAF
> > >
> > > We now have received a report from Phytec that those PMICs were not
> > > marketed as preproduction in any way, but as a normal mask revision.
> > > Their Dialog Semiconductor contact talked about AD, BA, and BB silicon
> > > variants. How do those relate to the variant register value and to the
> > > markings on the chips?
> > >
> > > There seems to be a serious miscommunication somewhere.

[...]

> Phytec informs us that you already asked them for this and have
> confirmed that you should have all necessary information now

No, it's completely unclear:

a) You said above that the 0x3 silicon is pre-production and thus you
   removed that from the kernel.

b) Phytec says you didn't mark the PMICs as preproduction in any way.

The question is still, which one is correct? If a), I'm wondering why
Phytec didn't get that information. If b), the 0x3 variant must not be
removed from the kernel.

Could you clarify that?

rsc
-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-03-20 15:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-14 14:08 [RFC V2] mfd: da9063: Add support for production silicon variant code Opensource [Steve Twiss]
2014-02-14 16:43 ` Lee Jones
2014-03-14 14:37   ` Philipp Zabel
2014-03-17  8:33     ` Opensource [Steve Twiss]
2014-03-19 17:14     ` Opensource [Steve Twiss]
2014-03-20 15:23       ` Robert Schwebel

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).