Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp110886lqg; Thu, 29 Feb 2024 22:46:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUj+LBOdiaJmXvGIRJ1gVgI1RzB6pP0lVTxbCPSbLNziqjiZl5FXWCIDIvMK5rb0sE3602TA503oeeHqVRQrP+RvFmrXVSqqgVk75vqHg== X-Google-Smtp-Source: AGHT+IEo4mYpDx49G8GkOKlPdeRrilqC+a/He5YH6br8iw6VfpR36OyzHStvSNq5s/RQBIS3EbTU X-Received: by 2002:a17:902:d346:b0:1dc:890a:45a9 with SMTP id l6-20020a170902d34600b001dc890a45a9mr611428plk.65.1709275567600; Thu, 29 Feb 2024 22:46:07 -0800 (PST) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id z8-20020a170902d54800b001d8f2354fdfsi3107153plf.87.2024.02.29.22.46.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 22:46:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87962-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@nuvoton.com header.s=selector1 header.b=SvdDdQWe; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-87962-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87962-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=nuvoton.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D864D284D8E for ; Fri, 1 Mar 2024 06:36:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23CC467E6E; Fri, 1 Mar 2024 06:36:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nuvoton.com header.i=@nuvoton.com header.b="SvdDdQWe" Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2076.outbound.protection.outlook.com [40.107.215.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6175657C8; Fri, 1 Mar 2024 06:35:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.76 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709274960; cv=fail; b=pcRF7Jki+QVtT2l4TTRjkO1YFiBXnPswZdCDrds5CI+zcMfgJU3jP9j17Xo0X81dubJ2KTRD65IcdasMfRNYEmqPFnokFU4Gia2KSIn1K3BcsY7jquL/8+urR/O10uZPa6KfegLu0nEVHNTxr7dHtXDxO0/FJs4p4VdUShHnmk0= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709274960; c=relaxed/simple; bh=EeaKMiIJ8O9ZXv7u5fIdyTTSR365PlpE44FGNEX5Vcc=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=pYcRfHDCWpqvws8AIZ6nFelh+vhY4w8w775gsXEQzrQ9maKC9gLpATVr8Qi0MaTiFX/jQZQoOyzBF7/UHUPKWkUYNc5mdAujG2p33C1rhH53JQ8c/oJzv212f1neDlmQVQReZyJ02kop4EfqBq6tmwxvqe0e7IKLbXBjPWHatlA= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=nuvoton.com; spf=pass smtp.mailfrom=nuvoton.com; dkim=pass (1024-bit key) header.d=nuvoton.com header.i=@nuvoton.com header.b=SvdDdQWe; arc=fail smtp.client-ip=40.107.215.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=nuvoton.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nuvoton.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R8vN8BENtLzPAtoM+aQVrQ7KmInlsEF/QXZJaAP3h/U3szNlr0rFDvczKf3RvdCQUQHc1ugC8PMF5zbIalpGY5UmCB8AK5XXgQk3mTD4CfhQz1WOzLD4QB+kxQ0EnbytM5ic0HVIw+jdTNXx7t0AvNBj3xxn7zMDzY6pioLxAXawh59XHSoTTb0vbc5Hv5ZxfdkF9dUB/jVykEotGP2szX6ZC2SgU2SzaMsh6X5OO9pjp95EctpjUIbfMlTCqqpEtk1RRwjO8gJPCNzEM171wZ5E3sEP/0P2/6ocj5BVR/1rLkRzTS9wZEFPCMLu99MKcLdtXbMNykuPRJp1tm+RQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uIM3y697e5sfMo/q+WrKKNnxb26/lQ/figdqxklG0rU=; b=XW21UrLkq0+A+3Q4oCJpWcd9NjtQtTxZuhdwvwBmdPjpC7Z0qNpEmcguvQSpcDyTiWIdViDIYa6wWDZSHW3ZaQdjberCjirUIb9jelpqlYJqitdGjvymoUZG4CmeSTkYccLUIqT5tjY61IQEGnryGj5IkNYxCbTsAU/uELUprg+LFlofvW1wgx+MMM/tQJMdk39BawcyUgXfiS05YWly0SWkMGh+UT6w5Tm2OXk3lx2g9pEqyYnT7HxB8OVwmMyfqh3G858IhvRq4zq8hHX8aHwlMJi/fo9ujaz7NRomd0zpb+81hl83YiItW4NoCGAPFl1oyv+waU/OqoYeXWOtfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nuvoton.com; dmarc=pass action=none header.from=nuvoton.com; dkim=pass header.d=nuvoton.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuvoton.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uIM3y697e5sfMo/q+WrKKNnxb26/lQ/figdqxklG0rU=; b=SvdDdQWee3YKFdUy1zrXpfQ9LCpAfAqwcxDjWLv5k5cSh/niNMuhy71hF+65TOyYujrg9mf8KlbZc3WbAndwSD66XTtUrqA2benaJ4MN+CXdym+qqQSAV3Gt3X+8+kO1vBeb8HmnKhpggOZJ2+qGhT94KXu5gog59Gi5fjiWZPo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nuvoton.com; Received: from SL2PR03MB4348.apcprd03.prod.outlook.com (2603:1096:100:5c::17) by OS8PR03MB8869.apcprd03.prod.outlook.com (2603:1096:604:28b::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.39; Fri, 1 Mar 2024 06:35:54 +0000 Received: from SL2PR03MB4348.apcprd03.prod.outlook.com ([fe80::8694:77f5:d686:6869]) by SL2PR03MB4348.apcprd03.prod.outlook.com ([fe80::8694:77f5:d686:6869%4]) with mapi id 15.20.7316.037; Fri, 1 Mar 2024 06:35:54 +0000 Message-ID: <9258eb2a-8764-4b2a-9c40-de3faf903610@nuvoton.com> Date: Fri, 1 Mar 2024 14:35:51 +0800 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/2] ASoC: nau8325: new driver Content-Language: en-US To: Mark Brown Cc: lgirdwood@gmail.com, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, conor+dt@kernel.org, YHCHuang@nuvoton.com, KCHSU0@nuvoton.com, CTLIN0@nuvoton.com, SJLIN0@nuvoton.com, scott6986@gmail.com, supercraig0719@gmail.com, dardar923@gmail.com References: <20240222083825.190854-1-wtli@nuvoton.com> <20240222083825.190854-3-wtli@nuvoton.com> <6ffb4165-95e0-4ccd-868f-8ecda56b4079@sirena.org.uk> From: WTLI In-Reply-To: <6ffb4165-95e0-4ccd-868f-8ecda56b4079@sirena.org.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: TYCPR01CA0140.jpnprd01.prod.outlook.com (2603:1096:400:2b7::10) To SL2PR03MB4348.apcprd03.prod.outlook.com (2603:1096:100:5c::17) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SL2PR03MB4348:EE_|OS8PR03MB8869:EE_ X-MS-Office365-Filtering-Correlation-Id: 91a52c8d-87ab-4907-2be8-08dc39b9d860 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LtcuQOyE1pHOSwc0bUD2aVBSgPW7DhwjVLCFlRJtZVtigBhRyiFqcCX+fDMj/qlWwD4tkhnSUAfLpdMa7O4LH6y49oJwkutvUMwXWYqzrBPnbJ+GKDO6mkuLH5o34Ux6ypX01j334qNwlxFfnuv/oxE+TuTaRcFXMNa79o7j2Q/uvda+adL6VhyznVNhLSfK5MJ6LUuH0SvcquEYHzjz8Gn72viQOf17At7plPbL+n4/wv1Oq+dJ03EB6O1Ll/KeIvmfBXB3EJzLb7Y12NjDkI/jV7oyqjX3KHWtfFhNyvfcSryHdyyyT9+7MpLiy8MJ++FHhJ4B2pZiKZ5tNsXzjwl/krtXo0g+hXvygK/ZJrIPz/diGtgNC81oll1cT96AiiT+L1OwIh2QgA82zUcLnjFY20jDq9TbQDjJe1s/ceUbRjNlgcReypJmLcdF0ek1SBC0fhZnTEnm7l7HkvX0bggwNoUHPZ0Jv4RkavKeWQtYIW6f1O60jAtAwIwE8LWY1XedOzGYOTHKSAadcA/2Zmmiig478J3vlhqHxgvefwZHk3t5Nbei5jlDW+G67IIq0wMdnithYx2L+d2loI6l3n/Xg1Yis6SHK1tknEV0b4OGuvuchoPxtVRvCchVBoF4 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SL2PR03MB4348.apcprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZzAvWGpteHd3OEVGS2ZSRnYyR2djcUkvbkxIR0JRc2Rad3NtUWd6MW9JWkhs?= =?utf-8?B?QjlDSEtwS2xwRWpCbVZPUFNTZ2NwS1VUbFhRc1NpclJQUE9DZzZSeENrdjFW?= =?utf-8?B?YnJMZEFHbHNVRzM5cGdYVUhQRTR4WUNOMGtoa3A3am9RTlFrYmE3L1h3cW5Q?= =?utf-8?B?MWlaUE9UbUZLS0kyMURJbmRVSFJ3bmZMY1FLa2Q2M0g5blNwazl1YmZmZUFp?= =?utf-8?B?SlBta1k4VDkweElsd1RTRDg0VFBkSmVMWjVxTE5RbENYOXNoTGhvN05RYnFp?= =?utf-8?B?YVBvazlycm5tV29sWVY3WDR0T1oxckFZL1R3eUZOd2hIV0QxemlLemJpMlBu?= =?utf-8?B?OWNrbzRHS3kzV2FJc01kWWtmejYyZkQyTGF2RzZoYkxzNWdtNTRnNTBRQUVG?= =?utf-8?B?RGx6ZEtLTVNBdElGR3BPY2NuMUF5VVpaVGIvRnlrNk5tRHR0ekxBVmowdUN4?= =?utf-8?B?S29teUEyWlByNkR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change-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2024 06:35:54.3077 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a3f24931-d403-4b4a-94f1-7d83ac638e07 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: k6aRrVtpjQwB+XpcwXOrBcQkGsfF/pYghU3RCHYhElCz85mls83kqgObGDxpuv9uyM1VPxU+LD1eij0bXVr3mg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS8PR03MB8869 Mark Brown =E6=96=BC 2/22/2024 11:47 PM =E5=AF=AB=E9=81=93: > 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_ta= ble, >> + int *n1_sel, int *mult_sel, int *n2_sel) >> +{ >> +proc_done: >> + dev_err(nau8325->dev, "nau8325->fs=3D%d,range=3D0x%x, %s, (n1,mu,n2= ,dmu):(%d,%d,%d), MCLK_SRC=3D%uHz (%d)", >> + nau8325->fs, (*srate_table)->range, >> + (*srate_table)->max ? "MAX" : "MIN", >> + *n1_sel =3D=3D CLK_PROC_BYPASS ? >> + CLK_PROC_BYPASS : mclk_n1_div[*n1_sel].param, >> + *mult_sel =3D=3D 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 =3D dai->component; >> + struct nau8325 *nau8325 =3D snd_soc_component_get_drvdata(component= ); >> + unsigned int ctrl1_val =3D 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 =3D 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 intende= d for use only by the addressees as indicated by the original sender of thi= s email. If you are not the addressee indicated in this email or are not re= sponsible for delivery of the email to such a person, please kindly reply t= o the sender indicating this fact and delete all copies of it from your com= puter and network server immediately. Your cooperation is highly appreciate= d. It is advised that any unauthorized use of confidential information of N= uvoton is strictly prohibited; and any information in this email irrelevant= to the official business of Nuvoton shall be deemed as neither given nor e= ndorsed by Nuvoton.