From patchwork Fri Jul 28 19:31:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 9869289 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D2275603F9 for ; Fri, 28 Jul 2017 19:31:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7A2D2888A for ; Fri, 28 Jul 2017 19:31:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB253288FD; Fri, 28 Jul 2017 19:31:57 +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=-1.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9BCD288F1 for ; Fri, 28 Jul 2017 19:31:56 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 56B2D266986; Fri, 28 Jul 2017 21:31:51 +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 503652669CD; Fri, 28 Jul 2017 21:31:50 +0200 (CEST) Received: from mail-qk0-f195.google.com (mail-qk0-f195.google.com [209.85.220.195]) by alsa0.perex.cz (Postfix) with ESMTP id 4EB6C2664EB for ; Fri, 28 Jul 2017 21:31:47 +0200 (CEST) Received: by mail-qk0-f195.google.com with SMTP id d136so21940483qkg.3 for ; Fri, 28 Jul 2017 12:31:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zDz0ADIwIUfUh7ebH0/NCvu4Bh7TzkCzQ8ogwHdEo8g=; b=DDgKfcfqmTX3kodFaRd3hTT/UR+B6bX2NrNZA6MlGDXgA3SnlvPOrib7iHFjrrz44K hituPSPgTV24D57GpbAC26WckU4GRgyxGkNUcDTeJ5RF2NCLS+hQoTv1zprbkbB1WeVj Nceof1o3l+gzD5ClcSXfU/jRM+qF0RuQm90bgHfByq0UUl/bGFKjuHEpY/xQpTRtl7Jl GvcARMO/QABJXO81C0ACMOkv5zimn1sorPYN7h6l1cQ6FEN7kTZvtMyjqfaA7cFY6WwL 8dZC93p00gFmKjZ7YixfdTOU7Ol7eXVE71TJDwEEErwgyHWFARgA4Mc8lNv1BvB2IuKR KcTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zDz0ADIwIUfUh7ebH0/NCvu4Bh7TzkCzQ8ogwHdEo8g=; b=e9/aBvUDFWlxWtcQlh++djASOXLkLTkaiBSindwlzb7RoFzIVszDgVWMVsXkzZ3vQh F+jKdDQOgBVF671H56gnLKdd6IcSB6FmdTG8jl86/OvfCs7eG9E32Lc9+gi0DD3uyFNx PQRUKOAWKNuHzlUdbcyQegNTzkED2EZ8KQf5YFP7YSKQ+jQ4poMNLek7kcLFgLdziD07 MBipse/HeGLBxjXBhUFuehxR8Tsck0HhxAWOOZNgvxpaxiekQRDN7gWcTzyFLSVk9wBC vFYH3fIiuEaSAoV2WQMcts99vWxmT8JMWvIDAWM2uhBkBBxLBlaaCKSqjkPYsMAwfH2a UtPA== X-Gm-Message-State: AIVw112kyn+D1+OQwOWOq26O+m8PXwqtDEZqWaalUaUWT8nHt6hU9Xuu MpCQ9IdXIJ2ZOg== X-Received: by 10.55.166.207 with SMTP id p198mr10767147qke.132.1501270307266; Fri, 28 Jul 2017 12:31:47 -0700 (PDT) Received: from cm.localdomain (va-67-233-122-109.dhcp.embarqhsd.net. [67.233.122.109]) by smtp.gmail.com with ESMTPSA id j21sm16189153qtc.17.2017.07.28.12.31.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Jul 2017 12:31:46 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, alsa-devel@alsa-project.org, airlied@gmail.com, broonie@kernel.org, Vijendar.Mukunda@amd.com, rajeevkumar.linux@gmail.com, perex@perex.cz Date: Fri, 28 Jul 2017 15:31:26 -0400 Message-Id: <1501270294-31153-2-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1501270294-31153-1-git-send-email-alexander.deucher@amd.com> References: <1501270294-31153-1-git-send-email-alexander.deucher@amd.com> Cc: tiwai@suse.de, Alex Deucher , lgirdwood@gmail.com Subject: [alsa-devel] [PATCH 1/9] ASoC: dwc: Added a quirk DW_I2S_QUIRK_16BIT_IDX_OVERRIDE to dwc driver 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 From: Vijendar Mukunda Added quirk DW_I2S_QUIRK_16BIT_IDX_OVERRIDE to Designware driver. This quirk will set idx value to 1. By setting this quirk, it will override supported format as 16 bit resolution and bus width as 2 Bytes. Reviewed-by: Alex Deucher Signed-off-by: Vijendar Mukunda Signed-off-by: Alex Deucher --- This patch is already applied to the audio tree, I'm just including it here for completeness since it's not yet in the drm tree. include/sound/designware_i2s.h | 1 + sound/soc/dwc/dwc-i2s.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/sound/designware_i2s.h b/include/sound/designware_i2s.h index 5681855..830f5ca 100644 --- a/include/sound/designware_i2s.h +++ b/include/sound/designware_i2s.h @@ -47,6 +47,7 @@ struct i2s_platform_data { #define DW_I2S_QUIRK_COMP_REG_OFFSET (1 << 0) #define DW_I2S_QUIRK_COMP_PARAM1 (1 << 1) + #define DW_I2S_QUIRK_16BIT_IDX_OVERRIDE (1 << 2) unsigned int quirks; unsigned int i2s_reg_comp1; unsigned int i2s_reg_comp2; diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c index 9c46e41..9160676 100644 --- a/sound/soc/dwc/dwc-i2s.c +++ b/sound/soc/dwc/dwc-i2s.c @@ -496,6 +496,8 @@ static int dw_configure_dai(struct dw_i2s_dev *dev, idx = COMP1_TX_WORDSIZE_0(comp1); if (WARN_ON(idx >= ARRAY_SIZE(formats))) return -EINVAL; + if (dev->quirks & DW_I2S_QUIRK_16BIT_IDX_OVERRIDE) + idx = 1; dw_i2s_dai->playback.channels_min = MIN_CHANNEL_NUM; dw_i2s_dai->playback.channels_max = 1 << (COMP1_TX_CHANNELS(comp1) + 1); @@ -508,6 +510,8 @@ static int dw_configure_dai(struct dw_i2s_dev *dev, idx = COMP2_RX_WORDSIZE_0(comp2); if (WARN_ON(idx >= ARRAY_SIZE(formats))) return -EINVAL; + if (dev->quirks & DW_I2S_QUIRK_16BIT_IDX_OVERRIDE) + idx = 1; dw_i2s_dai->capture.channels_min = MIN_CHANNEL_NUM; dw_i2s_dai->capture.channels_max = 1 << (COMP1_RX_CHANNELS(comp1) + 1); @@ -543,6 +547,8 @@ static int dw_configure_dai_by_pd(struct dw_i2s_dev *dev, if (ret < 0) return ret; + if (dev->quirks & DW_I2S_QUIRK_16BIT_IDX_OVERRIDE) + idx = 1; /* Set DMA slaves info */ dev->play_dma_data.pd.data = pdata->play_dma_data; dev->capture_dma_data.pd.data = pdata->capture_dma_data;