* [PATCH 1/2] ASoC: rt1308: Revise the devicetree file mode
@ 2020-05-04 7:40 Oder Chiou
2020-05-04 7:40 ` [PATCH 2/2] ASoC: rl6231: Add the K bypass for the PLL parameters Oder Chiou
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Oder Chiou @ 2020-05-04 7:40 UTC (permalink / raw)
To: broonie, lgirdwood
Cc: Oder Chiou, jack.yu, alsa-devel, derek.fang, shumingf, flove
The patch changes the devicetree file mode correctly.
Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
---
Documentation/devicetree/bindings/sound/rt1308.txt | 0
1 file changed, 0 insertions(+), 0 deletions(-)
mode change 100755 => 100644 Documentation/devicetree/bindings/sound/rt1308.txt
diff --git a/Documentation/devicetree/bindings/sound/rt1308.txt b/Documentation/devicetree/bindings/sound/rt1308.txt
old mode 100755
new mode 100644
--
2.25.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] ASoC: rl6231: Add the K bypass for the PLL parameters
2020-05-04 7:40 [PATCH 1/2] ASoC: rt1308: Revise the devicetree file mode Oder Chiou
@ 2020-05-04 7:40 ` Oder Chiou
2020-05-04 11:23 ` [PATCH 1/2] ASoC: rt1308: Revise the devicetree file mode Mark Brown
2020-05-04 12:27 ` Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Oder Chiou @ 2020-05-04 7:40 UTC (permalink / raw)
To: broonie, lgirdwood
Cc: Oder Chiou, jack.yu, alsa-devel, derek.fang, shumingf, flove
The patch adds the K bypass for the PLL parameters.
Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
---
sound/soc/codecs/rl6231.c | 29 +++++++++++++++++++----------
sound/soc/codecs/rl6231.h | 1 +
2 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/sound/soc/codecs/rl6231.c b/sound/soc/codecs/rl6231.c
index d181c217d835..2586d1cafc0c 100644
--- a/sound/soc/codecs/rl6231.c
+++ b/sound/soc/codecs/rl6231.c
@@ -97,12 +97,13 @@ struct pll_calc_map {
int n;
int m;
bool m_bp;
+ bool k_bp;
};
static const struct pll_calc_map pll_preset_table[] = {
- {19200000, 4096000, 23, 14, 1, false},
- {19200000, 24576000, 3, 30, 3, false},
- {3840000, 24576000, 3, 30, 0, true},
+ {19200000, 4096000, 23, 14, 1, false, false},
+ {19200000, 24576000, 3, 30, 3, false, false},
+ {3840000, 24576000, 3, 30, 0, true, false},
};
static unsigned int find_best_div(unsigned int in,
@@ -128,7 +129,7 @@ static unsigned int find_best_div(unsigned int in,
* rl6231_pll_calc - Calcualte PLL M/N/K code.
* @freq_in: external clock provided to codec.
* @freq_out: target clock which codec works on.
- * @pll_code: Pointer to structure with M, N, K and bypass flag.
+ * @pll_code: Pointer to structure with M, N, K, m_bypass and k_bypass flag.
*
* Calcualte M/N/K code to configure PLL for codec.
*
@@ -143,7 +144,7 @@ int rl6231_pll_calc(const unsigned int freq_in,
unsigned int red, pll_out, in_t, out_t, div, div_t;
unsigned int red_t = abs(freq_out - freq_in);
unsigned int f_in, f_out, f_max;
- bool bypass = false;
+ bool m_bypass = false, k_bypass = false;
if (RL6231_PLL_INP_MAX < freq_in || RL6231_PLL_INP_MIN > freq_in)
return -EINVAL;
@@ -154,7 +155,8 @@ int rl6231_pll_calc(const unsigned int freq_in,
k = pll_preset_table[i].k;
m = pll_preset_table[i].m;
n = pll_preset_table[i].n;
- bypass = pll_preset_table[i].m_bp;
+ m_bypass = pll_preset_table[i].m_bp;
+ k_bypass = pll_preset_table[i].k_bp;
pr_debug("Use preset PLL parameter table\n");
goto code_find;
}
@@ -172,12 +174,14 @@ int rl6231_pll_calc(const unsigned int freq_in,
f_in = freq_in / div;
f_out = freq_out / div;
k = min_k;
+ if (min_k < -1)
+ min_k = -1;
for (k_t = min_k; k_t <= max_k; k_t++) {
for (n_t = 0; n_t <= max_n; n_t++) {
in_t = f_in * (n_t + 2);
pll_out = f_out * (k_t + 2);
if (in_t == pll_out) {
- bypass = true;
+ m_bypass = true;
n = n_t;
k = k_t;
goto code_find;
@@ -185,7 +189,7 @@ int rl6231_pll_calc(const unsigned int freq_in,
out_t = in_t / (k_t + 2);
red = abs(f_out - out_t);
if (red < red_t) {
- bypass = true;
+ m_bypass = true;
n = n_t;
m = 0;
k = k_t;
@@ -197,7 +201,7 @@ int rl6231_pll_calc(const unsigned int freq_in,
out_t = in_t / ((m_t + 2) * (k_t + 2));
red = abs(f_out - out_t);
if (red < red_t) {
- bypass = false;
+ m_bypass = false;
n = n_t;
m = m_t;
k = k_t;
@@ -211,8 +215,13 @@ int rl6231_pll_calc(const unsigned int freq_in,
pr_debug("Only get approximation about PLL\n");
code_find:
+ if (k == -1) {
+ k_bypass = true;
+ k = 0;
+ }
- pll_code->m_bp = bypass;
+ pll_code->m_bp = m_bypass;
+ pll_code->k_bp = k_bypass;
pll_code->m_code = m;
pll_code->n_code = n;
pll_code->k_code = k;
diff --git a/sound/soc/codecs/rl6231.h b/sound/soc/codecs/rl6231.h
index 6d8ed0377296..928082750860 100644
--- a/sound/soc/codecs/rl6231.h
+++ b/sound/soc/codecs/rl6231.h
@@ -18,6 +18,7 @@
struct rl6231_pll_code {
bool m_bp; /* Indicates bypass m code or not. */
+ bool k_bp; /* Indicates bypass k code or not. */
int m_code;
int n_code;
int k_code;
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] ASoC: rt1308: Revise the devicetree file mode
2020-05-04 7:40 [PATCH 1/2] ASoC: rt1308: Revise the devicetree file mode Oder Chiou
2020-05-04 7:40 ` [PATCH 2/2] ASoC: rl6231: Add the K bypass for the PLL parameters Oder Chiou
@ 2020-05-04 11:23 ` Mark Brown
2020-05-04 12:27 ` Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2020-05-04 11:23 UTC (permalink / raw)
To: Oder Chiou; +Cc: jack.yu, alsa-devel, lgirdwood, derek.fang, shumingf, flove
[-- Attachment #1: Type: text/plain, Size: 343 bytes --]
On Mon, May 04, 2020 at 03:40:06PM +0800, Oder Chiou wrote:
> The patch changes the devicetree file mode correctly.
This and patch 2 don't seem terribly related so there's no need to send
them as part of a series, merging things into a series when it's not
needed can slow things down if earlier patches in the series end up
having problems.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] ASoC: rt1308: Revise the devicetree file mode
2020-05-04 7:40 [PATCH 1/2] ASoC: rt1308: Revise the devicetree file mode Oder Chiou
2020-05-04 7:40 ` [PATCH 2/2] ASoC: rl6231: Add the K bypass for the PLL parameters Oder Chiou
2020-05-04 11:23 ` [PATCH 1/2] ASoC: rt1308: Revise the devicetree file mode Mark Brown
@ 2020-05-04 12:27 ` Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2020-05-04 12:27 UTC (permalink / raw)
To: lgirdwood, Oder Chiou; +Cc: shumingf, jack.yu, alsa-devel, derek.fang, flove
On Mon, 4 May 2020 15:40:06 +0800, Oder Chiou wrote:
> The patch changes the devicetree file mode correctly.
>
> Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
> ---
> Documentation/devicetree/bindings/sound/rt1308.txt | 0
> 1 file changed, 0 insertions(+), 0 deletions(-)
> mode change 100755 => 100644 Documentation/devicetree/bindings/sound/rt1308.txt
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.7
Thanks!
[1/2] ASoC: rt1308: Revise the devicetree file mode
commit: afcbaa20d662ce8c78b70e953fa8a045c7a243fb
[2/2] ASoC: rl6231: Add the K bypass for the PLL parameters
(not applied)
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-05-04 12:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-04 7:40 [PATCH 1/2] ASoC: rt1308: Revise the devicetree file mode Oder Chiou
2020-05-04 7:40 ` [PATCH 2/2] ASoC: rl6231: Add the K bypass for the PLL parameters Oder Chiou
2020-05-04 11:23 ` [PATCH 1/2] ASoC: rt1308: Revise the devicetree file mode Mark Brown
2020-05-04 12:27 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.