From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simran Rai Subject: Re: [PATCH v4 2/3] ASoC: cygnus: Add Cygnus audio DAI driver Date: Tue, 1 Dec 2015 18:17:54 -0800 Message-ID: <565E54D2.50806@broadcom.com> References: <1447114664-21799-1-git-send-email-ssimran@broadcom.com> <1447114664-21799-3-git-send-email-ssimran@broadcom.com> <20151122134440.GQ26072@sirena.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20151122134440.GQ26072@sirena.org.uk> Sender: linux-kernel-owner@vger.kernel.org To: Mark Brown Cc: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Ray Jui , Scott Branden , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Lori Hikichi , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, Arun Parameswaran , alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org On 11/22/2015 5:44 AM, Mark Brown wrote: > On Mon, Nov 09, 2015 at 04:17:43PM -0800, Simran Rai wrote: > >> +#ifdef CONFIG_PM_SLEEP >> +static int cygnus_ssp_suspend(struct snd_soc_dai *cpu_dai) >> +{ >> + struct cygnus_aio_port *aio = cygnus_dai_get_portinfo(cpu_dai); >> + struct cygnus_audio *cygaud = snd_soc_dai_get_drvdata(cpu_dai); >> + >> + audio_ssp_out_disable(aio); >> + audio_ssp_in_disable(aio); >> + if (cygaud->active_ports > 0) >> + cygaud->active_ports--; >> + >> + return 0; >> +} >> + >> +static int cygnus_ssp_resume(struct snd_soc_dai *cpu_dai) >> +{ >> + return 0; >> +} > I'm a bit confused here - why do we need to disable things on suspend > but not reenable them on resume? I'd expect that the core would have > quiesced any streams that need to be suspended before we get as far as > suspending the drivers. > > Please also remove empty functions. > > Now I check I see that I'm repeating the questions I had on my previous > review: > > | Blank line between functions and remove empty functions. Though I'm not > | clear why the result doesn't undo what the suspend did... > > Please don't ignore review comments. Let me investigate this further and debug why the core did not quiescence the streams. > >> + parent = clk_get_parent(cygaud->audio_clk[0]); >> + if (IS_ERR(parent)) { >> + error = PTR_ERR(parent); >> + goto err_get_parent; >> + } >> + >> + /* Set PLL VCO Frequency (Hz) to default */ >> + error = clk_set_rate(parent, DEFAULT_VCO); >> + if (error) { >> + dev_err(&pdev->dev, >> + "%s Set PLL VCO rate failed: %d\n", __func__, error); >> + goto err_get_parent; >> + } > I would expect any initialisationn of clocks beyond the ones that the > device directly interacts with to be handled within the clock API > configuration rather than in a specific driver, this avoids the driver > being dependent on a particular system integration. I will have to figure out a way to propagate the frequency from leaf clocks to the parent clock. Will send out another patch with the fix. Thanks, Simran From mboxrd@z Thu Jan 1 00:00:00 1970 From: ssimran@broadcom.com (Simran Rai) Date: Tue, 1 Dec 2015 18:17:54 -0800 Subject: [PATCH v4 2/3] ASoC: cygnus: Add Cygnus audio DAI driver In-Reply-To: <20151122134440.GQ26072@sirena.org.uk> References: <1447114664-21799-1-git-send-email-ssimran@broadcom.com> <1447114664-21799-3-git-send-email-ssimran@broadcom.com> <20151122134440.GQ26072@sirena.org.uk> Message-ID: <565E54D2.50806@broadcom.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 11/22/2015 5:44 AM, Mark Brown wrote: > On Mon, Nov 09, 2015 at 04:17:43PM -0800, Simran Rai wrote: > >> +#ifdef CONFIG_PM_SLEEP >> +static int cygnus_ssp_suspend(struct snd_soc_dai *cpu_dai) >> +{ >> + struct cygnus_aio_port *aio = cygnus_dai_get_portinfo(cpu_dai); >> + struct cygnus_audio *cygaud = snd_soc_dai_get_drvdata(cpu_dai); >> + >> + audio_ssp_out_disable(aio); >> + audio_ssp_in_disable(aio); >> + if (cygaud->active_ports > 0) >> + cygaud->active_ports--; >> + >> + return 0; >> +} >> + >> +static int cygnus_ssp_resume(struct snd_soc_dai *cpu_dai) >> +{ >> + return 0; >> +} > I'm a bit confused here - why do we need to disable things on suspend > but not reenable them on resume? I'd expect that the core would have > quiesced any streams that need to be suspended before we get as far as > suspending the drivers. > > Please also remove empty functions. > > Now I check I see that I'm repeating the questions I had on my previous > review: > > | Blank line between functions and remove empty functions. Though I'm not > | clear why the result doesn't undo what the suspend did... > > Please don't ignore review comments. Let me investigate this further and debug why the core did not quiescence the streams. > >> + parent = clk_get_parent(cygaud->audio_clk[0]); >> + if (IS_ERR(parent)) { >> + error = PTR_ERR(parent); >> + goto err_get_parent; >> + } >> + >> + /* Set PLL VCO Frequency (Hz) to default */ >> + error = clk_set_rate(parent, DEFAULT_VCO); >> + if (error) { >> + dev_err(&pdev->dev, >> + "%s Set PLL VCO rate failed: %d\n", __func__, error); >> + goto err_get_parent; >> + } > I would expect any initialisationn of clocks beyond the ones that the > device directly interacts with to be handled within the clock API > configuration rather than in a specific driver, this avoids the driver > being dependent on a particular system integration. I will have to figure out a way to propagate the frequency from leaf clocks to the parent clock. Will send out another patch with the fix. Thanks, Simran From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757461AbbLBCR7 (ORCPT ); Tue, 1 Dec 2015 21:17:59 -0500 Received: from mail-gw2-out.broadcom.com ([216.31.210.63]:9944 "EHLO mail-gw2-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755851AbbLBCR5 (ORCPT ); Tue, 1 Dec 2015 21:17:57 -0500 X-IronPort-AV: E=Sophos;i="5.20,371,1444719600"; d="scan'208";a="82118754" Subject: Re: [PATCH v4 2/3] ASoC: cygnus: Add Cygnus audio DAI driver To: Mark Brown References: <1447114664-21799-1-git-send-email-ssimran@broadcom.com> <1447114664-21799-3-git-send-email-ssimran@broadcom.com> <20151122134440.GQ26072@sirena.org.uk> CC: Rob Herring , Pawel Moll , "Mark Rutland" , Ian Campbell , Kumar Gala , Ray Jui , Scott Branden , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Lori Hikichi , , , , , Arun Parameswaran , From: Simran Rai Message-ID: <565E54D2.50806@broadcom.com> Date: Tue, 1 Dec 2015 18:17:54 -0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151122134440.GQ26072@sirena.org.uk> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/22/2015 5:44 AM, Mark Brown wrote: > On Mon, Nov 09, 2015 at 04:17:43PM -0800, Simran Rai wrote: > >> +#ifdef CONFIG_PM_SLEEP >> +static int cygnus_ssp_suspend(struct snd_soc_dai *cpu_dai) >> +{ >> + struct cygnus_aio_port *aio = cygnus_dai_get_portinfo(cpu_dai); >> + struct cygnus_audio *cygaud = snd_soc_dai_get_drvdata(cpu_dai); >> + >> + audio_ssp_out_disable(aio); >> + audio_ssp_in_disable(aio); >> + if (cygaud->active_ports > 0) >> + cygaud->active_ports--; >> + >> + return 0; >> +} >> + >> +static int cygnus_ssp_resume(struct snd_soc_dai *cpu_dai) >> +{ >> + return 0; >> +} > I'm a bit confused here - why do we need to disable things on suspend > but not reenable them on resume? I'd expect that the core would have > quiesced any streams that need to be suspended before we get as far as > suspending the drivers. > > Please also remove empty functions. > > Now I check I see that I'm repeating the questions I had on my previous > review: > > | Blank line between functions and remove empty functions. Though I'm not > | clear why the result doesn't undo what the suspend did... > > Please don't ignore review comments. Let me investigate this further and debug why the core did not quiescence the streams. > >> + parent = clk_get_parent(cygaud->audio_clk[0]); >> + if (IS_ERR(parent)) { >> + error = PTR_ERR(parent); >> + goto err_get_parent; >> + } >> + >> + /* Set PLL VCO Frequency (Hz) to default */ >> + error = clk_set_rate(parent, DEFAULT_VCO); >> + if (error) { >> + dev_err(&pdev->dev, >> + "%s Set PLL VCO rate failed: %d\n", __func__, error); >> + goto err_get_parent; >> + } > I would expect any initialisationn of clocks beyond the ones that the > device directly interacts with to be handled within the clock API > configuration rather than in a specific driver, this avoids the driver > being dependent on a particular system integration. I will have to figure out a way to propagate the frequency from leaf clocks to the parent clock. Will send out another patch with the fix. Thanks, Simran