Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283934
b: refs/heads/master
c: 7ed5849
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown committed Dec 12, 2011
1 parent 2e52990 commit f8bceaa
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 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: 19f9557174d61fcfe132a6846a83c36437ff014e
refs/heads/master: 7ed5849c2861faf9c13f027868f635bd782a50e5
12 changes: 7 additions & 5 deletions trunk/drivers/mfd/wm8994-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,30 +446,32 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
ret);
goto err_enable;
}
wm8994->revision = ret;

switch (wm8994->type) {
case WM8994:
switch (ret) {
switch (wm8994->revision) {
case 0:
case 1:
dev_warn(wm8994->dev,
"revision %c not fully supported\n",
'A' + ret);
'A' + wm8994->revision);
break;
default:
break;
}
break;
case WM1811:
/* Revision C did not change the relevant layer */
if (ret > 1)
ret++;
if (wm8994->revision > 1)
wm8994->revision++;
break;
default:
break;
}

dev_info(wm8994->dev, "%s revision %c\n", devname, 'A' + ret);
dev_info(wm8994->dev, "%s revision %c\n", devname,
'A' + wm8994->revision);

switch (wm8994->type) {
case WM1811:
Expand Down
19 changes: 17 additions & 2 deletions trunk/drivers/mfd/wm8994-regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*
*/

#include <linux/mfd/wm8994/core.h>
#include <linux/mfd/wm8994/registers.h>
#include <linux/regmap.h>

Expand Down Expand Up @@ -210,7 +211,6 @@ static struct reg_default wm1811_defaults[] = {
{ 0x0702, 0xA101 }, /* R1794 - Pull Control (BCLK2) */
{ 0x0703, 0xA101 }, /* R1795 - Pull Control (DACLRCLK2) */
{ 0x0704, 0xA101 }, /* R1796 - Pull Control (DACDAT2) */
{ 0x0705, 0xA101 }, /* R1797 - GPIO 6 */
{ 0x0707, 0xA101 }, /* R1799 - GPIO 8 */
{ 0x0708, 0xA101 }, /* R1800 - GPIO 9 */
{ 0x0709, 0xA101 }, /* R1801 - GPIO 10 */
Expand Down Expand Up @@ -1145,6 +1145,21 @@ static bool wm8994_volatile_register(struct device *dev, unsigned int reg)
}
}

static bool wm1811_volatile_register(struct device *dev, unsigned int reg)
{
struct wm8994 *wm8994 = dev_get_drvdata(dev);

switch (reg) {
case WM8994_GPIO_6:
if (wm8994->revision > 1)
return true;
else
return false;
default:
return wm8994_volatile_register(dev, reg);
}
}

static bool wm8958_volatile_register(struct device *dev, unsigned int reg)
{
switch (reg) {
Expand Down Expand Up @@ -1185,7 +1200,7 @@ struct regmap_config wm1811_regmap_config = {
.num_reg_defaults = ARRAY_SIZE(wm1811_defaults),

.max_register = WM8994_MAX_REGISTER,
.volatile_reg = wm8994_volatile_register,
.volatile_reg = wm1811_volatile_register,
.readable_reg = wm1811_readable_register,
};

Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/mfd/wm8994/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ struct wm8994 {
struct mutex irq_lock;

enum wm8994_type type;
int revision;

struct device *dev;
struct regmap *regmap;
Expand Down

0 comments on commit f8bceaa

Please sign in to comment.