Skip to content

Commit 4d3e55b

Browse files
amsalbyLee Jones
authored andcommitted
mfd: wm8994: Allow to configure CS/ADDR Pulldown from dts
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>
1 parent 102370f commit 4d3e55b

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎drivers/mfd/wm8994-core.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ static int wm8994_set_pdata_from_of(struct wm8994 *wm8994)
304304

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

307+
pdata->csnaddr_pd = of_property_read_bool(np, "wlf,csnaddr-pd");
308+
307309
pdata->ldo[0].enable = of_get_named_gpio(np, "wlf,ldo1ena", 0);
308310
if (pdata->ldo[0].enable < 0)
309311
pdata->ldo[0].enable = 0;
@@ -562,6 +564,8 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
562564

563565
if (pdata->spkmode_pu)
564566
pulls |= WM8994_SPKMODE_PU;
567+
if (pdata->csnaddr_pd)
568+
pulls |= WM8994_CSNADDR_PD;
565569

566570
/* Disable unneeded pulls */
567571
wm8994_set_bits(wm8994, WM8994_PULL_CONTROL_2,

‎include/linux/mfd/wm8994/pdata.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,12 @@ struct wm8994_pdata {
222222
*/
223223
bool spkmode_pu;
224224

225+
/*
226+
* CS/ADDR must be pulled internally by the device on this
227+
* system.
228+
*/
229+
bool csnaddr_pd;
230+
225231
/**
226232
* Maximum number of channels clocks will be generated for,
227233
* useful for systems where and I2S bus with multiple data

0 commit comments

Comments
 (0)