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: 9869283 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 16FAA60382 for ; Fri, 28 Jul 2017 19:31:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AEBA288C6 for ; Fri, 28 Jul 2017 19:31:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3F82288E5; Fri, 28 Jul 2017 19:31:52 +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 7600E288C6 for ; Fri, 28 Jul 2017 19:31:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E20326F4D8; Fri, 28 Jul 2017 19:31:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x242.google.com (mail-qk0-x242.google.com [IPv6:2607:f8b0:400d:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 41ADB6F4D1; Fri, 28 Jul 2017 19:31:48 +0000 (UTC) Received: by mail-qk0-x242.google.com with SMTP id q66so21932080qki.1; Fri, 28 Jul 2017 12:31:48 -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=pVLzVaQqN790vO8DB3gG3UwLwA7lLwRosVCwAQB6Zc4A34jvO184KLKc01QYbp0DXv v0bK24hJ6pTkdZUnZI79oNe6kBlTouQ69rHuz8q1Mj5BY/P/s0uwm9NtRWyJ+XtUX38E 6ioR5iEeK0ptHOMyrcT9eMRhVAWAlxcoBso3SDih6dan5xTkwsDfjYpWvD3Xh7uES0fH P7U0Vwmnh7+HjsaoSJCW7udBe61j0HttgIr/ndSIOiW7Mh5IYMJ49NaF3In8O9toeSPi hOW5pieizDQwia80KWrU1A/ubbc/tPChp+23NJNQrKQ62W+59G9NivqinCoxLPTvYCuO U4wQ== X-Gm-Message-State: AIVw110Kb5MrjM6628NzR87d+7G6aP365Wl9v8GQKbGMw5ht3Xis00kD 2QQDwQKMJvFj2b9X 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 Subject: [PATCH 1/9] ASoC: dwc: Added a quirk DW_I2S_QUIRK_16BIT_IDX_OVERRIDE to dwc driver 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: Alex Deucher , lgirdwood@gmail.com 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 --- 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;