forked from torvalds/linux
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ASoC: Add Rockchip rk817 audio CODEC support
Add support for the Rockchip rk817 audio codec integrated into the rk817 PMIC. This is based on the sources provided by Rockchip from their BSP kernel. Would someone advise what they think the best way to get the widgets set up properly would be? I'm still new to this and I don't fully understand all the macros (the alsa-project.org documentation only gets me so far). Changes from v2: Switched to DAPM macros to set audio path. Eliminated unnecessary register value sets. Removed devicetree binding since device is present for every rk817 PMIC. Updated binding documentation to yaml format. Separated mfd changes to separate commit. Notes: headphone detect works now, however speaker path does not disable automatically when headphones are used. Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
- Loading branch information
1 parent
e7fc248
commit 40537fd
Showing
5 changed files
with
834 additions
and
0 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
Documentation/devicetree/bindings/sound/rockchip,rk817-codec.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# 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 | ||
|
||
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"; | ||
}; | ||
|
||
........ | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.