forked from torvalds/linux
-
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.
Merge remote-tracking branches 'asoc/topic/adau', 'asoc/topic/adau700…
…2', 'asoc/topic/adsp', 'asoc/topic/ak4613' and 'asoc/topic/ak4642' into asoc-next
- Loading branch information
Showing
24 changed files
with
555 additions
and
140 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
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,19 @@ | ||
Analog Devices ADAU7002 Stereo PDM-to-I2S/TDM Converter | ||
|
||
Required properties: | ||
|
||
- compatible: Must be "adi,adau7002" | ||
|
||
Optional properties: | ||
|
||
- IOVDD-supply: Phandle and specifier for the power supply providing the IOVDD | ||
supply as covered in Documentation/devicetree/bindings/regulator/regulator.txt | ||
|
||
If this property is not present it is assumed that the supply pin is | ||
hardwired to always on. | ||
|
||
Example: | ||
adau7002: pdm-to-i2s { | ||
compatible = "adi,adau7002"; | ||
IOVDD-supply = <&supply>; | ||
}; |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Shared helper functions for devices from the ADAU family | ||
* | ||
* Copyright 2011-2016 Analog Devices Inc. | ||
* Author: Lars-Peter Clausen <[email protected]> | ||
* | ||
* Licensed under the GPL-2 or later. | ||
*/ | ||
|
||
#include <linux/gcd.h> | ||
#include <linux/kernel.h> | ||
#include <linux/module.h> | ||
|
||
#include "adau-utils.h" | ||
|
||
int adau_calc_pll_cfg(unsigned int freq_in, unsigned int freq_out, | ||
uint8_t regs[5]) | ||
{ | ||
unsigned int r, n, m, i, j; | ||
unsigned int div; | ||
|
||
if (!freq_out) { | ||
r = 0; | ||
n = 0; | ||
m = 0; | ||
div = 0; | ||
} else { | ||
if (freq_out % freq_in != 0) { | ||
div = DIV_ROUND_UP(freq_in, 13500000); | ||
freq_in /= div; | ||
r = freq_out / freq_in; | ||
i = freq_out % freq_in; | ||
j = gcd(i, freq_in); | ||
n = i / j; | ||
m = freq_in / j; | ||
div--; | ||
} else { | ||
r = freq_out / freq_in; | ||
n = 0; | ||
m = 0; | ||
div = 0; | ||
} | ||
if (n > 0xffff || m > 0xffff || div > 3 || r > 8 || r < 2) | ||
return -EINVAL; | ||
} | ||
|
||
regs[0] = m >> 8; | ||
regs[1] = m & 0xff; | ||
regs[2] = n >> 8; | ||
regs[3] = n & 0xff; | ||
regs[4] = (r << 3) | (div << 1); | ||
if (m != 0) | ||
regs[4] |= 1; /* Fractional mode */ | ||
|
||
return 0; | ||
} | ||
EXPORT_SYMBOL_GPL(adau_calc_pll_cfg); | ||
|
||
MODULE_DESCRIPTION("ASoC ADAU audio CODECs shared helper functions"); | ||
MODULE_AUTHOR("Lars-Peter Clausen <[email protected]>"); | ||
MODULE_LICENSE("GPL v2"); |
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,7 @@ | ||
#ifndef SOUND_SOC_CODECS_ADAU_PLL_H | ||
#define SOUND_SOC_CODECS_ADAU_PLL_H | ||
|
||
int adau_calc_pll_cfg(unsigned int freq_in, unsigned int freq_out, | ||
uint8_t regs[5]); | ||
|
||
#endif |
Oops, something went wrong.