diff mbox series

[v4,2/3] dt-bindings: Add Rockchip rk817 audio CODEC support

Message ID SN6PR06MB53424766F673FC2427CD9AD1A56A9@SN6PR06MB5342.namprd06.prod.outlook.com (mailing list archive)
State Superseded, archived
Headers show
Series [v4,1/3] ASoC: Add Rockchip rk817 audio CODEC support | expand

Commit Message

Chris Morgan March 17, 2021, 8:21 p.m. UTC
Create dt-binding documentation to document rk817 codec.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
 .../bindings/sound/rockchip,rk817-codec.yaml  | 63 +++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml

Comments

Mark Brown March 17, 2021, 8:44 p.m. UTC | #1
On Wed, Mar 17, 2021 at 03:21:16PM -0500, Chris Morgan wrote:

> +  compatible:
> +    enum:
> +      - rockchip,rk817-codec

Sorry, should have picked this up on the previous version - you
shouldn't need the compatible here, an rk817 always has a CODEC.  The
actual driver has already been updatd and doesn't use it anyway.
Chris Morgan March 17, 2021, 8:56 p.m. UTC | #2
The compatible is still needed so that it can be registered with the mfd device itself in the cell.

Thank you.

On Wed, Mar 17, 2021 at 08:44:53PM +0000, Mark Brown wrote:
> On Wed, Mar 17, 2021 at 03:21:16PM -0500, Chris Morgan wrote:
> 
> > +  compatible:
> > +    enum:
> > +      - rockchip,rk817-codec
> 
> Sorry, should have picked this up on the previous version - you
> shouldn't need the compatible here, an rk817 always has a CODEC.  The
> actual driver has already been updatd and doesn't use it anyway.
Mark Brown March 17, 2021, 9:05 p.m. UTC | #3
On Wed, Mar 17, 2021 at 03:56:54PM -0500, Chris Morgan wrote:

> The compatible is still needed so that it can be registered with the mfd device itself in the cell.

I can't parse this?  What does "registered with the mfd device itself in
the cell" mean?  If you register a MFD cell then the function device
will instantaite based on platform bus matching.

Please don't top post, reply in line with needed context.  This allows
readers to readily follow the flow of conversation and understand what
you are talking about and also helps ensure that everything in the
discussion is being addressed.

Please fix your mail client to word wrap within paragraphs at something
substantially less than 80 columns.  Doing this makes your messages much
easier to read and reply to.
Chris Morgan March 17, 2021, 9:18 p.m. UTC | #4
Sorry, still getting the hang of mutt. I've got my wrap set at 80 now, and I'll try to make sure I'm replying correctly. Hopefully this one comes through correct.

As-is, when I start the driver after removing the device-tree compatible field or the of_compatible from the MFD driver, it doesn't find the mclk (and thus doesn't start). But that's my problem, and I'll try to get to the bottom of it.

Thank you.

On Wed, Mar 17, 2021 at 09:05:30PM +0000, Mark Brown wrote:
> On Wed, Mar 17, 2021 at 03:56:54PM -0500, Chris Morgan wrote:
> 
> > The compatible is still needed so that it can be registered with the mfd device itself in the cell.
> 
> I can't parse this?  What does "registered with the mfd device itself in
> the cell" mean?  If you register a MFD cell then the function device
> will instantaite based on platform bus matching.
> 
> Please don't top post, reply in line with needed context.  This allows
> readers to readily follow the flow of conversation and understand what
> you are talking about and also helps ensure that everything in the
> discussion is being addressed.
> 
> Please fix your mail client to word wrap within paragraphs at something
> substantially less than 80 columns.  Doing this makes your messages much
> easier to read and reply to.
Mark Brown March 18, 2021, 12:38 p.m. UTC | #5
On Wed, Mar 17, 2021 at 04:18:16PM -0500, Chris Morgan wrote:

> Sorry, still getting the hang of mutt. I've got my wrap set at 80 now, and I'll try to make sure I'm replying correctly. Hopefully this one comes through correct.

No change visible at this end :/

> As-is, when I start the driver after removing the device-tree compatible field or the of_compatible from the MFD driver, it doesn't find the mclk (and thus doesn't start). But that's my problem, and I'll try to get to the bottom of it.

Do you have the MCLK mapped in the CODEC node or the top level node?
You will need to have it mapped in the top level node.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml b/Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml
new file mode 100644
index 000000000000..986cebcd0832
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml
@@ -0,0 +1,63 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/rockchip-rk817.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Rockchip rk817 audio codec
+
+description:
+  The rk817 codec is an I2C codec integrated with every Rockchip
+  rk817 PMIC MFD.
+
+properties:
+  compatible:
+    enum:
+      - rockchip,rk817-codec
+
+  "#sound-dai-cells":
+    const: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: "mclk"
+
+  mic-in-differential:
+    description: the microphone is in differential mode.
+    $ref: /schemas/types.yaml#/definitions/flag
+
+required:
+  - compatible
+  - clocks
+  - clock-names
+
+additionalProperties: false
+
+examples:
+  - |
+rk817: pmic@20 {
+	compatible = "rockchip,rk817";
+	reg = <0x20>;
+	interrupt-parent = <&gpio0>;
+	interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pmic_int>;
+
+	........
+
+	rk817_codec: codec {
+			#sound-dai-cells = <0>;
+			compatible = "rockchip,rk817-codec";
+			clocks = <&cru SCLK_I2S_8CH_OUT>;
+			clock-names = "mclk";
+			pinctrl-names = "default";
+			pinctrl-0 = <&i2s_8ch_mclk>;
+			mic-in-differential;
+			status = "okay";
+	};
+
+	........
+
+};