Re: [PATCH v2 2/2] ASoC: nau8325: new driver

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

 




Mark Brown 於 2/22/2024 11:47 PM 寫道:
On Thu, Feb 22, 2024 at 04:38:25PM +0800, Seven Lee wrote:

A few very minor things below but basically this looks good.

+static int nau8325_clksrc_choose(struct nau8325 *nau8325,
+                             const struct nau8325_srate_attr **srate_table,
+                             int *n1_sel, int *mult_sel, int *n2_sel)
+{
+proc_done:
+    dev_err(nau8325->dev, "nau8325->fs=%d,range=0x%x, %s, (n1,mu,n2,dmu):(%d,%d,%d), MCLK_SRC=%uHz (%d)",
+            nau8325->fs, (*srate_table)->range,
+            (*srate_table)->max ? "MAX" : "MIN",
+            *n1_sel == CLK_PROC_BYPASS ?
+            CLK_PROC_BYPASS : mclk_n1_div[*n1_sel].param,
+            *mult_sel == CLK_PROC_BYPASS ?
+            CLK_PROC_BYPASS : 1 << mclk_n3_mult[*mult_sel].param,
+            1 << mclk_n2_div[*n2_sel].param,
+            (*srate_table)->mclk_src[ratio],
+            (*srate_table)->mclk_src[ratio] / nau8325->fs);
This should be a dev_dbg(), dev_err() will be very noisy in normal
operation.

okay, I will make the correction to dev_dbg().


+static int nau8325_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
+{
+    struct snd_soc_component *component = dai->component;
+    struct nau8325 *nau8325 = snd_soc_component_get_drvdata(component);
+    unsigned int ctrl1_val = 0;
+
+    switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
+    case SND_SOC_DAIFMT_CBS_CFS:
+            break;
Please use the modern _CBC_CFC defines.

okay, I will revise.


+    ret = regmap_read(nau8325->regmap, NAU8325_R02_DEVICE_ID, &value);
+    if (ret) {
+            dev_err(dev, "Failed to read device id (%d)", ret);
+            goto err;
+    }
Probably a good idea to check that the device ID is what we expected
too.

okay, thanks.

________________________________
________________________________
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.





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux