Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 251922
b: refs/heads/master
c: 0b14c22
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown authored and Samuel Ortiz committed May 26, 2011
1 parent 2bdfda0 commit 076a0fe
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 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: 8997619a045bef5d138f0f45141a398557f809e6
refs/heads/master: 0b14c22ea1e0226d894df76176971d06e8886aa7
13 changes: 12 additions & 1 deletion trunk/drivers/mfd/wm831x-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,7 @@ int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq)
struct wm831x_pdata *pdata = wm831x->dev->platform_data;
int rev;
enum wm831x_parent parent;
int ret;
int ret, i;

mutex_init(&wm831x->io_lock);
mutex_init(&wm831x->key_lock);
Expand Down Expand Up @@ -1581,6 +1581,17 @@ int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq)
}
}

if (pdata) {
for (i = 0; i < ARRAY_SIZE(pdata->gpio_defaults); i++) {
if (!pdata->gpio_defaults[i])
continue;

wm831x_reg_write(wm831x,
WM831X_GPIO1_CONTROL + i,
pdata->gpio_defaults[i] & 0xffff);
}
}

ret = wm831x_irq_init(wm831x, irq);
if (ret != 0)
goto err;
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/mfd/wm831x/pdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ struct wm831x_watchdog_pdata {
#define WM831X_MAX_LDO 11
#define WM831X_MAX_ISINK 2

#define WM831X_GPIO_CONFIGURE 0x10000
#define WM831X_GPIO_NUM 16

struct wm831x_pdata {
/** Used to distinguish multiple WM831x chips */
int wm831x_num;
Expand All @@ -119,6 +122,7 @@ struct wm831x_pdata {

int irq_base;
int gpio_base;
int gpio_defaults[WM831X_GPIO_NUM];
struct wm831x_backlight_pdata *backlight;
struct wm831x_backup_pdata *backup;
struct wm831x_battery_pdata *battery;
Expand Down

0 comments on commit 076a0fe

Please sign in to comment.