[v6 3/3] dt-bindings: Add Rockchip rk817 audio CODEC support

Johan Jonker jbx6244 at gmail.com
Mon Apr 19 20:37:57 CEST 2021


Hi Chris,

Never use hotmail.com for sending patches.
They corrupt Message-ID, so use for example Gmail.

X-Microsoft-Original-Message-ID:
 <20210419155718.17348-3-macromorgan at hotmail.com>

Message-ID:
<SN6PR06MB53420A0E831C17342A73188BA5499 at SN6PR06MB5342.namprd06.prod.outlook.com>

====

If you like rk817.txt should be converted to YAML, which is beyond your
serie, so move these changes to rk817.txt instead for now if rob+dt
agrees. ;)

====

Include the dts patch back in, so we can compare it with the
documentation changes.

On 4/19/21 5:57 PM, Chris Morgan wrote:
> Create dt-binding documentation to document rk817 codec.
> 
> Signed-off-by: Chris Morgan <macromorgan at hotmail.com>
> ---
> Changes in v6:
>  - Included additional project maintainers for correct subsystems.
>  - Removed unneeded compatible from DT documentation.
>  - Removed binding update for Odroid Go Advance (will do in seperate series).
> Changes in v5:
>  - Move register definitions from rk817_codec.h to main rk808.h register
>    definitions.
>  - Add volatile register for codec bits.
>  - Add default values for codec bits.
>  - Removed of_compatible from mtd driver (not necessary).
>  - Switched to using parent regmap instead of private regmap for codec.
> Changes in v4:
>  - Created set_pll() call.
>  - Created user visible gain control in mic.
>  - Check for return value of clk_prepare_enable().
>  - Removed duplicate clk_prepare_enable().
>  - Split DT documentation to separate commit.
> Changes in v3:
>  - Use DAPM macros to set audio path.
>  - Updated devicetree binding (as every rk817 has this codec chip).
>  - Changed documentation to yaml format.
>  - Split MFD changes to separate commit.
> Changes in v2:
>  - Fixed audio path registers to solve some bugs.
> 
>  .../bindings/sound/rockchip,rk817-codec.yaml  | 57 +++++++++++++++++++
>  1 file changed, 57 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml
> 
> 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..0059ef54d6b5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml
> @@ -0,0 +1,57 @@
> +# 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.

If you want to convert rk817.txt to rockchip,rk817.yaml then add

maintainers:
  - Heiko Stuebner <heiko at sntech.de>

> +
> +properties:
> +

> +  "#sound-dai-cells":
> +    const: 1

Move things with "#" below as much as possible.

> +
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    const: "mclk"
> +

> +  mic-in-differential:
> +    description: the microphone is in differential mode.
> +    $ref: /schemas/types.yaml#/definitions/flag

This is part of a sub node now.

> +
> +required:

> +  - compatible

Add compatible "rockchip,rk817" to properties

> +  - clocks
> +  - clock-names
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +rk817: pmic at 20 {

> +	compatible = "rockchip,rk817";

Without rockchip,rk817.yaml this example will generate notifications.

> +	reg = <0x20>;
> +	interrupt-parent = <&gpio0>;

> +	interrupts = <7 IRQ_TYPE_LEVEL_LOW>;

add include for IRQ_TYPE_LEVEL_LOW

> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pmic_int>, <&i2s_8ch_mclk>;

> +	#sound-dai-cells = <0>;

Move things with "#" down below the list in possible.

> +	clocks = <&cru SCLK_I2S_8CH_OUT>;

add include for SCLK_I2S_8CH_OUT

> +	clock-names = "mclk";

----
Heiko's sort rules:

compatible
reg
interrupts
[alphabetical]
status [if needed]

----


> +

> +	........

remove

> +

> +	rk817_codec: codec {


Move to rk817.txt example.

> +			mic-in-differential;

> +			status = "okay";

Never use status in examples.

> +	};
> +

> +	........

remove

> +
> +};
> 



More information about the Alsa-devel mailing list