forked from projectacrn/acrn-kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ASoC: rt5659: add rt5659 codec driver
This is the initial codec driver for rt5659. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
- Loading branch information
Showing
6 changed files
with
6,174 additions
and
0 deletions.
There are no files selected for viewing
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,75 @@ | ||
RT5659/RT5658 audio CODEC | ||
|
||
This device supports I2C only. | ||
|
||
Required properties: | ||
|
||
- compatible : One of "realtek,rt5659" or "realtek,rt5658". | ||
|
||
- reg : The I2C address of the device. | ||
|
||
- interrupts : The CODEC's interrupt output. | ||
|
||
Optional properties: | ||
|
||
- realtek,in1-differential | ||
- realtek,in3-differential | ||
- realtek,in4-differential | ||
Boolean. Indicate MIC1/3/4 input are differential, rather than single-ended. | ||
|
||
- realtek,dmic1-data-pin | ||
0: dmic1 is not used | ||
1: using IN2N pin as dmic1 data pin | ||
2: using GPIO5 pin as dmic1 data pin | ||
3: using GPIO9 pin as dmic1 data pin | ||
4: using GPIO11 pin as dmic1 data pin | ||
|
||
- realtek,dmic2-data-pin | ||
0: dmic2 is not used | ||
1: using IN2P pin as dmic2 data pin | ||
2: using GPIO6 pin as dmic2 data pin | ||
3: using GPIO10 pin as dmic2 data pin | ||
4: using GPIO12 pin as dmic2 data pin | ||
|
||
- realtek,jd-src | ||
0: No JD is used | ||
1: using JD3 as JD source | ||
|
||
- realtek,ldo1-en-gpios : The GPIO that controls the CODEC's LDO1_EN pin. | ||
- realtek,reset-gpios : The GPIO that controls the CODEC's RESET pin. | ||
|
||
Pins on the device (for linking into audio routes) for RT5659/RT5658: | ||
|
||
* DMIC L1 | ||
* DMIC R1 | ||
* DMIC L2 | ||
* DMIC R2 | ||
* IN1P | ||
* IN1N | ||
* IN2P | ||
* IN2N | ||
* IN3P | ||
* IN3N | ||
* IN4P | ||
* IN4N | ||
* HPOL | ||
* HPOR | ||
* SPOL | ||
* SPOR | ||
* LOUTL | ||
* LOUTR | ||
* MONOOUT | ||
* PDML | ||
* PDMR | ||
* SPDIF | ||
|
||
Example: | ||
|
||
rt5659 { | ||
compatible = "realtek,rt5659"; | ||
reg = <0x1b>; | ||
interrupt-parent = <&gpio>; | ||
interrupts = <TEGRA_GPIO(W, 3) GPIO_ACTIVE_HIGH>; | ||
realtek,ldo1-en-gpios = | ||
<&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH>; | ||
}; |
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,49 @@ | ||
/* | ||
* linux/sound/rt5659.h -- Platform data for RT5659 | ||
* | ||
* Copyright 2013 Realtek Microelectronics | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
#ifndef __LINUX_SND_RT5659_H | ||
#define __LINUX_SND_RT5659_H | ||
|
||
enum rt5659_dmic1_data_pin { | ||
RT5659_DMIC1_NULL, | ||
RT5659_DMIC1_DATA_IN2N, | ||
RT5659_DMIC1_DATA_GPIO5, | ||
RT5659_DMIC1_DATA_GPIO9, | ||
RT5659_DMIC1_DATA_GPIO11, | ||
}; | ||
|
||
enum rt5659_dmic2_data_pin { | ||
RT5659_DMIC2_NULL, | ||
RT5659_DMIC2_DATA_IN2P, | ||
RT5659_DMIC2_DATA_GPIO6, | ||
RT5659_DMIC2_DATA_GPIO10, | ||
RT5659_DMIC2_DATA_GPIO12, | ||
}; | ||
|
||
enum rt5659_jd_src { | ||
RT5659_JD_NULL, | ||
RT5659_JD3, | ||
}; | ||
|
||
struct rt5659_platform_data { | ||
bool in1_diff; | ||
bool in3_diff; | ||
bool in4_diff; | ||
|
||
int ldo1_en; /* GPIO for LDO1_EN */ | ||
int reset; /* GPIO for RESET */ | ||
|
||
enum rt5659_dmic1_data_pin dmic1_data_pin; | ||
enum rt5659_dmic2_data_pin dmic2_data_pin; | ||
enum rt5659_jd_src jd_src; | ||
}; | ||
|
||
#endif | ||
|
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.