From patchwork Thu Dec 19 21:09:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angus Ainslie X-Patchwork-Id: 11304399 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9E5F16C1 for ; Thu, 19 Dec 2019 21:12:09 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3203924679 for ; Thu, 19 Dec 2019 21:12:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="hJ5Q0q13"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=akkea.ca header.i=@akkea.ca header.b="vHqzFFVg"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=akkea.ca header.i=@akkea.ca header.b="vHqzFFVg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3203924679 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=akkea.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 61CFC1655; Thu, 19 Dec 2019 22:11:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 61CFC1655 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1576789926; bh=JnE8bVvA3y+DBhXNgmAG3a1/m/hDJxJ7hCHcb18eyhM=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=hJ5Q0q13asZcSNmsTXGpIAjnU4Tz0Yh5nueX6F80VE7gZvB8BibQzL1lhTiwW1026 5fTl3JI1kWS//iB4MuABfaOF+uXB0RQU/Md2ZsCzQbxp/uHsCxYEPQn67qbml3XZV2 u1SA1jCANH3WsnRy06WPSeNIoR3zJQce+uNsPy9E= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 399CCF80256; Thu, 19 Dec 2019 22:10:23 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 86FD9F8023F; Thu, 19 Dec 2019 22:10:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED autolearn=disabled version=3.4.0 Received: from node.akkea.ca (node.akkea.ca [192.155.83.177]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id AE534F8013E for ; Thu, 19 Dec 2019 22:10:03 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AE534F8013E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=akkea.ca header.i=@akkea.ca header.b="vHqzFFVg"; dkim=pass (1024-bit key) header.d=akkea.ca header.i=@akkea.ca header.b="vHqzFFVg" Received: from localhost (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id C4BF14E201A; Thu, 19 Dec 2019 21:10:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1576789801; bh=1wXn8lv1uClqi6KXMpwZnhaewdTksRHk6Y3gosxM1y8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=vHqzFFVgOsxYE2DQaiBgt3T73EttQNuqETQSqE+ldYNB3ULjJ4Xi31sG56t5Mc/tL 1PqkIHJBiYHzqvSdYwoGsiDsBY1QXXDiw8nmzOabNDOWCAr9xmIxPk+156HPgTZq2n 1e2KmUZjdkfp1u8DmY5DGz1EgJ7sl2Jm4/VELe+A= X-Virus-Scanned: Debian amavisd-new at mail.akkea.ca Received: from node.akkea.ca ([127.0.0.1]) by localhost (mail.akkea.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vH5YhjpaPgKf; Thu, 19 Dec 2019 21:10:01 +0000 (UTC) Received: from midas.localdomain (S0106788a2041785e.gv.shawcable.net [70.66.86.75]) by node.akkea.ca (Postfix) with ESMTPSA id 3AD404E2006; Thu, 19 Dec 2019 21:10:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1576789801; bh=1wXn8lv1uClqi6KXMpwZnhaewdTksRHk6Y3gosxM1y8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=vHqzFFVgOsxYE2DQaiBgt3T73EttQNuqETQSqE+ldYNB3ULjJ4Xi31sG56t5Mc/tL 1PqkIHJBiYHzqvSdYwoGsiDsBY1QXXDiw8nmzOabNDOWCAr9xmIxPk+156HPgTZq2n 1e2KmUZjdkfp1u8DmY5DGz1EgJ7sl2Jm4/VELe+A= From: "Angus Ainslie (Purism)" To: broonie@kernel.org Date: Thu, 19 Dec 2019 13:09:43 -0800 Message-Id: <20191219210944.18256-2-angus@akkea.ca> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191219210944.18256-1-angus@akkea.ca> References: <20191219210944.18256-1-angus@akkea.ca> Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, "Angus Ainslie \(Purism\)" , kernel@puri.sm, Liam Girdwood Subject: [alsa-devel] [PATCH v3 1/2] ASoC: gtm601: add Broadmobi bm818 sound profile X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The Broadmobi bm818 uses stereo sound at 48Khz sample rate Signed-off-by: Angus Ainslie (Purism) --- sound/soc/codecs/gtm601.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/gtm601.c b/sound/soc/codecs/gtm601.c index d454294c8d06..3374362741a6 100644 --- a/sound/soc/codecs/gtm601.c +++ b/sound/soc/codecs/gtm601.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include @@ -37,7 +37,7 @@ static struct snd_soc_dai_driver gtm601_dai = { .channels_max = 1, .rates = SNDRV_PCM_RATE_8000, .formats = SNDRV_PCM_FMTBIT_S16_LE, - }, + }, .capture = { .stream_name = "Capture", .channels_min = 1, @@ -47,6 +47,24 @@ static struct snd_soc_dai_driver gtm601_dai = { }, }; +static struct snd_soc_dai_driver bm818_dai = { + .name = "bm818", + .playback = { + .stream_name = "Playback", + .channels_min = 2, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_48000, + .formats = SNDRV_PCM_FMTBIT_S16_LE, + }, + .capture = { + .stream_name = "Capture", + .channels_min = 2, + .channels_max = 2, + .rates = SNDRV_PCM_RATE_48000, + .formats = SNDRV_PCM_FMTBIT_S16_LE, + }, +}; + static const struct snd_soc_component_driver soc_component_dev_gtm601 = { .dapm_widgets = gtm601_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(gtm601_dapm_widgets), @@ -60,13 +78,18 @@ static const struct snd_soc_component_driver soc_component_dev_gtm601 = { static int gtm601_platform_probe(struct platform_device *pdev) { + struct snd_soc_dai_driver *dai_driver; + + dai_driver = of_device_get_match_data(&pdev->dev); + return devm_snd_soc_register_component(&pdev->dev, - &soc_component_dev_gtm601, >m601_dai, 1); + &soc_component_dev_gtm601, dai_driver, 1); } #if defined(CONFIG_OF) static const struct of_device_id gtm601_codec_of_match[] = { - { .compatible = "option,gtm601", }, + { .compatible = "option,gtm601", .data = (void *)>m601_dai }, + { .compatible = "broadmobi,bm818", .data = (void *)&bm818_dai }, {}, }; MODULE_DEVICE_TABLE(of, gtm601_codec_of_match);