diff mbox series

[3/3] ASoC: dt-bindings: wlf,wm8782: Add max-rate property

Message ID 20230810224930.3216717-4-contact@jookia.org
State New
Headers show
Series [1/3] ASoC: wm8782: Handle maximum audio rate at runtime | expand

Commit Message

John Watts Aug. 10, 2023, 10:49 p.m. UTC
The WM8782 can safely support rates higher than 48kHz by changing the
value of the FSAMPEN pin.

Allow specifying the maximum support rate the hardware configuration
supports in the device tree.

Signed-off-by: John Watts <contact@jookia.org>
---
 Documentation/devicetree/bindings/sound/wm8782.txt | 2 ++
 1 file changed, 2 insertions(+)

Comments

Mark Brown Aug. 14, 2023, 6:27 p.m. UTC | #1
On Sat, Aug 12, 2023 at 12:26:15AM +1000, John Watts wrote:
> On Fri, Aug 11, 2023 at 02:59:35PM +0100, Mark Brown wrote:
> > On Fri, Aug 11, 2023 at 08:49:30AM +1000, John Watts wrote:

> > > + - max-rate    : max supported audio rate configured by FSAMPEN pin, defaults to 48000

> > This seems like a cumbersome and error prone way to configure this - why
> > not just have the binding specify the state of the pin?  That's just a
> > boolean high/low whereas this requires getting the rate right and then
> > having the driver validate it.

> Hi there, the pin is tristate, Z, 0 and 1. How would that be represented?

You'd have to define an enum for that but it does still feel like it
might be easier to work with since it's more direct.
John Watts Aug. 14, 2023, 9:44 p.m. UTC | #2
On Mon, Aug 14, 2023 at 07:27:04PM +0100, Mark Brown wrote:
> You'd have to define an enum for that but it does still feel like it
> might be easier to work with since it's more direct.

Alright, I'll give it a go in the next version. Thanks for the feedback!

John.
Rob Herring Aug. 21, 2023, 5:28 p.m. UTC | #3
On Mon, Aug 14, 2023 at 4:45 PM John Watts <contact@jookia.org> wrote:
>
> On Mon, Aug 14, 2023 at 07:27:04PM +0100, Mark Brown wrote:
> > You'd have to define an enum for that but it does still feel like it
> > might be easier to work with since it's more direct.
>
> Alright, I'll give it a go in the next version. Thanks for the feedback!

That property will need a vendor prefix as well which was missing here.

Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/sound/wm8782.txt b/Documentation/devicetree/bindings/sound/wm8782.txt
index 256cdec6ec4d..a68061a3e671 100644
--- a/Documentation/devicetree/bindings/sound/wm8782.txt
+++ b/Documentation/devicetree/bindings/sound/wm8782.txt
@@ -7,6 +7,7 @@  Required properties:
  - compatible  : "wlf,wm8782"
  - Vdda-supply : phandle to a regulator for the analog power supply (2.7V - 5.5V)
  - Vdd-supply  : phandle to a regulator for the digital power supply (2.7V - 3.6V)
+ - max-rate    : max supported audio rate configured by FSAMPEN pin, defaults to 48000
 
 Example:
 
@@ -14,4 +15,5 @@  wm8782: stereo-adc {
 	compatible = "wlf,wm8782";
 	Vdda-supply = <&vdda_supply>;
 	Vdd-supply = <&vdd_supply>;
+	max-rate = <96000>; /* FSAMPEN is 1 */
 };