Received: by 10.223.176.5 with SMTP id f5csp1190059wra; Fri, 2 Feb 2018 12:49:52 -0800 (PST) X-Google-Smtp-Source: AH8x224GLl7VmpNIxwmYSgedCBPCPSsPM1undbtq9cl/+4NZgFhi1i2qLw/ccIZVOWtZr2auzM/i X-Received: by 10.101.102.73 with SMTP id z9mr8070213pgv.448.1517604592493; Fri, 02 Feb 2018 12:49:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517604592; cv=none; d=google.com; s=arc-20160816; b=YkMCLk1qfSxtcJrNVGIzpIo4+OBavU/OxvlIsQBv8zxbSYNJUNApmMbkt59Lyc3KES 3oTrG7tZCcYKZIWmSiukwXP/pzXpIv8F2WaoTJRQAh6n5/lm2SdvALPoONjUEoLMKO9m d/SlDL3UOGOEyo01c3672ikvxtLslClI7VbPyxGspbEZiXplzGX3hs6lJTuPTZZqAFe1 amzaBHe8JwIDJ+s0QAH1UzhPYu2Bfn9kvj+YH7/5QtTAPk5DjPGVhqTfzRvT2slZh4py 6c9tHswEz8i1x8hrEJnN0G4UQu+1lRFXVaH9DP/a0lsaUK3e7nvebTd9Y9w5pnMNYInP iLkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=AhqojoIMH8EVwzIV5kmAj9oUQSfjPo9LU5JvjiqzyxE=; b=qJDHWo/tgndL2/STPBPL2qbMPJHsTstCru9OS7Q4KeV72iA47+1Erj+gcUyrUW/w+D tYccgHg8nExRc0TEqgkBTs0VG8Z5CC3uyRq7ord/iJfKNQZhlhSjZPkilJAGe9a8e0H/ phzyREKoe3tFxH2xLmI8Cuv+emCF0C6a13OX35bD0nV4WryC5ZjhWbRm9KM7MUEq7yTl 2o9fGDFzJAIDF+mC2xmrxpDn7Jb1R82Mq9bWfQk0lq02MP4vZrZx26Ss3q2Z3Bp3Sl5e z8utXdrSRqEI/HK15Rbx7gXJzRfiRYaTvwUxWfqdm+Mm+UQ26Dv5IKCsSzlmUH5oIXp2 VCWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=l36bNZ4x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k21si2426172pfb.43.2018.02.02.12.49.38; Fri, 02 Feb 2018 12:49:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=l36bNZ4x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753585AbeBBTd0 (ORCPT + 99 others); Fri, 2 Feb 2018 14:33:26 -0500 Received: from mail-qt0-f193.google.com ([209.85.216.193]:36538 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751959AbeBBTdT (ORCPT ); Fri, 2 Feb 2018 14:33:19 -0500 Received: by mail-qt0-f193.google.com with SMTP id z11so32326615qtm.3; Fri, 02 Feb 2018 11:33:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=AhqojoIMH8EVwzIV5kmAj9oUQSfjPo9LU5JvjiqzyxE=; b=l36bNZ4xHFyeB6ttJJiA2tukzhNDk2115nJWF8v5ioflhOUxohnHmh2kpAyIgedrvW BHj+3auNVt7JYF3WG4ClddQ36Z6IzSXbfdg2YuiKcZs4hOcj/6fLxXfSNCMRjPSESKOI lJfjSzBQYOfVN/rqQC2IpnvegroPr1h4vw/QP8bA9K28t1MOh6JJwKXb19WbKpfpIbyI mEag1gc/ytB4C8es6BKXw6jZQANPUbH51nUGWKRkIbhiZEgP7uSZfwMj1V0cy7kkH1Zc rjm+tJrpT7ohloPOJ/GSe/dwAOkYDtywa7/NpjPUJJPSZE7WibF9mgWKnfXZzKhYEjFd N/tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=AhqojoIMH8EVwzIV5kmAj9oUQSfjPo9LU5JvjiqzyxE=; b=K273epfuWK1N6XvKkTysa2xscDRfZrfXQyPxRHqDOXwMPpIK/GPbT37ZVf2/7rTgUA z59CP3ceDMUW1r3O3M904iKO/wed9TZigutaJ4sbERE/P0f3aeoReTKkMaPqNbw2TBg1 bRg6ZAqXff0ag5RmnTzLzgX8tIkl69G8RmPciGr+UsHCzrxuEqR30fs6FnnBAT5LbdAx xW34C9OQKgyI5WuZXsQxrQi820djQcqY0z2qPyz5SskpyeaimK/Y7fCT1khhpOwVd7JG 8LnRaFenyuQjRdgtw6teoEomUcOsc4M9zwmf4KM5pJurKD0szGLBznNl2UthlaCfrwvE EUSg== X-Gm-Message-State: AKwxytekeOqKX7bbgBaeSd4RMGT6l4I6AjqCX8rZSv78rXXvXf8Y5k2R LEeSqxhCKLrW//6x2ZG+1er3CYzoAvw+yUuRZRM= X-Received: by 10.200.8.173 with SMTP id v42mr22295976qth.162.1517599998795; Fri, 02 Feb 2018 11:33:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.175.35 with HTTP; Fri, 2 Feb 2018 11:33:18 -0800 (PST) In-Reply-To: <1517588406-3295-2-git-send-email-daniel.baluta@nxp.com> References: <1517588406-3295-1-git-send-email-daniel.baluta@nxp.com> <1517588406-3295-2-git-send-email-daniel.baluta@nxp.com> From: Andy Shevchenko Date: Fri, 2 Feb 2018 21:33:18 +0200 Message-ID: Subject: Re: [PATCH v2 1/2] ASoC: codecs: Add support for AK5558 ADC driver To: Daniel Baluta Cc: Mark Brown , ALSA Development Mailing List , devicetree , Fabio Estevam , Linux Kernel Mailing List , wakasugi.jb@om.asahi-kasei.co.jp, "S.j. Wang" , Mihai Serban , Cosmin Samoila , dl-linux-imx , Daniel Baluta , Mihai Serban Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 2, 2018 at 6:20 PM, Daniel Baluta wrote: > AK5558 is a 32-bit, 768 kHZ sampling, differential input ADC > for digital audio systems. > > Datasheet is available at: > > https://www.akm.com/akm/en/file/datasheet/AK5558VN.pdf > > Initial patch includes support for normal and TDM modes. > > Signed-off-by: Junichi Wakasugi > [initial coding for 3.18 kernel] > Signed-off-by: Mihai Serban > [cleanups and porting to 4.9 kernel] > Signed-off-by: Shengjiu Wang > [tdm support] > Signed-off-by: Daniel Baluta > [pm support, cleanups and porting to latest kernel] Thanks for an update. Couple of nitpicks below, otherwise FWIW, Reviewed-by: Andy Shevchenko > @@ -0,0 +1,626 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * ak5558.c -- audio driver for AK5558 ADC I would remove filename. If file is ever be renamed this will make an additional noise. > + * > + * Copyright (C) 2015 Asahi Kasei Microdevices Corporation > + * Copyright 2018 NXP > + */ > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include I would rather keep it sorted +#include +#include +#include +#include +#include +#include +#include // yeah keep an empty line here to split groups +#include +#include +#include +#include +#include +#include +#include This one is redundant. > +static int ak5558_set_dai_mute(struct snd_soc_dai *dai, int mute) > +{ > + struct snd_soc_codec *codec = dai->codec; > + struct ak5558_priv *ak5558 = snd_soc_codec_get_drvdata(codec); > + int ndt = 0; It might be even int ndt = max(ak5558->fs ? 583000 / ak5558->fs : 5, 5); > + if (!mute) > + return 0; > + > + if (ak5558->fs != 0) > + ndt = 583000 / ak5558->fs; > + > + msleep(max(ndt, 5)); ...and here just msleep(ndt); But I don't know if Mark is okay with that. > + > + return 0; > +} > + pm_runtime_enable(&i2c->dev); > + pm_runtime_disable(&client->dev); I'm also not sure about these calls, but I leave it to you. > +static const struct i2c_device_id ak5558_i2c_id[] = { > + { "ak5558", 0 }, > + { } > +}; > +MODULE_DEVICE_TABLE(i2c, ak5558_i2c_id); I dunno if it's really helpful to have. Though it's up to Mark and you. -- With Best Regards, Andy Shevchenko