Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114291
b: refs/heads/master
c: bcdd4ef
h: refs/heads/master
i:
  114289: 6d53592
  114287: a7c5539
v: v3
  • Loading branch information
Mark Brown authored and Liam Girdwood committed Oct 13, 2008
1 parent 71ff6f3 commit 0a5c17d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 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: 0e7203933224cbe09b5a9125f55b177b8dd5b1bd
refs/heads/master: bcdd4efc1b6b8b98f30e127115f4bc7bbcd6f7ce
12 changes: 11 additions & 1 deletion trunk/drivers/mfd/wm8350-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ static int wm8350_create_cache(struct wm8350 *wm8350, int mode)
}
EXPORT_SYMBOL_GPL(wm8350_create_cache);

int wm8350_device_init(struct wm8350 *wm8350)
int wm8350_device_init(struct wm8350 *wm8350,
struct wm8350_platform_data *pdata)
{
int ret = -EINVAL;
u16 id1, id2, mask, mode;
Expand Down Expand Up @@ -439,6 +440,15 @@ int wm8350_device_init(struct wm8350 *wm8350)
return ret;
}

if (pdata->init) {
ret = pdata->init(wm8350);
if (ret != 0) {
dev_err(wm8350->dev, "Platform init() failed: %d\n",
ret);
goto err;
}
}

return 0;

err:
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/mfd/wm8350-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static int wm8350_i2c_probe(struct i2c_client *i2c,
wm8350->read_dev = wm8350_i2c_read_device;
wm8350->write_dev = wm8350_i2c_write_device;

ret = wm8350_device_init(wm8350);
ret = wm8350_device_init(wm8350, i2c->dev.platform_data);
if (ret < 0)
goto err;

Expand Down
14 changes: 13 additions & 1 deletion trunk/include/linux/mfd/wm8350/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -564,10 +564,22 @@ struct wm8350 {
u16 *reg_cache;
};

/**
* Data to be supplied by the platform to initialise the WM8350.
*
* @init: Function called during driver initialisation. Should be
* used by the platform to configure GPIO functions and similar.
*/
struct wm8350_platform_data {
int (*init)(struct wm8350 *wm8350);
};


/*
* WM8350 device initialisation and exit.
*/
int wm8350_device_init(struct wm8350 *wm8350);
int wm8350_device_init(struct wm8350 *wm8350,
struct wm8350_platform_data *pdata);
void wm8350_device_exit(struct wm8350 *wm8350);

/*
Expand Down

0 comments on commit 0a5c17d

Please sign in to comment.