Skip to content

Commit

Permalink
mfd: wm8994: Allow to configure CS/ADDR Pulldown from dts
Browse files Browse the repository at this point in the history
For designs where CS/ADDR pin is floating, it is useful to
allow dts to define whether to keep internal pull down or not.

Signed-off-by: Alberto Panizzo <alberto@amarulasolutions.com>
Signed-off-by: Anthony Brandon <anthony@amarulasolutions.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
  • Loading branch information
Alberto Panizzo authored and Lee Jones committed Jul 27, 2018
1 parent 102370f commit 4d3e55b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/mfd/wm8994-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ static int wm8994_set_pdata_from_of(struct wm8994 *wm8994)

pdata->spkmode_pu = of_property_read_bool(np, "wlf,spkmode-pu");

pdata->csnaddr_pd = of_property_read_bool(np, "wlf,csnaddr-pd");

pdata->ldo[0].enable = of_get_named_gpio(np, "wlf,ldo1ena", 0);
if (pdata->ldo[0].enable < 0)
pdata->ldo[0].enable = 0;
Expand Down Expand Up @@ -562,6 +564,8 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)

if (pdata->spkmode_pu)
pulls |= WM8994_SPKMODE_PU;
if (pdata->csnaddr_pd)
pulls |= WM8994_CSNADDR_PD;

/* Disable unneeded pulls */
wm8994_set_bits(wm8994, WM8994_PULL_CONTROL_2,
Expand Down
6 changes: 6 additions & 0 deletions include/linux/mfd/wm8994/pdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ struct wm8994_pdata {
*/
bool spkmode_pu;

/*
* CS/ADDR must be pulled internally by the device on this
* system.
*/
bool csnaddr_pd;

/**
* Maximum number of channels clocks will be generated for,
* useful for systems where and I2S bus with multiple data
Expand Down

0 comments on commit 4d3e55b

Please sign in to comment.