Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176020
b: refs/heads/master
c: 894362f
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown authored and Samuel Ortiz committed Dec 13, 2009
1 parent e09395d commit 2f08ee3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 41 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 29f02646f0fa2b3c3a91f9145653e6a6ae8e7eb1
refs/heads/master: 894362f53164f93d609559e196378b4d0710c2dd
58 changes: 18 additions & 40 deletions trunk/drivers/mfd/wm831x-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ int wm831x_isinkv_values[WM831X_ISINK_MAX_ISEL + 1] = {
EXPORT_SYMBOL_GPL(wm831x_isinkv_values);

enum wm831x_parent {
WM8310 = 0,
WM8311 = 1,
WM8312 = 2,
WM8310 = 0x8310,
WM8311 = 0x8311,
WM8312 = 0x8312,
};

static int wm831x_reg_locked(struct wm831x *wm831x, unsigned short reg)
Expand Down Expand Up @@ -1282,50 +1282,28 @@ static int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq)
goto err;
}

/* Some engineering samples do not have the ID set, rely on
* the device being registered correctly.
*/
if (ret == 0) {
dev_info(wm831x->dev, "Device is an engineering sample\n");
ret = id;
}

switch (ret) {
case 0x8310:
case WM8310:
parent = WM8310;
switch (rev) {
case 0:
dev_info(wm831x->dev, "WM8310 revision %c\n",
'A' + rev);
break;
}
dev_info(wm831x->dev, "WM8310 revision %c\n", 'A' + rev);
break;

case 0x8311:
case WM8311:
parent = WM8311;
switch (rev) {
case 0:
dev_info(wm831x->dev, "WM8311 revision %c\n",
'A' + rev);
break;
}
dev_info(wm831x->dev, "WM8311 revision %c\n", 'A' + rev);
break;

case 0x8312:
case WM8312:
parent = WM8312;
switch (rev) {
case 0:
dev_info(wm831x->dev, "WM8312 revision %c\n",
'A' + rev);
break;
}
break;

case 0:
/* Some engineering samples do not have the ID set,
* rely on the device being registered correctly.
* This will need revisiting for future devices with
* multiple dies.
*/
parent = id;
switch (rev) {
case 0:
dev_info(wm831x->dev, "WM831%d ES revision %c\n",
parent, 'A' + rev);
break;
}
dev_info(wm831x->dev, "WM8312 revision %c\n", 'A' + rev);
break;

default:
Expand All @@ -1338,7 +1316,7 @@ static int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq)
* current parts.
*/
if (parent != id)
dev_warn(wm831x->dev, "Device was registered as a WM831%lu\n",
dev_warn(wm831x->dev, "Device was registered as a WM%lx\n",
id);

/* Bootstrap the user key */
Expand Down

0 comments on commit 2f08ee3

Please sign in to comment.