forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ASoC: rt5682: add rt5682 codec driver
This is the initial codec driver for rt5682. Signed-off-by: Bard Liao <[email protected]> Signed-off-by: Mark Brown <[email protected]>
- Loading branch information
Showing
6 changed files
with
4,104 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,50 @@ | ||
RT5682 audio CODEC | ||
|
||
This device supports I2C only. | ||
|
||
Required properties: | ||
|
||
- compatible : "realtek,rt5682" or "realtek,rt5682i" | ||
|
||
- reg : The I2C address of the device. | ||
|
||
Optional properties: | ||
|
||
- interrupts : The CODEC's interrupt output. | ||
|
||
- realtek,dmic1-data-pin | ||
0: dmic1 is not used | ||
1: using GPIO2 pin as dmic1 data pin | ||
2: using GPIO5 pin as dmic1 data pin | ||
|
||
- realtek,dmic1-clk-pin | ||
0: using GPIO1 pin as dmic1 clock pin | ||
1: using GPIO3 pin as dmic1 clock pin | ||
|
||
- realtek,jd-src | ||
0: No JD is used | ||
1: using JD1 as JD source | ||
|
||
- realtek,ldo1-en-gpios : The GPIO that controls the CODEC's LDO1_EN pin. | ||
|
||
Pins on the device (for linking into audio routes) for RT5682: | ||
|
||
* DMIC L1 | ||
* DMIC R1 | ||
* IN1P | ||
* HPOL | ||
* HPOR | ||
|
||
Example: | ||
|
||
rt5682 { | ||
compatible = "realtek,rt5682i"; | ||
reg = <0x1a>; | ||
interrupt-parent = <&gpio>; | ||
interrupts = <TEGRA_GPIO(U, 6) GPIO_ACTIVE_HIGH>; | ||
realtek,ldo1-en-gpios = | ||
<&gpio TEGRA_GPIO(R, 2) GPIO_ACTIVE_HIGH>; | ||
realtek,dmic1-data-pin = <1>; | ||
realtek,dmic1-clk-pin = <1>; | ||
realtek,jd-src = <1>; | ||
}; |
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,40 @@ | ||
/* | ||
* linux/sound/rt5682.h -- Platform data for RT5682 | ||
* | ||
* Copyright 2018 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_RT5682_H | ||
#define __LINUX_SND_RT5682_H | ||
|
||
enum rt5682_dmic1_data_pin { | ||
RT5682_DMIC1_NULL, | ||
RT5682_DMIC1_DATA_GPIO2, | ||
RT5682_DMIC1_DATA_GPIO5, | ||
}; | ||
|
||
enum rt5682_dmic1_clk_pin { | ||
RT5682_DMIC1_CLK_GPIO1, | ||
RT5682_DMIC1_CLK_GPIO3, | ||
}; | ||
|
||
enum rt5682_jd_src { | ||
RT5682_JD_NULL, | ||
RT5682_JD1, | ||
}; | ||
|
||
struct rt5682_platform_data { | ||
|
||
int ldo1_en; /* GPIO for LDO1_EN */ | ||
|
||
enum rt5682_dmic1_data_pin dmic1_data_pin; | ||
enum rt5682_dmic1_clk_pin dmic1_clk_pin; | ||
enum rt5682_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.