From patchwork Thu Jun 20 13:47:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enric Balletbo i Serra X-Patchwork-Id: 11006685 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AE78E14B6 for ; Thu, 20 Jun 2019 13:47:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98ECA2877F for ; Thu, 20 Jun 2019 13:47:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CC4128787; Thu, 20 Jun 2019 13:47:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4397128765 for ; Thu, 20 Jun 2019 13:47:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=OxOyWMqnFCm7OmOGjVvnikMGOS+nzLkzP6aW594BVUU=; b=LWV/MgG8iu77ZU Uuz8Yw9bO8ELtqK1XTkvfLr6KQ82NFP0/sPmPoUOisd+sEkHaPtb3Vte+bjP32PeaV69Y1tsF/Sf7 ge6WB3uAu51lfk0LY8gww1esS5BY1r1Y2pAXhsZA+C7uyRjQiW1VKhYHQ8xgQBk2dzxxmZRgpZgoW 0lXVPjWjyyT0Ol0O5v+ckGbPsF5yEvP+poZrAcQ2Pydq+wEj2vVCSMQ91WSCJYxRpj/HtC/z0EU17 JFGqeHJSEqAARFQl7HSWMQovKVN/bjkkNlvNuLxYwXDHs/18idCweMDh/C2XFmDrIZNChF3x68SFf hX842l29NvWptSANw2eg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hdxPh-0001fM-NA; Thu, 20 Jun 2019 13:47:41 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hdxPM-0001L9-BC; Thu, 20 Jun 2019 13:47:21 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id C036826126D From: Enric Balletbo i Serra To: linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: rk3399_gru_sound: Support 32, 44.1 and 88.2 kHz sample rates Date: Thu, 20 Jun 2019 15:47:08 +0200 Message-Id: <20190620134708.28311-1-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190620_064720_600883_9DE8C048 X-CRM114-Status: UNSURE ( 9.08 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, Heiko Stuebner , Xing Zheng , Liam Girdwood , Takashi Iwai , Jaroslav Kysela , linux-rockchip@lists.infradead.org, Mark Brown , Collabora Kernel ML , Benson Leung , linux-arm-kernel@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP According to the datasheet the max98357a also supports 32, 44.1 and 88.2 kHz sample rate. This support was also introduced recently by commit fdf34366d324 ("ASoC: max98357a: add missing supported rates"). This patch adds support for these rates also for the machine driver so we get rid of the errors like the below and we are able to play files using these sample rates. rk3399-gru-sound sound: rockchip_sound_max98357a_hw_params() doesn't support this sample rate: 44100 rk3399-gru-sound sound: ASoC: machine hw_params failed: -22 Signed-off-by: Enric Balletbo i Serra --- sound/soc/rockchip/rk3399_gru_sound.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c index 3d0cc6e90d7b..8dfe1a560e42 100644 --- a/sound/soc/rockchip/rk3399_gru_sound.c +++ b/sound/soc/rockchip/rk3399_gru_sound.c @@ -59,7 +59,10 @@ static int rockchip_sound_max98357a_hw_params(struct snd_pcm_substream *substrea switch (params_rate(params)) { case 8000: case 16000: + case 32000: + case 44100: case 48000: + case 88200: case 96000: mclk = params_rate(params) * SOUND_FS; break;