From patchwork Mon Nov 17 10:57:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 5317751 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8BF8FC11AC for ; Mon, 17 Nov 2014 10:59:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B9108201F2 for ; Mon, 17 Nov 2014 10:59:46 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id DAD5620173 for ; Mon, 17 Nov 2014 10:59:44 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id E8410261A06; Mon, 17 Nov 2014 11:59:43 +0100 (CET) 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, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 164F3261643; Mon, 17 Nov 2014 11:59:28 +0100 (CET) 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 166B326166B; Mon, 17 Nov 2014 11:59:25 +0100 (CET) Received: from opensource.wolfsonmicro.com (opensource.wolfsonmicro.com [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id 04103261615 for ; Mon, 17 Nov 2014 11:59:14 +0100 (CET) Received: from localhost.localdomain (unknown [87.246.78.26]) by opensource.wolfsonmicro.com (Postfix) with ESMTPSA id F058E110AFE; Mon, 17 Nov 2014 10:59:12 +0000 (GMT) From: Richard Fitzgerald To: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, ben-linux@fluff.org, kgene.kim@samsung.com, broonie@kernel.org Date: Mon, 17 Nov 2014 10:57:54 +0000 Message-Id: <1416221874-22092-1-git-send-email-rf@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.7.2.5 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, tiwai@suse.de, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, sbkim73@samsung.com, galak@codeaurora.org, ckeepax@opensource.wolfsonmicro.com, linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH] ASoC: samsung-i2s: Add 192kHz config option 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Adds QUIRK_SUPPORTS_192KHZ to allow 192kHz rate to be selected for hardware that supports it. Signed-off-by: Richard Fitzgerald --- .../devicetree/bindings/sound/samsung-i2s.txt | 2 ++ include/linux/platform_data/asoc-s3c.h | 1 + sound/soc/samsung/i2s.c | 8 ++++++++ 3 files changed, 11 insertions(+), 0 deletions(-) diff --git a/Documentation/devicetree/bindings/sound/samsung-i2s.txt b/Documentation/devicetree/bindings/sound/samsung-i2s.txt index d188296..c3f3950 100644 --- a/Documentation/devicetree/bindings/sound/samsung-i2s.txt +++ b/Documentation/devicetree/bindings/sound/samsung-i2s.txt @@ -40,6 +40,8 @@ Optional SoC Specific Properties: sub system(used in secondary sound source). - pinctrl-0: Should specify pin control groups used for this controller. - pinctrl-names: Should contain only one value - "default". +- samsung,supports-192khz: specify this (without a value) if you want to allow + 192000 sample rate over the I2S link. Example: diff --git a/include/linux/platform_data/asoc-s3c.h b/include/linux/platform_data/asoc-s3c.h index 5e0bc77..6d0702d 100644 --- a/include/linux/platform_data/asoc-s3c.h +++ b/include/linux/platform_data/asoc-s3c.h @@ -28,6 +28,7 @@ struct samsung_i2s { #define QUIRK_NEED_RSTCLR (1 << 3) #define QUIRK_SUPPORTS_TDM (1 << 4) #define QUIRK_SUPPORTS_IDMA (1 << 5) +#define QUIRK_SUPPORTS_192KHZ (1 << 6) /* Quirks of the I2S controller */ u32 quirks; dma_addr_t idma_addr; diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 947352d..f688e89 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1219,6 +1219,9 @@ static int samsung_i2s_probe(struct platform_device *pdev) "specified"); } } + + if (of_find_property(np, "samsung,supports-192khz", NULL)) + quirks |= QUIRK_SUPPORTS_192KHZ; } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -1247,6 +1250,11 @@ static int samsung_i2s_probe(struct platform_device *pdev) if (quirks & QUIRK_PRI_6CHAN) pri_dai->i2s_dai_drv.playback.channels_max = 6; + if (quirks & QUIRK_SUPPORTS_192KHZ) { + pri_dai->i2s_dai_drv.playback.rates |= SNDRV_PCM_RATE_192000; + pri_dai->i2s_dai_drv.capture.rates |= SNDRV_PCM_RATE_192000; + } + if (quirks & QUIRK_SEC_DAI) { sec_dai = i2s_alloc_dai(pdev, true); if (!sec_dai) {