From patchwork Sun Dec 2 21:23:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mesih Kilinc X-Patchwork-Id: 10708393 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A3C0118A7 for ; Sun, 2 Dec 2018 21:40:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85CDB2A742 for ; Sun, 2 Dec 2018 21:40:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7924F2A71F; Sun, 2 Dec 2018 21:40:19 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1F8822A721 for ; Sun, 2 Dec 2018 21:40:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=qbGz3YTGMy79CLVlF/U+QIB4OYaIeY5ISB+515SU6jw=; b=W63DOnUcrLhQDqUZEEWVAs+xZ/ +sKxWQhm9Tbinx2myz3SVVEcFBr/6G9v/lbFsAktFv2FdBi64eNbXABmmdLuZ21dXq+UMQxdbSu9V 7YT0LwRJ/jsg8D+SxXN1vsUlihDfv640h+yWsTH4vxVZ3aOGZ3HKNqYzW96A85TfKNTELcYZOQcNZ oItfDmwp/LXSaSLvTMPXY9v7eENnR/aPfK9DQplq1CrNmcSF5ldtVZcQHB2YEClOO+x2Jk711xGB9 Ugr1WRUvFU5Na420dZC8uBKYkttX/Bd0RQw4cVwQnalYn0/TaJe31Lpnffv9rC/8X4sUohx3OzO6r J/mg3yrA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gTZTN-0003at-6R; Sun, 02 Dec 2018 21:40:17 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gTZDU-0001uR-B9 for linux-arm-kernel@lists.infradead.org; Sun, 02 Dec 2018 21:24:08 +0000 Received: by mail-wr1-x441.google.com with SMTP id v13so10138411wrw.5 for ; Sun, 02 Dec 2018 13:23:42 -0800 (PST) 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=W+LxMji1rmgC9t/lu72XSjJGgts2lQWuFigEHj6EqQ0=; b=pv7kgQ5tYm0WM/80+JIkCQritf3PIkUgpyqbbGK+38rYocyqk87xx0wmbVweojIq35 pK7DTFkO/ylyYrWoBaBU/0ZbuWt1SzxjK3Xt3hUcUF8DkkXWSnJH90HLWeZ+Jc5jl2kh +gYL2hLFa6iFYXRsf9RR7QVm7gR3dSLAA2BRww2uQngWvqT9vLXHa12VaN6/VjoqnOm8 vpICHeA0fuavWp5jkCOPOxlah/b+XEpt0m/BFR0VpfIPr4Ni5d5GirfkrsWySBO/qPaW 9sW7EjaCHr04j5bgTKVosq0qkyd1WdfYMN1AU89Wu+Sh8nSMFjpEjUgjKROUDvSarW1d 62rg== 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=W+LxMji1rmgC9t/lu72XSjJGgts2lQWuFigEHj6EqQ0=; b=eVfewoD1F8F0xB8f93ZhMHPtRdYVVt/kML1N1BE6o0jDQQfrW66HwVJ1dqgC/+XE4y AR2LUZ4sQ4tW4qE6GsR5rJzPTiEjXnYGXTFWCz3WTNFtE2EGZ/4yrY3J6k4KqMxLWsmi DyaZQLpH5Hn2H8E5fN1iq5eNlSlORKjzZ1IKrTlZUhk+8HZLBi0aM+IZOECvLT6QrAVl 0jOyyJduhMoETHWPvMLHhATUSPzGznMEGPOQKBMFJpaz87meRj3FDe85ptnGbCoqLniN NaI8P2OM2+d6Ev48p4d0zYuR5T4AMqV1pq7h953RG2NAmcyQEnZfhVVHr8LZDluoP23a JVMQ== X-Gm-Message-State: AA+aEWbp2liNUPkcFNUzcMt0OznvWqts0sTk8ZQnUuf6duMPQpnEpTlj EKMwg7aTRX2HHnZcfLsGxWg= X-Google-Smtp-Source: AFSGD/Ur4YLCDN09H9lZy5dwOP6hgbKYzs8y6dXHpKgREYU7iFhdFYvt3J3Tl/0ElcnaIq8COpOzEQ== X-Received: by 2002:adf:8228:: with SMTP id 37mr11440991wrb.160.1543785820865; Sun, 02 Dec 2018 13:23:40 -0800 (PST) Received: from ThinkPad.home ([185.219.177.152]) by smtp.gmail.com with ESMTPSA id d2sm9551043wrs.97.2018.12.02.13.23.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 02 Dec 2018 13:23:40 -0800 (PST) From: Mesih Kilinc To: dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-sunxi@googlegroups.com Subject: [RFC PATCH 06/10] ASoC: sun4i-codec: Add DMA Max Burst field Date: Mon, 3 Dec 2018 00:23:13 +0300 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181202_132353_116179_2C7B6DBB X-CRM114-Status: GOOD ( 15.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Mesih Kilinc , Mark Brown , Takashi Iwai , Chen-Yu Tsai , Liam Girdwood , Maxime Ripard , Vinod Koul , Rob Herring , Jaroslav Kysela MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Allwinner suniv F1C100s has similar DMA engine to sun4i but it has smaller max burst size compared to sun4i. Add a quirk field to differantitate between them. Signed-off-by: Mesih Kilinc --- sound/soc/sunxi/sun4i-codec.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index 9a3cb77..7a9f84e 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -224,6 +224,8 @@ /* TODO H3 DAP (Digital Audio Processing) bits */ +#define SUN4I_DMA_MAX_BURST (8) + struct sun4i_codec { struct device *dev; struct regmap *regmap; @@ -1462,6 +1464,7 @@ struct sun4i_codec_quirks { unsigned int reg_dac_txdata; /* TX FIFO offset for DMA config */ unsigned int reg_adc_rxdata; /* RX FIFO offset for DMA config */ bool has_reset; + u32 dma_max_burst; }; static const struct sun4i_codec_quirks sun4i_codec_quirks = { @@ -1471,6 +1474,7 @@ static const struct sun4i_codec_quirks sun4i_codec_quirks = { .reg_adc_fifoc = REG_FIELD(SUN4I_CODEC_ADC_FIFOC, 0, 31), .reg_dac_txdata = SUN4I_CODEC_DAC_TXDATA, .reg_adc_rxdata = SUN4I_CODEC_ADC_RXDATA, + .dma_max_burst = SUN4I_DMA_MAX_BURST, }; static const struct sun4i_codec_quirks sun6i_a31_codec_quirks = { @@ -1481,6 +1485,7 @@ static const struct sun4i_codec_quirks sun6i_a31_codec_quirks = { .reg_dac_txdata = SUN4I_CODEC_DAC_TXDATA, .reg_adc_rxdata = SUN6I_CODEC_ADC_RXDATA, .has_reset = true, + .dma_max_burst = SUN4I_DMA_MAX_BURST, }; static const struct sun4i_codec_quirks sun7i_codec_quirks = { @@ -1490,6 +1495,7 @@ static const struct sun4i_codec_quirks sun7i_codec_quirks = { .reg_adc_fifoc = REG_FIELD(SUN4I_CODEC_ADC_FIFOC, 0, 31), .reg_dac_txdata = SUN4I_CODEC_DAC_TXDATA, .reg_adc_rxdata = SUN4I_CODEC_ADC_RXDATA, + .dma_max_burst = SUN4I_DMA_MAX_BURST, }; static const struct sun4i_codec_quirks sun8i_a23_codec_quirks = { @@ -1500,6 +1506,7 @@ static const struct sun4i_codec_quirks sun8i_a23_codec_quirks = { .reg_dac_txdata = SUN4I_CODEC_DAC_TXDATA, .reg_adc_rxdata = SUN6I_CODEC_ADC_RXDATA, .has_reset = true, + .dma_max_burst = SUN4I_DMA_MAX_BURST, }; static const struct sun4i_codec_quirks sun8i_h3_codec_quirks = { @@ -1515,6 +1522,7 @@ static const struct sun4i_codec_quirks sun8i_h3_codec_quirks = { .reg_dac_txdata = SUN8I_H3_CODEC_DAC_TXDATA, .reg_adc_rxdata = SUN6I_CODEC_ADC_RXDATA, .has_reset = true, + .dma_max_burst = SUN4I_DMA_MAX_BURST, }; static const struct sun4i_codec_quirks sun8i_v3s_codec_quirks = { @@ -1529,6 +1537,7 @@ static const struct sun4i_codec_quirks sun8i_v3s_codec_quirks = { .reg_dac_txdata = SUN8I_H3_CODEC_DAC_TXDATA, .reg_adc_rxdata = SUN6I_CODEC_ADC_RXDATA, .has_reset = true, + .dma_max_burst = SUN4I_DMA_MAX_BURST, }; static const struct of_device_id sun4i_codec_of_match[] = { @@ -1655,12 +1664,12 @@ static int sun4i_codec_probe(struct platform_device *pdev) /* DMA configuration for TX FIFO */ scodec->playback_dma_data.addr = res->start + quirks->reg_dac_txdata; - scodec->playback_dma_data.maxburst = 8; + scodec->playback_dma_data.maxburst = quirks->dma_max_burst; scodec->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; /* DMA configuration for RX FIFO */ scodec->capture_dma_data.addr = res->start + quirks->reg_adc_rxdata; - scodec->capture_dma_data.maxburst = 8; + scodec->capture_dma_data.maxburst = quirks->dma_max_burst; scodec->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; ret = devm_snd_soc_register_component(&pdev->dev, quirks->codec,