From patchwork Thu Jul 16 09:36:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud POULIQUEN X-Patchwork-Id: 6805771 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A5EA4C05AC for ; Thu, 16 Jul 2015 09:37:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CA88F20781 for ; Thu, 16 Jul 2015 09:37:06 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 7C3232053B for ; Thu, 16 Jul 2015 09:37:05 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9AF69266564; Thu, 16 Jul 2015 11:37:04 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id C986F266218; Thu, 16 Jul 2015 11:36:28 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id D9CDE2664AA; Thu, 16 Jul 2015 11:36:26 +0200 (CEST) Received: from mx08-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by alsa0.perex.cz (Postfix) with ESMTP id 28D75266218 for ; Thu, 16 Jul 2015 11:36:22 +0200 (CEST) Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.14.5/8.14.5) with SMTP id t6G9aKtW005557; Thu, 16 Jul 2015 11:36:21 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 1vnt5wuv45-1 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 16 Jul 2015 11:36:21 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B8B7846; Thu, 16 Jul 2015 09:36:14 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A5422542F; Thu, 16 Jul 2015 09:36:14 +0000 (GMT) Received: from localhost (10.201.23.162) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 16 Jul 2015 11:36:14 +0200 From: Arnaud Pouliquen To: Date: Thu, 16 Jul 2015 11:36:02 +0200 Message-ID: <1437039367-30842-2-git-send-email-arnaud.pouliquen@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1437039367-30842-1-git-send-email-arnaud.pouliquen@st.com> References: <1437039367-30842-1-git-send-email-arnaud.pouliquen@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.23.162] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.14.151, 1.0.33, 0.0.0000 definitions=2015-07-16_02:2015-07-16, 2015-07-16, 1970-01-01 signatures=0 Cc: broonie@kernel.org, arnaud.pouliquen@st.com, lgirdwood@gmail.com, kernel@stlinux.com Subject: [alsa-devel] [PATCH 1/6] ASoC: sti: minor corrections for uniplayer X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Minor corrections after code review. Signed-off-by: Arnaud Pouliquen --- sound/soc/sti/uniperif_player.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sound/soc/sti/uniperif_player.c b/sound/soc/sti/uniperif_player.c index d66d633..d12d050 100644 --- a/sound/soc/sti/uniperif_player.c +++ b/sound/soc/sti/uniperif_player.c @@ -475,6 +475,7 @@ static int uni_player_set_sysclk(struct snd_soc_dai *dai, int clk_id, { struct sti_uniperiph_data *priv = snd_soc_dai_get_drvdata(dai); struct uniperif *player = priv->dai_data.uni; + int ret; if (dir == SND_SOC_CLOCK_IN) return 0; @@ -482,9 +483,11 @@ static int uni_player_set_sysclk(struct snd_soc_dai *dai, int clk_id, if (clk_id != 0) return -EINVAL; - player->mclk = freq; + ret = clk_set_rate(player->clk, freq); + if (!ret) + player->mclk = freq; - return clk_set_rate(player->clk, freq); + return ret; } static int uni_player_prepare(struct snd_pcm_substream *substream, @@ -562,6 +565,7 @@ static int uni_player_prepare(struct snd_pcm_substream *substream, case SND_SOC_DAIFMT_IB_IF: SET_UNIPERIF_I2S_FMT_LR_POL_HIG(player); SET_UNIPERIF_I2S_FMT_SCLK_EDGE_FALLING(player); + break; } switch (player->daifmt & SND_SOC_DAIFMT_FORMAT_MASK) { @@ -840,7 +844,7 @@ int uni_player_init(struct platform_device *pdev, /* Get uniperif resource */ player->clk = of_clk_get(pdev->dev.of_node, 0); if (IS_ERR(player->clk)) - ret = (int)PTR_ERR(player->clk); + ret = PTR_ERR(player->clk); /* Select the frequency synthesizer clock */ if (player->clk_sel) {