From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 0C740411692 for ; Mon, 13 Jul 2026 13:01:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783947705; cv=none; b=TufsC7k7bYbhFP/+Qc7HLAhDLC9noAeQkakkT5F22APXrCF/m6pWg/0q1D7PkD5l28w2eMTuttIoutbE++GONRUeui/OICgg4JJgGK3pNMpLDUMp+pWD6HnGq2/1zd12WMxbs8G50R/CH1QjGwdphrf+N2dTD0riACWCbA/xZZs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783947705; c=relaxed/simple; bh=1Q+aPsoEc8W4PfEahFbzsFEdkzT9tiwxUCi1Nvr+Dts=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fSv6T8jCbZLFFgMraFKwg29GAaqisIpbxOrG1gENkYns7R6VU17LVjEhHCs0Y/DNr1h+aHT6tCjRIulDLRSLVpAHGPBV1v9c5lIcJWzcWaepgmtKZGEgc8Oie6tjdwEo3L9sr840S6Vd3gVmMFp+nCH/cxGCRQ2ldN/3yM4KlHU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=TR2Vbwha; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=aoHJ+quf; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="TR2Vbwha"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="aoHJ+quf" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66DCFJr31506646 for ; Mon, 13 Jul 2026 13:01:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 1SQ6fBG0Ah0G+Ee6NE98a2a6c+tVDqglySr17bUd1/A=; b=TR2VbwhaedtgsCjR Uc6c5F5h++logsbZPYpfV1Fh6PqmawOGcAHQ21iHQezcNdSzQJ/hH4I9NZYrOkqx lBLDY34/a6Mqh6J6TYfYnm5Nen5aVfGZURd12dK593ddK0mfSA0h7bDASCFnmosu wgZnL8grKitKP5SZYSqwqoJq8K1729eyWuqBzxz3jVAFEXnre0TkWWTyR7m0pTWY U5EtcCXUPZXtNmHR2JrUEIvV2wQBvJhkXrdhe5IGPrWD+zqHXj6+Q6M03pA53uqJ 3PHoHBl9zJgx7ynl8BYeN2NrfjpBZ7+Ix7q+5uw/mgvMSLX2Pd0pIcgpdduXTkbB CBTx3Q== Received: from mail-oa1-f70.google.com (mail-oa1-f70.google.com [209.85.160.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fcwda0rsp-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 13 Jul 2026 13:01:42 +0000 (GMT) Received: by mail-oa1-f70.google.com with SMTP id 586e51a60fabf-44aeefa1a30so6620498fac.3 for ; Mon, 13 Jul 2026 06:01:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783947702; x=1784552502; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=1SQ6fBG0Ah0G+Ee6NE98a2a6c+tVDqglySr17bUd1/A=; b=aoHJ+quf2N6U5HiJuHBnsLfwFyfdsvkVa+h4z1FzI4F3uYTjTuOPDEl6rxT9FIP55R 6bJFK03iktdynzUtjpihGn/yt8Pj+PKCaETR9U9VDSTWw71QBxLD/4D0hNip2ode2SM2 cabZrauGB/NUN72VAkTMW8jL5nc98S9bQTs1VJbVuFUrP1DfjkEAv6XEPWaFKAsEe/2u jD9WIgzl3P0HpDjMU2aKB9JSCw6if4+bCEP/rp1zY0PwbpV6MBCxHSTx+euMgWdwlvqd WjHnLUHEZVwiWu90B4ZiUn10xjfroIbDLKzLNjkgaRF2D/gpk/K9bLfYZQbtA218Lggp X1KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783947702; x=1784552502; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=1SQ6fBG0Ah0G+Ee6NE98a2a6c+tVDqglySr17bUd1/A=; b=byzTMcKaWgwkxRgMZxuHyBu9/02p62UzVB5yd1vP13SSQHKAXl/Um0RHVdEMZNW12O pDsNVkyY+7GdJ7vfL1In1dH4k6XGhT37BP3QdA0uYcUwVFrhJkrZUC9QIJvY/AdwTL9z Cq4goKe5zsiHfXJiVaUs32DHrNDM3Th4cU0tj9L45omXWg90BKvngd3DGLtJ1xb7JNvy gbzn9NG9t7Lbi1FVN6sZn/vODUNR0RSQM35b2SJ7QHKc+N1nxO5AwqF+hEwvgbib345/ 10vBnT5BJp+8hY81DvpBBemGzA2ZzJFypLAtyDU5T/hsQEM/AsyuemEar7JRCZ5XdhWl NnSw== X-Forwarded-Encrypted: i=1; AFNElJ9m1t4nFedDAMD7kScMYz/Ejkr9DgDwsmODl+PbSDGLpLj5y7RfL5oyiiNh4E7UYmbKrDZg1Hks+H2cCaM=@vger.kernel.org X-Gm-Message-State: AOJu0Yw97fochJlHTMmxIosdJWuep2A5RN/MoFPtOApe/UQc63Xta2Be /eb4SZMB0ymXB08CghB5s8S5ZPJzqcD2Es2V8tQ0TNkDoO0bpCngQxhRnFjeqPTE3lpg3h8/HhJ kWKwhCXOFyZIf3qGTLRF8cyYOf2VeqvTd9flWTsZ+GBaRxB2noMxqgb1HpuVeKWT9M/Y= X-Gm-Gg: AfdE7cmFfnl+p5rraNgurp+ClEnenIHDiivjEbHfH+m/jA53TaP1TnHViI+TIBqjGrZ RlocKDeXnVDNJogRgcs19H3a5xdO2mAPQrbAHzYd+RK7Vro0ylWPEDkTBfaOTmF4sen7J+p/56y pOVluX+Q3Xrt8MCX0fJa9bfXDJuiwgnsb5cu/oJKC18xgeUzvPFcPbWhuIdiPgnkGqjWRxrb5+n vLkzh34V7Hkh6NNDu2ikkWVzmk4950Jk114UDULMljNP4p0ZhD+aAEj9F+vcPkQSNSIH72vyY9r hsHQplzH3iwUg6Zq8yVoSZzvTb+XIAW+kZ6KfcPaCD8HFOit174u0zNZnGIT9yXJKgUdwg7bJwl X6MZOrTdq6nVHBTc6bzlbvRP0EYIXHjZFlWtWq01J X-Received: by 2002:a05:6820:150f:b0:6a3:74c8:c055 with SMTP id 006d021491bc7-6a39a561d8dmr5636181eaf.11.1783947699739; Mon, 13 Jul 2026 06:01:39 -0700 (PDT) X-Received: by 2002:a05:6820:150f:b0:6a3:74c8:c055 with SMTP id 006d021491bc7-6a39a561d8dmr5636138eaf.11.1783947699138; Mon, 13 Jul 2026 06:01:39 -0700 (PDT) Received: from brgl-qcom.local ([2a01:cb1d:dc:7e00:8881:83b8:89fa:1a2a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493f2d97527sm306129725e9.2.2026.07.13.06.01.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2026 06:01:36 -0700 (PDT) From: Bartosz Golaszewski Date: Mon, 13 Jul 2026 15:01:05 +0200 Subject: [PATCH v21 04/14] dmaengine: qcom: bam_dma: Extend the driver's device match data Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260713-qcom-qce-cmd-descr-v21-4-bc2583e18475@oss.qualcomm.com> References: <20260713-qcom-qce-cmd-descr-v21-0-bc2583e18475@oss.qualcomm.com> In-Reply-To: <20260713-qcom-qce-cmd-descr-v21-0-bc2583e18475@oss.qualcomm.com> To: Vinod Koul , Jonathan Corbet , Thara Gopinath , Herbert Xu , "David S. Miller" , Udit Tiwari , Md Sadre Alam , Dmitry Baryshkov , Manivannan Sadhasivam , Stephan Gerhold , Bjorn Andersson , Peter Ujfalusi , Michal Simek , Frank Li , Andy Gross , Neil Armstrong Cc: dmaengine@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, brgl@kernel.org, Bartosz Golaszewski , Bartosz Golaszewski X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4322; i=bartosz.golaszewski@oss.qualcomm.com; h=from:subject:message-id; bh=HGeQqzQf8+DrUa/4bzOvLohFWS/bDVC1MPHUwVaBFAE=; b=owEBbQKS/ZANAwAKAQWdLsv/NoTDAcsmYgBqVOGZvuGUYeChHOLC77HMfiNMIfVnN8AjQan6W BeS6asnms6JAjMEAAEKAB0WIQSR5RMt5bVGHXuiZfwFnS7L/zaEwwUCalThmQAKCRAFnS7L/zaE wy1iEACsz3YnAAnaz1k8qigqPCxgYXXpAPo28WK2BGkIxJnWSpkVg114GyWtZa9CVovWwDf2FNY 5mPXTCu7d/cHhSoqNb2s+vD7NcQBdho/HyhKnh1tIToo54h1FbJ4ViWRQ+R8mflfyoCsz4yobXI XgbZFKJdPqtW+e0hYpbBF8nPlzP53vpRNpTu6kM4o3fdPUOtwL+sf4NpDz4J6gHcfxIPdStSGDP LF7rY6vs/mxVwPHuxytui86zaLzSz5BxthuE0QUgb9vqkibyJRvqUZpfONM1ZI4FQlN7gZcoaSb 6RMHbvWs1VNxS27/r/4LwU3hHF3RjudDc55Bj2skAEillw4YHRxBHIXhhTy5KsS/wjO1MoBmhx5 ttgqK7vp48MohSGVdH4GESxroODaknQWBMuIfeGmqxY9ymjvlPqdnCSxW/K3I2HmefMPPS8hSMe 1CZIgnVz60PtsyVz55b5kqyE3RIpcDqN6Rn+Rg7jDAiH745nA2r9f8ESiwNJR82qMwwvqiLnjIu /dPR4SMJKOqA2wafaxWf4kJLmYWCoawsh8EXqmQ30Rnkv9NVk/6Bk6snCJ4jVo+YpJPEFCotVH/ Ba80v9XTVKr3TKqVnlD3N/vpR3tp6SRRbPLqjndYlcmwY+P1qCQvBdLJBTR5TiIxFCvS0n6nT3E Y1DpNNcWZr2QC2g== X-Developer-Key: i=bartosz.golaszewski@oss.qualcomm.com; a=openpgp; fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzEzMDEzNSBTYWx0ZWRfX6FzSwZf05hVF VRnWNNm3QaqkUxPM1247sqVHziqZBgPItMQnYfVZgYFAGivtrgFeFn0ZpVtd2EFO9L3sUSlgcph Y5kuDz5EMb7k8SUmYPw+8TiFVFj6w+A= X-Authority-Analysis: v=2.4 cv=cNbQdFeN c=1 sm=1 tr=0 ts=6a54e1b6 cx=c_pps a=nSjmGuzVYOmhOUYzIAhsAg==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=KKAkSRfTAAAA:8 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=ioP1PY9e4_dTeLeN8ycA:9 a=QEXdDO2ut3YA:10 a=1zu1i0D7hVQfj8NKfPKu:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: FxS2A6nAK8UxVLIOOBSA4-Tw_mN_DamT X-Proofpoint-ORIG-GUID: FxS2A6nAK8UxVLIOOBSA4-Tw_mN_DamT X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzEzMDEzNSBTYWx0ZWRfX513mZjNJpYrS QBLXS3byeb3zmSixxyMhKdf/hCuPKAlahQvQqSK8u6qfEK79b4R4iuNMnp6fUJoqKZQHqniJxTS 9GFMOrnb10BD7iMHoHxyNh+0DMuhwSSlYlWvEFdaXHSgCpCkRCoNaN3Nh22xbhTzTs7baCLiBUO hGwGCDetzBkdjN63EGjA6PJQAK44S3RjyFWk0RhX82kjuDWcTyDajWxesv7cXdnEEGC1ucJFYu3 zDla4x4g5Bo5xfvnSG8Z3SF1hvfn44jyEiUr9uEYk8aqPX5drOHdNhKv3WpbSahNYuSiHovLjOo t4lOiQlUIjkukieljBZT1Z24XuabNk7/jf8UrcYPidkFm0EupgTxjbdwtFwCswNnD6zMK5Y4H1N aRWHS3k7aK1evQsAwJnUWNLMim9xaSO1h7cu0HuEVxTC/1nP4EjfoR37QwAhgesemVuOGzRQGnH Dl5oGB4p54LF6qMDJLw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-13_03,2026-07-10_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 spamscore=0 suspectscore=0 impostorscore=0 phishscore=0 clxscore=1015 adultscore=0 malwarescore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607130135 From: Bartosz Golaszewski In preparation for supporting the pipe locking feature flag, extend the amount of information we can carry in device match data: create a separate structure and make the register information one of its fields. This way, in subsequent patches, it will be just a matter of adding a new field to the device data. Reviewed-by: Dmitry Baryshkov Signed-off-by: Bartosz Golaszewski Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bartosz Golaszewski --- drivers/dma/qcom/bam_dma.c | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c index ea3df28e777f99c0532761b6aee6807ab23ab4ca..8ce0fe085c5fea6cc614edd692b5cfd264b94d5a 100644 --- a/drivers/dma/qcom/bam_dma.c +++ b/drivers/dma/qcom/bam_dma.c @@ -113,6 +113,10 @@ struct reg_offset_data { unsigned int pipe_mult, evnt_mult, ee_mult; }; +struct bam_device_data { + const struct reg_offset_data *reg_info; +}; + static const struct reg_offset_data bam_v1_3_reg_info[] = { [BAM_CTRL] = { 0x0F80, 0x00, 0x00, 0x00 }, [BAM_REVISION] = { 0x0F84, 0x00, 0x00, 0x00 }, @@ -142,6 +146,10 @@ static const struct reg_offset_data bam_v1_3_reg_info[] = { [BAM_P_FIFO_SIZES] = { 0x1020, 0x00, 0x40, 0x00 }, }; +static const struct bam_device_data bam_v1_3_data = { + .reg_info = bam_v1_3_reg_info, +}; + static const struct reg_offset_data bam_v1_4_reg_info[] = { [BAM_CTRL] = { 0x0000, 0x00, 0x00, 0x00 }, [BAM_REVISION] = { 0x0004, 0x00, 0x00, 0x00 }, @@ -171,6 +179,10 @@ static const struct reg_offset_data bam_v1_4_reg_info[] = { [BAM_P_FIFO_SIZES] = { 0x1820, 0x00, 0x1000, 0x00 }, }; +static const struct bam_device_data bam_v1_4_data = { + .reg_info = bam_v1_4_reg_info, +}; + static const struct reg_offset_data bam_v1_7_reg_info[] = { [BAM_CTRL] = { 0x00000, 0x00, 0x00, 0x00 }, [BAM_REVISION] = { 0x01000, 0x00, 0x00, 0x00 }, @@ -200,6 +212,10 @@ static const struct reg_offset_data bam_v1_7_reg_info[] = { [BAM_P_FIFO_SIZES] = { 0x13820, 0x00, 0x1000, 0x00 }, }; +static const struct bam_device_data bam_v1_7_data = { + .reg_info = bam_v1_7_reg_info, +}; + static const struct reg_offset_data bam_v2_0_reg_info[] = { [BAM_CTRL] = { 0x0000, 0x00, 0x00, 0x00 }, [BAM_REVISION] = { 0x1000, 0x00, 0x00, 0x00 }, @@ -229,6 +245,10 @@ static const struct reg_offset_data bam_v2_0_reg_info[] = { [BAM_P_FIFO_SIZES] = { 0xC820, 0x00, 0x1000, 0x00 }, }; +static const struct bam_device_data bam_v2_0_data = { + .reg_info = bam_v2_0_reg_info, +}; + /* BAM CTRL */ #define BAM_SW_RST BIT(0) #define BAM_EN BIT(1) @@ -422,7 +442,7 @@ struct bam_device { bool powered_remotely; u32 active_channels; - const struct reg_offset_data *layout; + const struct bam_device_data *dev_data; struct clk *bamclk; int irq; @@ -440,7 +460,7 @@ struct bam_device { static inline void __iomem *bam_addr(struct bam_device *bdev, u32 pipe, enum bam_reg reg) { - const struct reg_offset_data r = bdev->layout[reg]; + const struct reg_offset_data r = bdev->dev_data->reg_info[reg]; return bdev->regs + r.base_offset + r.pipe_mult * pipe + @@ -1234,10 +1254,10 @@ static void bam_channel_init(struct bam_device *bdev, struct bam_chan *bchan, } static const struct of_device_id bam_of_match[] = { - { .compatible = "qcom,bam-v1.3.0", .data = &bam_v1_3_reg_info }, - { .compatible = "qcom,bam-v1.4.0", .data = &bam_v1_4_reg_info }, - { .compatible = "qcom,bam-v1.7.0", .data = &bam_v1_7_reg_info }, - { .compatible = "qcom,bam-v2.0.0", .data = &bam_v2_0_reg_info }, + { .compatible = "qcom,bam-v1.3.0", .data = &bam_v1_3_data }, + { .compatible = "qcom,bam-v1.4.0", .data = &bam_v1_4_data }, + { .compatible = "qcom,bam-v1.7.0", .data = &bam_v1_7_data }, + { .compatible = "qcom,bam-v2.0.0", .data = &bam_v2_0_data }, {} }; @@ -1261,7 +1281,7 @@ static int bam_dma_probe(struct platform_device *pdev) return -ENODEV; } - bdev->layout = match->data; + bdev->dev_data = match->data; bdev->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(bdev->regs)) -- 2.47.3