diff options
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/wm831x-core.c | 58 |
1 files changed, 18 insertions, 40 deletions
diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c index 7f27576ca046..8504c6ef4a16 100644 --- a/drivers/mfd/wm831x-core.c +++ b/drivers/mfd/wm831x-core.c | |||
@@ -90,9 +90,9 @@ int wm831x_isinkv_values[WM831X_ISINK_MAX_ISEL + 1] = { | |||
90 | EXPORT_SYMBOL_GPL(wm831x_isinkv_values); | 90 | EXPORT_SYMBOL_GPL(wm831x_isinkv_values); |
91 | 91 | ||
92 | enum wm831x_parent { | 92 | enum wm831x_parent { |
93 | WM8310 = 0, | 93 | WM8310 = 0x8310, |
94 | WM8311 = 1, | 94 | WM8311 = 0x8311, |
95 | WM8312 = 2, | 95 | WM8312 = 0x8312, |
96 | }; | 96 | }; |
97 | 97 | ||
98 | static int wm831x_reg_locked(struct wm831x *wm831x, unsigned short reg) | 98 | static int wm831x_reg_locked(struct wm831x *wm831x, unsigned short reg) |
@@ -1282,50 +1282,28 @@ static int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq) | |||
1282 | goto err; | 1282 | goto err; |
1283 | } | 1283 | } |
1284 | 1284 | ||
1285 | /* Some engineering samples do not have the ID set, rely on | ||
1286 | * the device being registered correctly. | ||
1287 | */ | ||
1288 | if (ret == 0) { | ||
1289 | dev_info(wm831x->dev, "Device is an engineering sample\n"); | ||
1290 | ret = id; | ||
1291 | } | ||
1292 | |||
1285 | switch (ret) { | 1293 | switch (ret) { |
1286 | case 0x8310: | 1294 | case WM8310: |
1287 | parent = WM8310; | 1295 | parent = WM8310; |
1288 | switch (rev) { | 1296 | dev_info(wm831x->dev, "WM8310 revision %c\n", 'A' + rev); |
1289 | case 0: | ||
1290 | dev_info(wm831x->dev, "WM8310 revision %c\n", | ||
1291 | 'A' + rev); | ||
1292 | break; | ||
1293 | } | ||
1294 | break; | 1297 | break; |
1295 | 1298 | ||
1296 | case 0x8311: | 1299 | case WM8311: |
1297 | parent = WM8311; | 1300 | parent = WM8311; |
1298 | switch (rev) { | 1301 | dev_info(wm831x->dev, "WM8311 revision %c\n", 'A' + rev); |
1299 | case 0: | ||
1300 | dev_info(wm831x->dev, "WM8311 revision %c\n", | ||
1301 | 'A' + rev); | ||
1302 | break; | ||
1303 | } | ||
1304 | break; | 1302 | break; |
1305 | 1303 | ||
1306 | case 0x8312: | 1304 | case WM8312: |
1307 | parent = WM8312; | 1305 | parent = WM8312; |
1308 | switch (rev) { | 1306 | dev_info(wm831x->dev, "WM8312 revision %c\n", 'A' + rev); |
1309 | case 0: | ||
1310 | dev_info(wm831x->dev, "WM8312 revision %c\n", | ||
1311 | 'A' + rev); | ||
1312 | break; | ||
1313 | } | ||
1314 | break; | ||
1315 | |||
1316 | case 0: | ||
1317 | /* Some engineering samples do not have the ID set, | ||
1318 | * rely on the device being registered correctly. | ||
1319 | * This will need revisiting for future devices with | ||
1320 | * multiple dies. | ||
1321 | */ | ||
1322 | parent = id; | ||
1323 | switch (rev) { | ||
1324 | case 0: | ||
1325 | dev_info(wm831x->dev, "WM831%d ES revision %c\n", | ||
1326 | parent, 'A' + rev); | ||
1327 | break; | ||
1328 | } | ||
1329 | break; | 1307 | break; |
1330 | 1308 | ||
1331 | default: | 1309 | default: |
@@ -1338,7 +1316,7 @@ static int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq) | |||
1338 | * current parts. | 1316 | * current parts. |
1339 | */ | 1317 | */ |
1340 | if (parent != id) | 1318 | if (parent != id) |
1341 | dev_warn(wm831x->dev, "Device was registered as a WM831%lu\n", | 1319 | dev_warn(wm831x->dev, "Device was registered as a WM%lx\n", |
1342 | id); | 1320 | id); |
1343 | 1321 | ||
1344 | /* Bootstrap the user key */ | 1322 | /* Bootstrap the user key */ |