The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Wadim Egorov <w.egorov@phytec.de>
To: linux-kernel@vger.kernel.org, broonie@kernel.org
Cc: lgirdwood@gmail.com
Subject: [PATCH 2/2] regulator: fan53555: Add support for FAN53555UC13X type
Date: Wed, 20 Apr 2016 10:01:08 +0200	[thread overview]
Message-ID: <1461139268-45957-2-git-send-email-w.egorov@phytec.de> (raw)
In-Reply-To: <1461139268-45957-1-git-send-email-w.egorov@phytec.de>

IC type options 00, 13 and 23 are sharing the same DIE_ID 0.
Let's differentiate between these revisions.
FAN53555UC13X has the ID 0 and REV 0xf, starts at 800mV and
increments in 10mV steps.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
---
 drivers/regulator/fan53555.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
index d4bfa93..d7da81a 100644
--- a/drivers/regulator/fan53555.c
+++ b/drivers/regulator/fan53555.c
@@ -68,6 +68,12 @@ enum {
 	FAN53555_CHIP_ID_08 = 8,
 };
 
+/* IC mask revision */
+enum {
+	FAN53555_CHIP_REV_00 = 0x3,
+	FAN53555_CHIP_REV_13 = 0xf,
+};
+
 enum {
 	SILERGY_SYR82X = 8,
 };
@@ -218,6 +224,22 @@ static int fan53555_voltages_setup_fairchild(struct fan53555_device_info *di)
 	/* Init voltage range and step */
 	switch (di->chip_id) {
 	case FAN53555_CHIP_ID_00:
+		switch (di->chip_rev) {
+		case FAN53555_CHIP_REV_00:
+			di->vsel_min = 600000;
+			di->vsel_step = 10000;
+			break;
+		case FAN53555_CHIP_REV_13:
+			di->vsel_min = 800000;
+			di->vsel_step = 10000;
+			break;
+		default:
+			dev_err(di->dev,
+				"Chip ID %d with rev %d not supported!\n",
+				di->chip_id, di->chip_rev);
+			return -EINVAL;
+		}
+		break;
 	case FAN53555_CHIP_ID_01:
 	case FAN53555_CHIP_ID_03:
 	case FAN53555_CHIP_ID_05:
-- 
1.9.1

  reply	other threads:[~2016-04-20  8:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-20  8:01 [PATCH 1/2] regulator: fan53555: Add support for FAN53555BUC18X type Wadim Egorov
2016-04-20  8:01 ` Wadim Egorov [this message]
2016-04-20 16:20   ` Applied "regulator: fan53555: Add support for FAN53555UC13X type" to the regulator tree Mark Brown
2016-04-20 16:20 ` Applied "regulator: fan53555: Add support for FAN53555BUC18X " Mark Brown

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=1461139268-45957-2-git-send-email-w.egorov@phytec.de \
    --to=w.egorov@phytec.de \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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