Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp336064pxb; Tue, 9 Feb 2021 01:23:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJx5MIAsL7piF+JqSyPZc/P5F3UAIuTEhEqu531/wVrRKRsU4Y0+FwwRkp0svWLpleVn/IyP X-Received: by 2002:a17:906:a448:: with SMTP id cb8mr21070347ejb.174.1612862623704; Tue, 09 Feb 2021 01:23:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612862623; cv=none; d=google.com; s=arc-20160816; b=UcxTd1t7BZqrOI4xkpL3MbKXEQgvOgluFys2UsGJCnCRneEWhMjCXzJeRf2LA40iH8 WEy5yD2g046n0hxkmoz3V1Kn36Bi83Q3WJ1cCgo9KloPaE6c6FkJbJ90vaGsqpqbM3KV 17y3vbJ9eCo5hlcruoy0hWQqBZ5UdUXWasi3wM+ooSK6h49B4BXAhNmrCidA6rmdP0EF 22wq5P08kkB+2IIrLJS1BjOJqq5q3lj4xQ95WR9kpHicU+pJapigeXsPO84tUcgro2Dq iRxCrUhSYD+YHXiiJCyDC1B9+waH4MxiJZzpURubDMQu9Gy+Ie8PF+YCBNP1xAcDTG2l wH7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=UCCWDHu0sYSquKe4LwEXk0kUehGPBZCaQ+gPrhz2B70=; b=B0AmrzndXr0ibuRK5pjU05RWVoG8f5Ow1J2+pZli8FqI68g29fllV4KSXIRNxxHvFf n6S/40xMPSNHgwtKxMhr0rbXijgd7nRHfjUnrf67CvSAVchPFhFGbETEpUi5UXbQXaWY o/KgwE7kJoPpqwCqP0Ckgfj7hFssZfkk84ueMJtYpwqAuzbIjfvW8unzo+FHRISA6uxr FC95F76SM13PjMMhbHdQI8nM9pCYGN00QTuzwnjxZBLb+C0PSCDO0LLM7kyfuCYdTl7Z UBtEFRcTohACzGPZ33EDrTv1z503HBpmEK9TJR9KwxxPdT7PtdzLaHtgnjwoPVLhq33B 1ZLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tnKURcRD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x59si12898847edc.544.2021.02.09.01.23.20; Tue, 09 Feb 2021 01:23:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tnKURcRD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229799AbhBIJVg (ORCPT + 99 others); Tue, 9 Feb 2021 04:21:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230344AbhBIJRK (ORCPT ); Tue, 9 Feb 2021 04:17:10 -0500 Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEEB4C06178C; Tue, 9 Feb 2021 01:16:27 -0800 (PST) Received: by mail-qt1-x834.google.com with SMTP id e11so12432419qtg.6; Tue, 09 Feb 2021 01:16:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UCCWDHu0sYSquKe4LwEXk0kUehGPBZCaQ+gPrhz2B70=; b=tnKURcRDMsX6KiDYyAtN3ScVm4Xp3sVDTWZQKtuJnUh3KGUrksRRRmet2qx+mEjT1Y Zgpj6m0XBE1jPTA/ISmoEhBqNEGLjcjfrYz9RYjjbdW1bOVkR8WJUvBwwXuH2XYBv1Ot cD4e4JVB5h00iD4b8COz3OM4fX1NmMfXTeFPG7F64PuyWj/VNJT579c9TP9OZ/sKetnY UL4jEkoesboHATyk8jB+ZuwLqHUgiBemu1v9dn8CLnNNA6GLG13X+YYI3Qmf480tNcTW e1CuEtTNIEXMrXK6Z911F09dY/V4GuXNrk8TlhuoseP0TL/3s0Jy+jXl4EcYNLKnK06X dHRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UCCWDHu0sYSquKe4LwEXk0kUehGPBZCaQ+gPrhz2B70=; b=NSIWN7n0M1QImOZQsHbLt0TH7fSZp+G8uLqTEZlRkWvllrXNwIMroi774hBzX1iqo3 CkUq0rh+5xDtIFv9VruPxzIHMDgRaBfOwQaBTAN2hYRL7wtnY/csdroQrQ2Z2bLheTOw NGnr4rsQg4z8w1ZvmAHEByISbJNddc4ALynAGYufRuNXhZa0AyiGN7N8jFBH52POv5qK d//h9B+YNFlMh1CdJt7bAn5QZsa042YCa0ydBwLjgQ8Qyg/RzwiYi0mVApG0vTExlkWO NDmDEAGoe31Z2DdCi9ZDccnHbQmNt4xLToARx1CUbqbl2LbKnAEI1xt/wRHxpbOtF9nu 92CA== X-Gm-Message-State: AOAM533ajX9Zrf/k1ubNM24ie6s0JntH5cNlbqvacqJdnsyX/Cs2+uv7 i6sYhdJ5y/0Ul9Q/3aFt3XFrmlxJ7qyJwdNac4AxMt88 X-Received: by 2002:ac8:4e8b:: with SMTP id 11mr18524155qtp.292.1612862187116; Tue, 09 Feb 2021 01:16:27 -0800 (PST) MIME-Version: 1.0 References: <1612693435-31418-1-git-send-email-shengjiu.wang@nxp.com> <1612693435-31418-3-git-send-email-shengjiu.wang@nxp.com> <20210208115112.GD8645@sirena.org.uk> In-Reply-To: <20210208115112.GD8645@sirena.org.uk> From: Shengjiu Wang Date: Tue, 9 Feb 2021 17:16:16 +0800 Message-ID: Subject: Re: [PATCH v2 2/7] ASoC: fsl_rpmsg: Add CPU DAI driver for audio base on rpmsg To: Mark Brown Cc: Shengjiu Wang , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , alsa-devel@alsa-project.org, Timur Tabi , Liam Girdwood , linuxppc-dev@lists.ozlabs.org, Xiubo Li , linux-kernel , Takashi Iwai , Nicolin Chen , Rob Herring , Fabio Estevam Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 8, 2021 at 7:53 PM Mark Brown wrote: > > On Sun, Feb 07, 2021 at 06:23:50PM +0800, Shengjiu Wang wrote: > > > +static int fsl_rpmsg_hw_params(struct snd_pcm_substream *substream, > > + struct snd_pcm_hw_params *params, > > + struct snd_soc_dai *dai) > > +{ > > ... > > > + ret = clk_prepare_enable(rpmsg->mclk); > > + if (ret) > > + dev_err(dai->dev, "failed to enable mclk: %d\n", ret); > > + > > + return ret; > > +} > > + > > +static int fsl_rpmsg_hw_free(struct snd_pcm_substream *substream, > > + struct snd_soc_dai *dai) > > +{ > > + struct fsl_rpmsg *rpmsg = snd_soc_dai_get_drvdata(dai); > > + > > + clk_disable_unprepare(rpmsg->mclk); > > hw_params() can be called multiple times and there's no need for it to > be balanced with hw_free(), I'd move this to a different callback (DAPM > should work well). Which callback should I use? Is there an example? best regards wang shengjiu