mfd: wm8994: Add device ID data to WM8994 OF device IDs
Subsystems (4)
PATCH 1/2 mfd: wm8994: Add device ID data to WM8994 OF device IDs
We can actually read this back from the device but we use this when registered using standard I2C board data registration so make sure it's there for OF too.
--- drivers/mfd/wm8994-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/mfd/wm8994-core.c +3 -3
@@ -673,9 +673,9 @@ static void wm8994_device_exit(struct wm8994 *wm8994) }static const struct of_device_id wm8994_of_match[] = { - { .compatible ="wlf,wm1811" , }, - { .compatible ="wlf,wm8994" , }, - { .compatible ="wlf,wm8958" , }, + { .compatible ="wlf,wm1811" , .data = (void *)WM1811 }, + { .compatible ="wlf,wm8994" , .data = (void *)WM8994 }, + { .compatible ="wlf,wm8958" , .data = (void *)WM8958 }, { } };MODULE_DEVICE_TABLE (of, wm8994_of_match);
Signature · 1 line
1.7.10.4
PATCH 2/2 mfd: wm8994: Add some OF properties
Add properties for some of the more important bits of platform data and fill out the binding document.
Not all of the current platform data is suitable for the sort of fixed configuration that is done using DT, some of it should have runtime mechanisms added instead and some is unlikely to ever be used in practical systems.
--- Documentation/devicetree/bindings/sound/wm8994.txt | 58 ++++++++++++++- drivers/mfd/wm8994-core.c | 75 +++++++++++++++++++- 2 files changed, 130 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/sound/wm8994.txt +57 -1
@@ -5,14 +5,70 @@ on the board). Required properties: - - compatible : "wlf,wm1811", "wlf,wm8994", "wlf,wm8958" + - compatible : One of "wlf,wm1811", "wlf,wm8994" or "wlf,wm8958" - reg : the I2C address of the device for I2C, the chip select number for SPI. + - gpio-controller : Indicates this device is a GPIO controller. + - #gpio-cells : Must be 2. The first cell is the pin number and the + second cell is used to specify optional parameters (currently unused). + + - AVDD2-supply, DBVDD1-supply, DBVDD2-supply, DBVDD3-supply, CPVDD-supply, + SPKVDD1-supply, SPKVDD2-supply : power supplies for the device, as covered + in Documentation/devicetree/bindings/regulator/regulator.txt + +Optional properties: + + - interrupts : The interrupt line the IRQ signal for the device is + connected to. This is optional, if it is not connected then none + of the interrupt related properties should be specified. + - interrupt-controller : These devices contain interrupt controllers + and may provide interrupt services to other devices if they have an + interrupt line connected. + - interrupt-parent : The parent interrupt controller. + - #interrupt-cells: the number of cells to describe an IRQ, this should be 2. + The first cell is the IRQ number. + The second cell is the flags, encoded as the trigger masks from + Documentation/devicetree/bindings/interrupts.txt + + - wlf,gpio-cfg : A list of GPIO configuration register values. If absent, + no configuration of these registers is performed. If any value is + over 0xffff then the register will be left as default. If present 11 + values must be supplied. + + - wlf,micbias-cfg : Two MICBIAS register values for WM1811 or + WM8958. If absent the register defaults will be used. + + - wlf,ldo1ena : GPIO specifier for control of LDO1ENA input to device. + - wlf,ldo2ena : GPIO specifier for control of LDO2ENA input to device. + + - wlf,lineout1-se : If present LINEOUT1 is in single ended mode. + - wlf,lineout2-se : If present LINEOUT2 is in single ended mode. + + - wlf,lineout1-feedback : If present LINEOUT1 has common mode feedback + connected. + - wlf,lineout2-feedback : If present LINEOUT2 has common mode feedback + connected. + + - wlf,ldoena-always-driven : If present LDOENA is always driven + Example: codec: wm8994@1a { compatible = "wlf,wm8994"; reg = <0x1a>; + + gpio-controller; + #gpio-cells = <2>; + + lineout1-se; + + AVDD2-supply = <®ulator>; + CPVDD-supply = <®ulator>; + DBVDD1-supply = <®ulator>; + DBVDD2-supply = <®ulator>; + DBVDD3-supply = <®ulator>; + SPKVDD1-supply = <®ulator>; + SPKVDD2-supply = <®ulator>; };
drivers/mfd/wm8994-core.c +73 -2
111 lines not on this page · raw message
Signature · 1 line
1.7.10.4
Re: [PATCH 2/2] mfd: wm8994: Add some OF properties
Quoted 9 lines · Mark Brown
Add properties for some of the more important bits of platform data and fill out the binding document.
Not all of the current platform data is suitable for the sort of fixed configuration that is done using DT, some of it should have runtime mechanisms added instead and some is unlikely to ever be used in practical systems.
Signed-off-by Mark Brown <[email protected]>
Couple cosmetics remarks below, just in case you happen to resend the patch for some other reason.
Quoted 10 lines
--- Documentation/devicetree/bindings/sound/wm8994.txt | 58 ++++++++++++++- drivers/mfd/wm8994-core.c | 75 +++++++++++++++++++- 2 files changed, 130 insertions(+), 3 deletions(-)Documentation/devicetree/bindings/sound/wm8994.txt +0
-0
Documentation/devicetree/bindings/sound/wm8994.txt on the board). · line 8
Quoted 5 lines
Documentation/devicetree/bindings/sound/wm8994.txt +1
-1@@ -5,14 +5,70 @@ on the board). Required properties: - - compatible : "wlf,wm1811", "wlf,wm8994", "wlf,wm8958" + - compatible : One of "wlf,wm1811", "wlf,wm8994" or "wlf,wm8958"
Missing dot.
Documentation/devicetree/bindings/sound/wm8994.txt on the board).
Quoted 4 lines
Documentation/devicetree/bindings/sound/wm8994.txt +3
-0+Optional properties: + + - wlf,ldoena-always-driven : If present LDOENA is always driven
Ditto.
Documentation/devicetree/bindings/sound/wm8994.txt on the board). · line 65
Quoted 10 lines
Documentation/devicetree/bindings/sound/wm8994.txt +5
-0Example: codec: wm8994@1a { compatible = "wlf,wm8994"; reg = <0x1a>; + + gpio-controller; + #gpio-cells = <2>; + + lineout1-se;
^^^^^^^^^^^^^
Could be tab instead of spaces.
Quoted 4 lines
Documentation/devicetree/bindings/sound/wm8994.txt +4
-0+#ifdef CONFIG_OF +static int wm8994_set_pdata_from_of(struct wm8994 *wm8994) +{ + struct device_node *np = wm8994->dev->of_node;
Documentation/devicetree/bindings/sound/wm8994.txt on the board). · line 36
Quoted 10 lines
Documentation/devicetree/bindings/sound/wm8994.txt +10
-0+ struct wm8994_pdata *pdata = &wm8994->pdata; + int i; + + if (!np) + return 0; + + if (of_property_read_u32_array(np, "wlf,gpio-cfg", pdata->gpio_defaults, + ARRAY_SIZE(pdata->gpio_defaults)) >= 0) { + for (i = 0; i < ARRAY_SIZE(pdata->gpio_defaults); i++) { + if (wm8994->pdata.gpio_defaults[i] == 0)
Could be simplified to: if (pdata->gpio_defaults[i] == 0)
Thanks for the updated series.
Re: [PATCH 2/2] mfd: wm8994: Add some OF properties
Quoted 2 lines · Sylwester Nawrocki
Couple cosmetics remarks below, just in case you happen to resend the patch for some other reason.
Thanks, I've rolled those in and will resend just now.