Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3476615ybb; Mon, 23 Mar 2020 01:39:15 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs4ru7zkaBWf16PEZbOzqGJpZWwFladyNDlQ4MQOrUcMorT4oB1l/GiWWdXN7O2gF9qOIVV X-Received: by 2002:a05:6830:4035:: with SMTP id i21mr15911410ots.348.1584952755109; Mon, 23 Mar 2020 01:39:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584952755; cv=none; d=google.com; s=arc-20160816; b=U04rtI2GS/OJTD+nGyeC11UIfQtDz6E57GzdzpnLY3bv8U5lFMqLqFZQaxXlhhVkzY PcNs3f40vbSZgIJ6AqtdqIWca9Ra8bUh0b4ZPzqqzlP4SN6tzu/MrZXbAoVhpaCMFJA2 6MvHKwtdhUBjxyc4Jk0QbBD6zvt78dtFynTHl6MhEPjPEKjMhWsSl+40T61L1Od+6cqe eeK/+ceKJYdcEbL5NFxrny0OkJ6kRBq8nC6GuDXBFfm2JIeb0UsKXDW43kp86p2F9ibs +b8GBG2MUupkNf0CCktz/rISppEXL5PFXuCFMDkrjGO8nro3nMqocMPcULJMxZFYjyM3 NAzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date; bh=WuAnHCEJlzofQ0IEsR86i+MeWOQI92U0G1lxHRTc3fM=; b=m5CX2NcIEiFssRkMyyEXFrpIrOyLdVThO8FeHfa9HwAlO5pdLJGV+oT1mppDSFvl48 TUP/sAmrOQ8BL3hyAP8e4R+RPBuLJteZQIQ2Wir4zbPMYVZx8p2DDmuniDjgz0F4Hhox pdBTfYb9m/bMvoeSEXneFIm50afEKMZvKBIrsjLIiS4aYP4EoWbfDtFdhNccuKVY38pk 8v3RuCheE+E0ZYCn3SyIUtz9PO4C1QcYNfoOrnryS7Ypqt9k6FMNoeiKJBwOUgyQWErP I9v21LKdBvmT+/HkuIGXbbTU74u7T5mvSqQrFwt4DA9SOfw+oIDIAwEGK2TpQK0pyMat VT1Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a206si6741727oii.132.2020.03.23.01.39.01; Mon, 23 Mar 2020 01:39:15 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727587AbgCWIid (ORCPT + 99 others); Mon, 23 Mar 2020 04:38:33 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:57353 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727477AbgCWIid (ORCPT ); Mon, 23 Mar 2020 04:38:33 -0400 Received: from mail.cetitecgmbh.com ([87.190.42.90]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M4b5s-1jHwlF0VEc-001eWd for ; Mon, 23 Mar 2020 09:38:31 +0100 Received: from pflvmailgateway.corp.cetitec.com (unknown [127.0.0.1]) by mail.cetitecgmbh.com (Postfix) with ESMTP id E54D06503CA for ; Mon, 23 Mar 2020 08:38:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at cetitec.com Received: from mail.cetitecgmbh.com ([127.0.0.1]) by pflvmailgateway.corp.cetitec.com (pflvmailgateway.corp.cetitec.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Lx99sRFqOfUl for ; Mon, 23 Mar 2020 09:38:30 +0100 (CET) Received: from pfwsexchange.corp.cetitec.com (unknown [10.10.1.99]) by mail.cetitecgmbh.com (Postfix) with ESMTPS id 9157664F7DC for ; Mon, 23 Mar 2020 09:38:30 +0100 (CET) Received: from pflmari.corp.cetitec.com (10.8.5.4) by PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 23 Mar 2020 09:38:30 +0100 Received: by pflmari.corp.cetitec.com (Postfix, from userid 1000) id C3AA1804FB; Mon, 23 Mar 2020 09:36:10 +0100 (CET) Date: Mon, 23 Mar 2020 09:36:10 +0100 From: Alex Riesen To: Stephen Boyd CC: Kieran Bingham , Geert Uytterhoeven , Mauro Carvalho Chehab , "Hans Verkuil" , Laurent Pinchart , Rob Herring , "Mark Rutland" , Kuninori Morimoto , , , , , , linux-clk Subject: Re: [PATCH v3 05/11] media: adv748x: add support for HDMI audio Message-ID: <20200323083610.GB4298@pflmari> Mail-Followup-To: Alex Riesen , Stephen Boyd , Kieran Bingham , Geert Uytterhoeven , Mauro Carvalho Chehab , Hans Verkuil , Laurent Pinchart , Rob Herring , Mark Rutland , Kuninori Morimoto , devel@driverdev.osuosl.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-clk References: <82828e89ccf4173de4e5e52dcecacc4d5168315c.1584720678.git.alexander.riesen@cetitec.com> <158475297119.125146.8177273856843293558@swboyd.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <158475297119.125146.8177273856843293558@swboyd.mtv.corp.google.com> X-Originating-IP: [10.8.5.4] X-ClientProxiedBy: PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) To PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) X-EsetResult: clean, is OK X-EsetId: 37303A290D7F536A6D7066 X-Provags-ID: V03:K1:BwxtMQF9rpOdaMb3Jcu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6T 6omb95JvXFtyY9Q+PqbZaPBCuKpgHIqtfecHz+/28X0lCoE/mnMsrmDUm58dTd2xtFByZv5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Stephen Boyd, Sat, Mar 21, 2020 02:09:31 +0100: > Quoting Alex Riesen (2020-03-20 09:12:00) > > diff --git a/drivers/media/i2c/adv748x/adv748x-dai.c b/drivers/media/i2c/adv748x/adv748x-dai.c > > new file mode 100644 > > index 000000000000..6fce7d000423 > > --- /dev/null > > +++ b/drivers/media/i2c/adv748x/adv748x-dai.c > > @@ -0,0 +1,265 @@ > > +// SPDX-License-Identifier: GPL-2.0+ > > +/* > > + * Driver for Analog Devices ADV748X HDMI receiver with AFE > > + * The implementation of DAI. > > + */ > > + > > +#include "adv748x.h" > > + > > +#include > > Is this include used? Please try to make a clk provider or a clk > consumer and not both unless necessary. Yes, they're both used: I use clk_get_rate to get the frequency of the clock to validate the master clock frequency configuration. > > +int adv748x_dai_init(struct adv748x_dai *dai) > > +{ > > + int ret; > > + struct adv748x_state *state = adv748x_dai_to_state(dai); > > + > > + dai->mclk_name = kasprintf(GFP_KERNEL, "%s.%s-i2s-mclk", > > + state->dev->driver->name, > > + dev_name(state->dev)); > > + if (!dai->mclk_name) { > > + ret = -ENOMEM; > > + adv_err(state, "No memory for MCLK\n"); > > + goto fail; > > + } > > + dai->mclk = clk_register_fixed_rate(state->dev, > > Please register with clk_hw_register_fixed_rate() instead. Ok, I see the clk_register_fixed_rate isn't even commented... I shall change it to used clk_hw_register_fixed_rate. But could you please point me at some documentation, example, or just add a few words to explain the preference? BTW, the clock which the driver attempts to provide can actually be switched on and off (it output pad can be even tristated). As the device is connected by I2C to the how, I seems to be unable to use the existing gated clock implementation because of the mmio register it requires. Or am I wrong? > > + dai->mclk_name, > > + NULL /* parent_name */, > > + 0 /* flags */, > > + 12288000 /* rate */); > > Not sure these comments are useful. You're right. Removed. > > + dai->drv.name = ADV748X_DAI_NAME; > > + dai->drv.ops = &adv748x_dai_ops; > > + dai->drv.capture = (struct snd_soc_pcm_stream){ > > Can this be const? It can. Fixed. > Please drop extra newline at end of file. Done. Thanks a lot for the review and commentary! Regards, Alex