From nobody Mon Dec 1 22:05:02 2025 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 9DD462798F3 for ; Mon, 1 Dec 2025 06:26:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764570382; cv=none; b=HqpaXUxytwxamXBeDkRgyo+/RjmvdyboVK0UCv51NbdH9ImwLzroLj29aurQCnVtn3vj8VyeEr22HxWi+3QKL/x75NB9SBjHO2uqrVBxdgzRvas3iDH/tLzXWP4XxfI7LHKWLGpjZ+W8/JmPVQvoQgG6gMdhEOto3YJ/MZMRdVw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764570382; c=relaxed/simple; bh=xwACydKQvgDKuB0v3VRVNVKaf/7fL95Co83H8L4/8V8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=ghbXmQtne63fX0lv0Vax2EjkyoPGCXWJ+b4epYSfUtoD+WHJjW1ydHpAwjPYVGm2kMya2VRhGLjmnadYt5aOgXe90PQPcTEdPrdflA6IgofdMBivctupy64bXaXPPsm15VjcUEVh3eW6RNDrRkRNBBHGf4XF0W2AElqVAQAmAHI= 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=ZrPKBz1Z; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ZK9QTbOJ; arc=none smtp.client-ip=205.220.168.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="ZrPKBz1Z"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ZK9QTbOJ" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5AULt2Qx1924265 for ; Mon, 1 Dec 2025 06:26:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=Tbyvd4eRGssa6Ha0ecVbsY tSBYVsX1t2xVyxXt94ET0=; b=ZrPKBz1ZqFfUvfy8wsD9OepT0ejCr49l8CJIDB RI037dW52yyhZoF9ddXxh2wvgdU32v/ubnmfN65lPV21f9MhatZFpZRLeSI6gGnj K3+wY1z4Mje8b7ejbBc5lciO4qJAKBMc7PP9if3JBiN5FR9956iYr+V4R8xausS7 Bynbq5o+OKiStwLplwydWGMUEGAnARqr7iFDlgSV7dlawMuP3vxQnSOmgRUwV5+r cUmxqsdeF1fK1jiKT01PInpCzJwr7JexXsdPg195/wjVF6E4FW6nH3y2LuMpyBtt gUX4ebdQg5oUmxMoV+U52HM07mFibAAUx7MC0EsD85pCl1gg== Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4aqt0j3jd8-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 01 Dec 2025 06:26:19 +0000 (GMT) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-b5edecdf94eso5287447a12.2 for ; Sun, 30 Nov 2025 22:26:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1764570379; x=1765175179; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=Tbyvd4eRGssa6Ha0ecVbsYtSBYVsX1t2xVyxXt94ET0=; b=ZK9QTbOJtrNzjh4EqDX+jTrFO1LjwsfcRek5/Mzc+ZSLhXQIHnW/3NAxqKnc9oIm7D twwQmzQkqXGuXZ2rti1qXMzsJu9VWn+OdsWfujlM5p6O9X/x4sssdGjb0DZOLPvvXyeX vurm15OOdUGLTVLmhZ1/2kXNVC5nHKpIjtQ73nLusBTTUHoTcbt0+DEhr/yQ+lzpAyyN N5+7l4qQO1KSa4p+JJtaHHHzrTTPb+73X6Pu+K6ro55248CAf+80DngjxjZTzg6NznOx 0SwKf4JxrWv1DVqnMU5nQvnQTUNaUEj9K/NgFGCudOkkCDl1qCoTKLTTK/3JUfF8Q1Ih +j3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764570379; x=1765175179; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Tbyvd4eRGssa6Ha0ecVbsYtSBYVsX1t2xVyxXt94ET0=; b=BUybUtck9ZddA1Ie8SkwL+At3GbBXhQcLhpTJLqDdN2owN1lQ1hBaoNKZMbWFKS41P jfjVmZ3+NiWAVwDt7RbA6SCbBTCVT8biANInWS13+c/RiQhLLv14g+e+OlDfsq+i3WML kryHxBFqiCZzHV2XIIKKPnJ2YZ17CjqVgAj9k2zPCz4kntL4LAK3e1DZ0IWauFRiKjeF dv1i9hwbE/VkVQv0I3/y/r+fVcfhc5LqpS4l1mgxwaXMnvoeM/MfUWgoNG6dD1xULKJS lMaw0q5LC+f9kikAaRy8nlkm4K21Zo2NuaNeaSHE/jH8iwbPPqrhmBGKKRGPugqQG6MC 4nTQ== X-Forwarded-Encrypted: i=1; AJvYcCXtyD8JxUTPzU+azXTGzo2UI4Vvi0LrX4jLxKLau+ZefxI1BVe9c9rdN+VjOD9LSTEL+MLDSFPTcoEI7oE=@vger.kernel.org X-Gm-Message-State: AOJu0YwMCC6kC9gIu23Osj2WEaiGmDFoIO6cZjFxx8IFQ/0pvcFir+f/ tc+y+Kzpn1pdW+gnMNz0JF6csSSdpmGsMHoFWTG+F8RxVzyLR1GHUJFanVuW25V0OWzoxoXBAeb 0rlu2jZCGKd+gZ2sCRuuhmZjrPAWIurLoL3rlT6qZXgCPOo1Gp3PhTuXG30qRvD5xvuA= X-Gm-Gg: ASbGnctTBBJKGtQ6cgTQrpPtjThRl1Fnzd3y8pVTcFc7PP1z0Wr2V9cCQF4MBpKrb0C cVcdLIrOqBAwullYpIzDHDYSW4kd5IEhkbpEDs3AOImEBwtwp/UR9Ec2H6YMstdbdkaJU4t7wRs f+NWU1m+UTfq9hp9MB78glqG8umZ9Vqv5wZHCuPf2MDFuvu4sHMQEWLF67tJckoelg5fyXhILxU 4jk7aK54npeWJjmnMGTMN7ESX+VzWlVPMSg3sYvb/9OUGz1aAAtpqp3Hdg+zCvi24hI9KmNSDnX uBVL20adMn812AL3vrq1MIzr/xWOgsBYtN75sgtB9UP5PEE7Rhwo8eP82k8I+PiAL5xOe0sfLXH rOQng+2NaYwHx3jo4DvGEQ002db2//NKP7Wkidu+mI/QQiismk05tOp6Wm6C+MEPu X-Received: by 2002:a05:7022:4581:b0:11b:8185:abff with SMTP id a92af1059eb24-11c9d84a4e4mr21503840c88.30.1764570378993; Sun, 30 Nov 2025 22:26:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGiUkQhPHRaozyfqb9PynFx9lYVvOC8kg1YIBrk3c4ptAh69WLgR70tMbUh+zHTWI84tQ9HQ== X-Received: by 2002:a05:7022:4581:b0:11b:8185:abff with SMTP id a92af1059eb24-11c9d84a4e4mr21503815c88.30.1764570378459; Sun, 30 Nov 2025 22:26:18 -0800 (PST) Received: from hu-hangxian-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-11dcb057cb0sm67109081c88.9.2025.11.30.22.26.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Nov 2025 22:26:18 -0800 (PST) From: Hangxiang Ma Date: Sun, 30 Nov 2025 22:25:36 -0800 Subject: [PATCH RESEND] media: camss: csiphy: Make CSIPHY status macro cross-platform 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: quoted-printable Message-Id: <20251130-make-csiphy-status-macro-cross-platform-v1-1-334664c6cf70@oss.qualcomm.com> To: Loic Poulain , Robert Foss , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Todor Tomov , Vladimir Zapolskiy , Mauro Carvalho Chehab , Bryan O'Donoghue Cc: linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Hangxiang Ma X-Mailer: b4 0.14.3 X-Proofpoint-GUID: scjokJi4Fauppmphhlhc_pRO9QZLx_EP X-Authority-Analysis: v=2.4 cv=WpYm8Nfv c=1 sm=1 tr=0 ts=692d350b cx=c_pps a=Oh5Dbbf/trHjhBongsHeRQ==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=edmtyYkapI0WV9tsjtgA:9 a=QEXdDO2ut3YA:10 a=_Vgx9l1VpLgwpw_dHYaR:22 X-Proofpoint-ORIG-GUID: scjokJi4Fauppmphhlhc_pRO9QZLx_EP X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjAxMDA1MCBTYWx0ZWRfXyhfA6FVcuxZS VZT1HdkrWSc8jBWNCPSEMML+QyuLQKh34+6mLl7hqwoagv7lsiVPzwHC0HRxCg4LyURhhPAkXuI lfWTkB2Qy2PDVqzbyvhELdfq7CVOVT01bRkf60rGTpvlfZG5t1i68KcOUj4icsw9rKCKP7RBOP3 PqGxzRCwRTGRI9mMuHgO9+A2OeSgvLlaxt5gv+fUCbJ7j1Fn4wHk2MDA/WDRfhd8urT1Jz33POt iKuEVp0qgr0lFV/i/D5FcOTqdw88rghpKdPjXWggdzvhctR0CUVAu8fgYVbmE+HMbtzI+W4Mg34 we8Zufi7tbp7VaovB1+C5uxllUkogBDCMo54sn8Z5izQ2OA5GNo52gWNRymgCIDHmfTvOuxwWWk EcndMRc79kd1q/rvjczdLqTpLT8OTg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-28_08,2025-11-27_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 phishscore=0 malwarescore=0 bulkscore=0 spamscore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2512010050 The current value of '0xb0' that represents the offset to the status registers within the common registers of the CSIPHY has been changed on the newer SOCs and it requires generalizing the macro using a new variable 'common_status_offset'. This variable is initialized in the csiphy_init() function. Signed-off-by: Hangxiang Ma --- This change introduces common_status_offset to replace the hardcoded offset in CSIPHY_3PH_CMN_CSI_COMMON_STATUSn. --- .../media/platform/qcom/camss/camss-csiphy-3ph-1-0.c | 19 +++++++++++++--= ---- drivers/media/platform/qcom/camss/camss-csiphy.h | 1 + 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/dri= vers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c index a229ba04b158..9b6a0535cdf8 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c +++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c @@ -46,7 +46,8 @@ #define CSIPHY_3PH_CMN_CSI_COMMON_CTRL5_CLK_ENABLE BIT(7) #define CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_COMMON_PWRDN_B BIT(0) #define CSIPHY_3PH_CMN_CSI_COMMON_CTRL6_SHOW_REV_ID BIT(1) -#define CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(offset, n) ((offset) + 0xb0 + 0x= 4 * (n)) +#define CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(offset, common_status_offset, n)= \ + ((offset) + (common_status_offset) + 0x4 * (n)) =20 #define CSIPHY_DEFAULT_PARAMS 0 #define CSIPHY_LANE_ENABLE 1 @@ -714,13 +715,17 @@ static void csiphy_hw_version_read(struct csiphy_devi= ce *csiphy, CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->offset, 6)); =20 hw_version =3D readl_relaxed(csiphy->base + - CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, 12)); + CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, + regs->common_status_offset, 12)); hw_version |=3D readl_relaxed(csiphy->base + - CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, 13)) << 8; + CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, + regs->common_status_offset, 13)) << 8; hw_version |=3D readl_relaxed(csiphy->base + - CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, 14)) << 16; + CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, + regs->common_status_offset, 14)) << 16; hw_version |=3D readl_relaxed(csiphy->base + - CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, 15)) << 24; + CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, + regs->common_status_offset, 15)) << 24; =20 dev_dbg(dev, "CSIPHY 3PH HW Version =3D 0x%08x\n", hw_version); } @@ -749,7 +754,8 @@ static irqreturn_t csiphy_isr(int irq, void *dev) for (i =3D 0; i < 11; i++) { int c =3D i + 22; u8 val =3D readl_relaxed(csiphy->base + - CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, i)); + CSIPHY_3PH_CMN_CSI_COMMON_STATUSn(regs->offset, + regs->common_status_offset, i)); =20 writel_relaxed(val, csiphy->base + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->offset, c)); @@ -989,6 +995,7 @@ static int csiphy_init(struct csiphy_device *csiphy) =20 csiphy->regs =3D regs; regs->offset =3D 0x800; + regs->common_status_offset =3D 0xb0; =20 switch (csiphy->camss->res->version) { case CAMSS_845: diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.h b/drivers/med= ia/platform/qcom/camss/camss-csiphy.h index 895f80003c44..2d5054819df7 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy.h +++ b/drivers/media/platform/qcom/camss/camss-csiphy.h @@ -90,6 +90,7 @@ struct csiphy_device_regs { const struct csiphy_lane_regs *lane_regs; int lane_array_size; u32 offset; + u32 common_status_offset; }; =20 struct csiphy_device { --- base-commit: 076fb8624c282c10aa8add9a4ae2d9354d2594cb change-id: 20251021-make-csiphy-status-macro-cross-platform-5390dc128aee Best regards, --=20 Hangxiang Ma