summaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorOpensource [Steve Twiss] <stwiss.opensource@diasemi.com>2014-02-14 09:08:11 -0500
committerLee Jones <lee.jones@linaro.org>2014-03-19 04:58:19 -0400
commitc1d12c784c49980e4cbe57b7e6cc14b406449099 (patch)
tree8a233f057b5c277eec6985347bd3dd583ddf7b04 /drivers/mfd
parent82ae61c4b0ccfd55a31b3afc267953d0a0d416ad (diff)
mfd: da9063: Add support for production silicon variant code
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> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/da9063-core.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/mfd/da9063-core.c b/drivers/mfd/da9063-core.c
index 26937cd01071..e70ae315abc7 100644
--- a/drivers/mfd/da9063-core.c
+++ b/drivers/mfd/da9063-core.c
@@ -110,7 +110,7 @@ static const struct mfd_cell da9063_devs[] = {
110int da9063_device_init(struct da9063 *da9063, unsigned int irq) 110int da9063_device_init(struct da9063 *da9063, unsigned int irq)
111{ 111{
112 struct da9063_pdata *pdata = da9063->dev->platform_data; 112 struct da9063_pdata *pdata = da9063->dev->platform_data;
113 int model, revision; 113 int model, variant_id, variant_code;
114 int ret; 114 int ret;
115 115
116 if (pdata) { 116 if (pdata) {
@@ -141,23 +141,26 @@ int da9063_device_init(struct da9063 *da9063, unsigned int irq)
141 return -ENODEV; 141 return -ENODEV;
142 } 142 }
143 143
144 ret = regmap_read(da9063->regmap, DA9063_REG_CHIP_VARIANT, &revision); 144 ret = regmap_read(da9063->regmap, DA9063_REG_CHIP_VARIANT, &variant_id);
145 if (ret < 0) { 145 if (ret < 0) {
146 dev_err(da9063->dev, "Cannot read chip revision id.\n"); 146 dev_err(da9063->dev, "Cannot read chip variant id.\n");
147 return -EIO; 147 return -EIO;
148 } 148 }
149 revision >>= DA9063_CHIP_VARIANT_SHIFT; 149
150 if (revision != 3) { 150 variant_code = variant_id >> DA9063_CHIP_VARIANT_SHIFT;
151 dev_err(da9063->dev, "Unknown chip revision: %d\n", revision); 151
152 dev_info(da9063->dev,
153 "Device detected (chip-ID: 0x%02X, var-ID: 0x%02X)\n",
154 model, variant_id);
155
156 if (variant_code != PMIC_DA9063_BB) {
157 dev_err(da9063->dev, "Unknown chip variant code: 0x%02X\n",
158 variant_code);
152 return -ENODEV; 159 return -ENODEV;
153 } 160 }
154 161
155 da9063->model = model; 162 da9063->model = model;
156 da9063->revision = revision; 163 da9063->variant_code = variant_code;
157
158 dev_info(da9063->dev,
159 "Device detected (model-ID: 0x%02X rev-ID: 0x%02X)\n",
160 model, revision);
161 164
162 ret = da9063_irq_init(da9063); 165 ret = da9063_irq_init(da9063);
163 if (ret) { 166 if (ret) {