Re: [PATCH] ASoC: nau8822: new codec driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/18/2018 2:54 AM, Mark Brown wrote:
On Fri, Sep 28, 2018 at 11:10:04AM +0800, David Lin wrote:

This looks mostly good so I'm going to apply it, I do have a couple of
comments below but they are quite small and I think they can be
addressed with followup patches.

+++ b/sound/soc/codecs/nau8822.c
@@ -0,0 +1,1136 @@
+/*
+ * nau8822.c  --  NAU8822 ALSA Soc Audio Codec driver
+ *
+ * Copyright 2017 Nuvoton Technology Corp.
+ *
+ * Author: David Lin <ctlin0@xxxxxxxxxxx>
+ * Co-author: John Hsu <kchsu0@xxxxxxxxxxx>
+ * Co-author: Seven Li <wtli@xxxxxxxxxxx>
+ *
+ * Based on WM8974.c
+ *
+ * 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.
+ */
This should be converted to use a SPDX license header

      // SPDX-License-Identifier: GPL-2.0.
OK, I will convert it on next patch.
+static int nau8822_config_clkdiv(struct snd_soc_dai *dai, int div, int rate)
+{
+    struct snd_soc_component *component = dai->component;
+    struct nau8822 *nau8822 = snd_soc_component_get_drvdata(component);
+    struct nau8822_pll *pll = &nau8822->pll;
+    int i, sclk, imclk;
We're trying to get away from using set_clkdiv() as it makes it much
harder to use generic card drivers without specific knowledge of the
card.  However in this case it seems like it's mainly choosing if we
should use the MCLK directly or the PLL and you should be able to do
everything in the set_sysclk() operation - is there a reason not to do
that?  If not then moving to set_sysclk() would avoid problems.

The nau8822_config_clkdiv() will be called internally by
nau8822_hw_params(), not link to the function point (*set_clkdiv) from
the structure "snd_soc_dai_ops".

If nau8822_config_clkdiv() need to simplify, I will remove case
NAU8822_CLK_PLL. The reason is using set_pll() operation can also finish
clk configure from machine driver.



===========================================================================================
The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original sender of this email. If you are not the addressee indicated in this email or are not responsible for delivery of the email to such a person, please kindly reply to the sender indicating this fact and delete all copies of it from your computer and network server immediately. Your cooperation is highly appreciated. It is advised that any unauthorized use of confidential information of Nuvoton is strictly prohibited; and any information in this email irrelevant to the official business of Nuvoton shall be deemed as neither given nor endorsed by Nuvoton.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux