From patchwork Fri Jun 23 16:35:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 9806899 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 B225F60349 for ; Fri, 23 Jun 2017 16:35:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A10D728524 for ; Fri, 23 Jun 2017 16:35:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95EC628794; Fri, 23 Jun 2017 16:35:24 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4ED9928524 for ; Fri, 23 Jun 2017 16:35:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 21A1E6E11D; Fri, 23 Jun 2017 16:35:20 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x241.google.com (mail-qk0-x241.google.com [IPv6:2607:f8b0:400d:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4A0FB6E11C; Fri, 23 Jun 2017 16:35:17 +0000 (UTC) Received: by mail-qk0-x241.google.com with SMTP id 16so6867288qkg.2; Fri, 23 Jun 2017 09:35:17 -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=UkwGyqWok7RAard/QAUTnWqYNfrTJlGVHBF86y1PJjQ=; b=usUOzetFfA/YTVW1+A3GFJ5jKE8V8quCq8kvrcAC6CETymq0+OGu9Lyc1CqyyvimWf jnPDRF7M37YnUudx5u6t/GnuIlEa/6nCPHOgq4FAgNd9mzrJFJCXB3IL0/PwdZT+BfJT aHTpi5qFhsAhxNQHbVhCsLejrwKlj6ZY6nwtK2/pKjUqa/bR2aMiNu5mTkxSZfcTrXNG wY3fgXya2fmfcQGv5lwKQPyzbmXQ/d5DAu+00PeGbkyIrKz1+jv344FTqnvf4tlWDRd7 Xu0p/GmveVb32bEl1uqlKxJTKCUl8TlCbSEvKZPTlLzK8HY16+pvKYi7/6uk2kHBgpT7 fu+Q== 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=UkwGyqWok7RAard/QAUTnWqYNfrTJlGVHBF86y1PJjQ=; b=D3+ioUm1uJ1nNF+W1bzClBEe4lDnOEyQWsxoMi1OcUpIPfaW+Y9E5/GJafUlTI2awH kJFFHVO9fG3zQBGdh+s5W1GJkZv5ULeUoulE/eqgmaeToMv5RiSqGGv1qqNE5AB5WS+t x4CxnjF/nbcut0KssC/jjHI632lsXAxQ6EI5V5yswiTBpdt09TXuUbxqn0vIlBqEwybJ Xk4M5Cg7NmoIMtCWGOIWHZVw3MrLubWPGYKjPnXY+cQA26ItBJMHqn+i7tfmAjsg37Bt oDXH9XSB83UlcqN+ET3wEBuJwHAnXh6QoN13pgQKSv+GRgrZBZmt6IY8znOtAEGTDXnt extQ== X-Gm-Message-State: AKS2vOz9YAyxTmGj033NRP9aCTbej8GUh/kcg2Q3jxqEiHUG0KDB+UHi 73qAAK4l3rwdyuVN X-Received: by 10.55.212.199 with SMTP id s68mr10726609qks.88.1498235716275; Fri, 23 Jun 2017 09:35:16 -0700 (PDT) Received: from cm.localdomain (va-67-76-166-195.sta.embarqhsd.net. [67.76.166.195]) by smtp.gmail.com with ESMTPSA id 5sm3793284qkr.27.2017.06.23.09.35.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jun 2017 09:35:15 -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 Subject: [PATCH 2/8] ASoC: dwc: Added a quirk DW_I2S_QUIRK_16BIT_IDX_OVERRIDE to dwc driver Date: Fri, 23 Jun 2017 12:35:00 -0400 Message-Id: <1498235706-31111-3-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1498235706-31111-1-git-send-email-alexander.deucher@amd.com> References: <1498235706-31111-1-git-send-email-alexander.deucher@amd.com> Cc: Alex Deucher , lgirdwood@gmail.com, perex@perex.cz X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- 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;