From patchwork Sun Oct 27 09:14:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q3PDs2vDoXMsIEJlbmNl?= X-Patchwork-Id: 13852440 Received: from fw2.prolan.hu (fw2.prolan.hu [193.68.50.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCFCE71747; Sun, 27 Oct 2024 09:21:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.68.50.107 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730020864; cv=none; b=ezL/eCND2qOfL4x01/g9RYW2cXJDGJ4s+jch9C/CinD9bsp9OA/TnWkH/owCvLihO/4UadNTb3duZ/wt4ajadlomCrB3J2YXhibaQbcQfPtU9Z7j2Clh6jCJkGiT1yBzEpwGtOiOJaYX5/eUNSnSEpPzoZYoTdigN/HAv8l92tU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730020864; c=relaxed/simple; bh=mqTfgVE+RvSC0vOZZaB8lIS+Eo/LQjKXUdoWqw3WlYo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Uxf1XG7G5SobYKNJ6DNsclFjedgSqTa9Rf+zZZtgQd5wCf7fojq/AlNMsYZylC8DqUmh0QCea1LUqavMX8EWCEfGrhZ9Lo5UY2O1vApePQ12exBp9yoE+tJ/LHsI+9bh5aFwdr9J+FkpBlbFOgUKcKtrgwR6mpkJS+LZjAUIbiM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=prolan.hu; spf=pass smtp.mailfrom=prolan.hu; dkim=pass (4096-bit key) header.d=prolan.hu header.i=@prolan.hu header.b=OcLO8Sox; arc=none smtp.client-ip=193.68.50.107 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=prolan.hu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=prolan.hu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=prolan.hu header.i=@prolan.hu header.b="OcLO8Sox" Received: from proxmox-mailgw.intranet.prolan.hu (localhost.localdomain [127.0.0.1]) by proxmox-mailgw.intranet.prolan.hu (Proxmox) with ESMTP id CBF47A0732; Sun, 27 Oct 2024 10:21:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prolan.hu; h=cc :cc:content-transfer-encoding:content-type:content-type:date :from:from:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=mail; bh=r0CnKvN9m+WI5EUXZnjc txTxd3fim6W3pLphwiV0RY4=; b=OcLO8SoxJ+0owOuhhFvFfA2K/2R8Avx/rleY yEYxIORLLvtrMP5bodxKEgUVJKLOU6SBJRmzbJWo8U2/iXp7jPmnrLYgljVIdG+A NAsKft85hPkTw3IKFfAmDtIvK6SbShHy3qcNZiQ85350canKj8mOpQjblTrbq/F1 /IdO0zOLAOE4yaUnEgf6GsuB0C+hHdeN5NZ2tu+1XprlS7nN+alD+tJBSUg+fKNT SO1cy45WBdCOJ5gcu5bMhUK39GbgOOJYR/QOsUm7IsHXugiDwRMWcslKcjFxNR8c lLYxNS/3mUuDbyPxKcunLWDgNnjfZ3LQHhWDBQ+QBEltPmVk34rDh4vFOXafLYIi kF5fmSdUgfgM60r6Nqc/cP7+aX4YMw8/DafqiD/vaE0GBZbTChz4Hp+sbg4DsQQm X9DPubtjFoBP3tumoy3gbpzeRpBUe4Pb5tv9rHE6duO4P7HLwsE7TzSAi4csd5/o r01ySwwIVxaMl1uPxERK0jKYbW4tEPysFkGHRK10ro0NTDgHrDb8E08ev4dvp6Fz /k/HHtTu2wbO7Xz7fmCqYcw2UxzxHe84yA1pLXcdE7raB2Hm6jniPiTY6ihB+eyU z3sJzRR2M84m7cGX2xrs2o4scBuzVRTihM9ymzRDhFV0QG+lDaqfQKrH2ZuZScYa dttfJ68= From: =?utf-8?b?Q3PDs2vDoXMsIEJlbmNl?= To: , , , CC: Mesih Kilinc , =?utf-8?b?Q3PDs2vDoXMsIEJlbmNl?= , "Liam Girdwood" , Mark Brown , "Jaroslav Kysela" , Takashi Iwai , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Subject: [PATCH v2 06/10] ASoC: sun4i-codec: Add DMA Max Burst field Date: Sun, 27 Oct 2024 10:14:37 +0100 Message-ID: <20241027091440.1913863-6-csokas.bence@prolan.hu> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241027091440.1913863-1-csokas.bence@prolan.hu> References: <20241027091440.1913863-1-csokas.bence@prolan.hu> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ESET-AS: R=OK;S=0;OP=CALC;TIME=1730020860;VERSION=7978;MC=4051380212;ID=156042;TRN=0;CRV=0;IPC=;SP=0;SIPS=0;PI=3;F=0 X-ESET-Antispam: OK X-EsetResult: clean, is OK X-EsetId: 37303A29ACD94855677D65 From: Mesih Kilinc 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 [ csokas.bence: Rebased on current master ] Signed-off-by: Csókás, Bence --- 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 330bc0c09f56..4953b5013c58 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -228,6 +228,8 @@ /* TODO H3 DAP (Digital Audio Processing) bits */ +#define SUN4I_DMA_MAX_BURST (8) + struct sun4i_codec { struct device *dev; struct regmap *regmap; @@ -1568,6 +1570,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 = { @@ -1577,6 +1580,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 = { @@ -1587,6 +1591,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 = { @@ -1596,6 +1601,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 = { @@ -1606,6 +1612,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 = { @@ -1621,6 +1628,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 = { @@ -1635,6 +1643,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[] = { @@ -1757,12 +1766,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,