diff options
author | Chao Xie <chao.xie@marvell.com> | 2013-06-14 01:21:51 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-06-18 03:41:10 -0400 |
commit | 03dcc544bff9ff36b9ac5e2b992a7a4890e6edc4 (patch) | |
tree | 06dd1030dc9875f099c93674296e2b40cce3ee06 /drivers/mfd/88pm805.c | |
parent | 52705344d00512f0bb48c66478582bd10eb1750f (diff) |
mfd: 88pm80x: Change chip id definition and detection
Change the chip id definition and detection and then:
1. We no longer need to add PM800_CHIP_XXX for the coming revision.
2. We no longer need to pass driver_data in i2c_device_id as we
can distinguish the chips from the CHIP_ID register.
Signed-off-by: Chao Xie <chao.xie@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/88pm805.c')
-rw-r--r-- | drivers/mfd/88pm805.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/mfd/88pm805.c b/drivers/mfd/88pm805.c index 0e82c2a1e842..521602231c7b 100644 --- a/drivers/mfd/88pm805.c +++ b/drivers/mfd/88pm805.c | |||
@@ -29,10 +29,8 @@ | |||
29 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
30 | #include <linux/delay.h> | 30 | #include <linux/delay.h> |
31 | 31 | ||
32 | #define PM805_CHIP_ID (0x00) | ||
33 | |||
34 | static const struct i2c_device_id pm80x_id_table[] = { | 32 | static const struct i2c_device_id pm80x_id_table[] = { |
35 | {"88PM805", CHIP_PM805}, | 33 | {"88PM805", 0}, |
36 | {} /* NULL terminated */ | 34 | {} /* NULL terminated */ |
37 | }; | 35 | }; |
38 | MODULE_DEVICE_TABLE(i2c, pm80x_id_table); | 36 | MODULE_DEVICE_TABLE(i2c, pm80x_id_table); |
@@ -192,7 +190,6 @@ static struct regmap_irq_chip pm805_irq_chip = { | |||
192 | static int device_805_init(struct pm80x_chip *chip) | 190 | static int device_805_init(struct pm80x_chip *chip) |
193 | { | 191 | { |
194 | int ret = 0; | 192 | int ret = 0; |
195 | unsigned int val; | ||
196 | struct regmap *map = chip->regmap; | 193 | struct regmap *map = chip->regmap; |
197 | 194 | ||
198 | if (!map) { | 195 | if (!map) { |
@@ -200,13 +197,6 @@ static int device_805_init(struct pm80x_chip *chip) | |||
200 | return -EINVAL; | 197 | return -EINVAL; |
201 | } | 198 | } |
202 | 199 | ||
203 | ret = regmap_read(map, PM805_CHIP_ID, &val); | ||
204 | if (ret < 0) { | ||
205 | dev_err(chip->dev, "Failed to read CHIP ID: %d\n", ret); | ||
206 | goto out_irq_init; | ||
207 | } | ||
208 | chip->version = val; | ||
209 | |||
210 | chip->regmap_irq_chip = &pm805_irq_chip; | 200 | chip->regmap_irq_chip = &pm805_irq_chip; |
211 | 201 | ||
212 | ret = device_irq_init_805(chip); | 202 | ret = device_irq_init_805(chip); |
@@ -239,7 +229,7 @@ static int pm805_probe(struct i2c_client *client, | |||
239 | struct pm80x_chip *chip; | 229 | struct pm80x_chip *chip; |
240 | struct pm80x_platform_data *pdata = client->dev.platform_data; | 230 | struct pm80x_platform_data *pdata = client->dev.platform_data; |
241 | 231 | ||
242 | ret = pm80x_init(client, id); | 232 | ret = pm80x_init(client); |
243 | if (ret) { | 233 | if (ret) { |
244 | dev_err(&client->dev, "pm805_init fail!\n"); | 234 | dev_err(&client->dev, "pm805_init fail!\n"); |
245 | goto out_init; | 235 | goto out_init; |
@@ -249,7 +239,7 @@ static int pm805_probe(struct i2c_client *client, | |||
249 | 239 | ||
250 | ret = device_805_init(chip); | 240 | ret = device_805_init(chip); |
251 | if (ret) { | 241 | if (ret) { |
252 | dev_err(chip->dev, "%s id 0x%x failed!\n", __func__, chip->id); | 242 | dev_err(chip->dev, "Failed to initialize 88pm805 devices\n"); |
253 | goto err_805_init; | 243 | goto err_805_init; |
254 | } | 244 | } |
255 | 245 | ||