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 A23DD3BD657 for ; Mon, 20 Jul 2026 19:38:55 +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=1784576337; cv=none; b=TYffSUtHMTRI53jgphzV6uR9w/8LyHguJy8YcCm/SWE3WRsg0V2JNTKCiPNgaU4V3/2LOtdAI8FNuDj2Ccz6tIE0MbD+XA7nOnI5yTIdwaPIUmxXIpyzz2Hr65e1vHu/nCrjb60WfnyTMWtj6haVy8cWpqtQwOqiplsntGHmE1s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784576337; c=relaxed/simple; bh=AyKXTAo0L3AgEd8yRnire3MPxDQQci+jMIbCW78lIY4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=aMvZnfyZ2SBtrVhIRo4ZAkkBEMXbs88iM7lEolKZTHk8VFcOe8b0xijDHDSem0WGCZhGP5/dTX6OuckOGKmZl97boyVgTvKgBJTuaG1oKy56BzAic8b70Pzavqgced6F3bIW/Z3czUVbUc5AOwcvSWYMzCZz0lNQ8UwEQPO1Y9Y= 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=FiMz28AI; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ZcyMHB0q; 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="FiMz28AI"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ZcyMHB0q" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66KJTgFB3599108 for ; Mon, 20 Jul 2026 19:38:54 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= 31YNPLE5T4n7XF3/XKNPrjdGEt2VxwkaGrFa9vry+ck=; b=FiMz28AIuKDgVM+9 TndKWGlWR+08hVeo2x/auHIohr497PdJApghmw8my+KAtiBW+5wJ5RmIR+UIKYXn HA4e1cyCNgMRVsVG6ELunkp+HPe+t6F7s4nR9IefEW5sTAtTmhp5xBB79rJr1U0a wOvqI8ZD+9Ley8GGYitOCR1CX2gXQSzNoHOhf7cvmAcRNsA1AVRzpK9znqCPVVAe IugRYVY/b+4Y3tHdF8l1vN3Iny2CRpqzkMmEimrO4TvAOx0FUgoZ3lKwzSBSWzcH RtrsJVAR4WnU8LZRIqwfLVw5UbwkwF+39l/uz3hjnrr+wbQI8zFddAM4eTEp0i01 B8yyNg== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fhgreav70-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 20 Jul 2026 19:38:54 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2cc6dd43737so197673605ad.2 for ; Mon, 20 Jul 2026 12:38:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784576334; x=1785181134; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=31YNPLE5T4n7XF3/XKNPrjdGEt2VxwkaGrFa9vry+ck=; b=ZcyMHB0q7wg7N5ln5M4k6B9tyCUBH8RuzbM73OFTsgATcUdGHdjc28qEsG3YXLUx3+ +ZHQ8CiFWz5OEMevyjrAMs/mpcxdzaO93EKyJQkDxWRa/li9kwnWae3HZiC+QfaUY/9P z/MozCQEuLPs7hdfaAB0P1wl+cfV7VUjk1nctx1EG9X7S1zuMhEyvmlsZNX1RvAI6zPK 1MfDwHAy2b8qbnZJs/HQ6eXiN+WvBBUYSnVfYgBIzmo2ncfqhyPz9Y0HF2vQoVSYlcCM 7oC7eG/TG9GaX6oebNOsR/DzHcTarb1/IfgscmQsE0DR7f216v+qQqJLpXpA5aR7gJkK CcPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784576334; x=1785181134; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=31YNPLE5T4n7XF3/XKNPrjdGEt2VxwkaGrFa9vry+ck=; b=ZsudD0fDhkodlDJyXqtJINyGj1MxePQKD5FxXP5IF64pDz6bSf/MtV2LZjfACZrADW dAIc3/GJxUMXIvYKMSSnxo+i5m/JiAfv7APuNg0rndhWJunxbvb7o5lBBGvCWGfUOdXr NsKtZrJOj1NtaBGP6n+NCgMBHsFbcvWr0K6ZsRlbQg3oLzxmoIMPpElGQJ/aV/W5FqcV lBS8X5sKCOZqTbN/fujzl3HBoUmmQ9aZ0HK9Df5svMjC9qosoaQvFpn0oRABcEl/YxaS JJ7XOBnyb5cQIZBXnc+qokQ52BKl2q+PeSCG9It540gnKvFRq04uqV1kjCx9cvLN4GU+ jQeA== X-Forwarded-Encrypted: i=1; AHgh+RqyvC3wxGdPiIZNS2HFu/8GRstVqmIh4fQMhvTw+T3NYn1dfxEK5nKJahuwg3MbbAEDcxqeUJMx8hhO0eI=@vger.kernel.org X-Gm-Message-State: AOJu0YyiR40uGyrtQoeERamfAN3c4OrLlZKnWFCYKhuvCDtYGzmFxzxT b6soGZSuZbJzskKSqCyc8jjLrIIEzrwevitJ8+/QeJLsMmu7hxZHupe0ABJUEYGBZYTxaBKbUKB xOQPcXHBQTIaK8jnls89cQS6+X+8Lx9xBdgqd3I/nczYFVzJCaxW2CrekT7sOr269hDU= X-Gm-Gg: AfdE7ck3DGJ050yEqn6Vng0bDbNqyc/AshRjrZaJ/2vbwnDr58X01tJuqUdk1wlPd4j nxypQge7bXtRBwpa7AJ9SwEBU9x9rfCt2SUIeseb8tGgyPuKRTVPutV06+C2H8F0R3E9aa/x/P6 VlTFPqSyjqY8FvFO3F7GllxY4+uRrCnEnLH3DA0z0f8bkpjedmRbZAwmEBXyDmx1h5Ve8hZpmE9 Ge+SXgWRRwH0fPacwr5BREH1z3fOMz1TmomPCv/IwYtGZ1xAJA4c5KCY5R7xBiqPLnBsHu0taeG Hbli3lVqmOhNZHc7sYZW4a+ssAdnvv1TaEXwjWmMIHw0ML3SqaUplIPKjw9PRnFD3BW+SQWYqPH SKbfN8UjLqx0lPRWfQCRuye8dRk4XNfS+wjAL7lOj8x4qxPB/MA8EytGFPQ== X-Received: by 2002:a05:6a21:114c:b0:3c3:9ed1:2549 with SMTP id adf61e73a8af0-3c3ad95f80fmr16033143637.41.1784576333577; Mon, 20 Jul 2026 12:38:53 -0700 (PDT) X-Received: by 2002:a05:6a21:114c:b0:3c3:9ed1:2549 with SMTP id adf61e73a8af0-3c3ad95f80fmr16033117637.41.1784576333103; Mon, 20 Jul 2026 12:38:53 -0700 (PDT) Received: from [10.71.181.181] (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3142a1bb8a4sm42357412eec.14.2026.07.20.12.38.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Jul 2026 12:38:52 -0700 (PDT) Message-ID: <530a9493-24c7-4812-8ada-591c7b63b651@oss.qualcomm.com> Date: Mon, 20 Jul 2026 12:38:51 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/6] media: qcom: camss: Program CSIPHY common control registers To: Loic Poulain Cc: linux-media@vger.kernel.org, bryan.odonoghue@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, jigarkumar.zala@oss.qualcomm.com, gjorgji.rosikopulos@oss.qualcomm.com, hariramp@quicinc.com References: <20260717231331.1229693-1-anusha.nandi@oss.qualcomm.com> <20260717231331.1229693-2-anusha.nandi@oss.qualcomm.com> Content-Language: en-US From: Anusha Arun Nandi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIwMDIxNCBTYWx0ZWRfX5Q1rS6MT0Jdz GfOc/SyOI0kS4LxHEcP4+ect/uTNXxSr04ACw7zkXh2Gv7TU7ZDVi+clLOJJzGNM85HKtXI0aY4 QmnAsDY8Wgks9RG8Yuap21QXGCtBzYk= X-Proofpoint-GUID: 6SwdqmAEWNOqUHzwGV2PhxDTzOczZ-gK X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIwMDIxNCBTYWx0ZWRfX59Xg5erIeHTs FUMC8JspXOmSnmnxLqIP2kIxZLOLanmOGNZWoEwg0jVCLohPnMjCkK61kRTD8rAkyYIQDKobus9 Z9HiN7ffo4N3kMOnWt6MVrn/25PZ19hmwxwqVMo4MQ1iJBj0X/JuBWddjIg9Q8d3T7k94K9w0P8 lmcPAEkgBlANHKVX72zaM5WW/dydXK8T5zdsKGi1M6X7Tuh969YMQva8nFy4SgHoEhHXxeRXV0T K589z92UWDWS7/bnC9nS4Ws4r1zn1To3JHHSEsAZZtOAVNGQQtWUt+bI1al9hsDeWrlyKvt4f+v kRl16znYzaBc72IE/K/DW5x2svos/+6NCSVaTO1CfjgaELbbPGwDWytZICPybvHPeyEXUd8h4SU gZIjBCwQvwIKSZEjy4hF0t2l0jMvSTusgnjpPOjjoNNXzeWuem/L2E6jOXuRM/HghLQiR27QPcc w9LgUrg0w8L9rfdnjOA== X-Proofpoint-ORIG-GUID: 6SwdqmAEWNOqUHzwGV2PhxDTzOczZ-gK X-Authority-Analysis: v=2.4 cv=foLsol4f c=1 sm=1 tr=0 ts=6a5e794e cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=iNitffFvSWnhGXsHWHEA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 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-20_05,2026-07-20_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 suspectscore=0 priorityscore=1501 spamscore=0 clxscore=1015 lowpriorityscore=0 bulkscore=0 malwarescore=0 adultscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607200214 On 7/20/2026 12:56 AM, Loic Poulain wrote: > On Sat, Jul 18, 2026 at 1:13 AM Anusha Arun Nandi > wrote: >> >> From: Jigarkumar Zala >> >> Program the CSIPHY common-control registers during lane enable so >> SA8775P uses the required 3-phase 1.5 Gsps reset-release values for >> both C-PHY and D-PHY. Keep the existing reset-release value for the >> other CAMSS variants. >> >> Co-developed-by: Anusha Arun Nandi >> Signed-off-by: Anusha Arun Nandi >> Signed-off-by: Jigarkumar Zala >> --- >> .../qcom/camss/camss-csiphy-3ph-1-0.c | 36 ++++++++++++++++--- >> 1 file changed, 31 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c >> index 25a3554ef201..11b7a236e607 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 >> @@ -1031,8 +1031,6 @@ static void csiphy_reset(struct csiphy_device *csiphy) >> writel_relaxed(0x1, csiphy->base + >> CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->offset, 0)); >> usleep_range(5000, 8000); >> - writel_relaxed(0x0, csiphy->base + >> - CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->offset, 0)); >> } >> >> static irqreturn_t csiphy_isr(int irq, void *dev) >> @@ -1343,9 +1341,37 @@ static void csiphy_lanes_enable(struct csiphy_device *csiphy, >> writel_relaxed(val, csiphy->base + >> CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->offset, 6)); >> >> - val = 0x02; >> - writel_relaxed(val, csiphy->base + >> - CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->offset, 7)); >> + switch (csiphy->camss->res->version) { >> + case CAMSS_8300: >> + case CAMSS_8775P: >> + if (c->phy_cfg == V4L2_MBUS_CSI2_CPHY) { >> + val = 0x5A; >> + writel_relaxed(val, csiphy->base + >> + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->offset, 7)); >> + val = 0xE; >> + writel_relaxed(val, csiphy->base + >> + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->offset, 0)); >> + } else { >> + val = 0x02; >> + writel_relaxed(val, csiphy->base + >> + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->offset, 7)); >> + writel_relaxed(val, csiphy->base + >> + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->offset, 0)); >> + } >> + break; >> + case CAMSS_7280: >> + case CAMSS_8250: >> + case CAMSS_8280XP: >> + case CAMSS_845: >> + default: >> + val = 0x02; >> + writel_relaxed(val, csiphy->base + >> + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->offset, 7)); >> + val = 0x0; >> + writel_relaxed(val, csiphy->base + >> + CSIPHY_3PH_CMN_CSI_COMMON_CTRLn(regs->offset, 0)); >> + break; >> + } > > I don't really like this big camss-version switch case with magic, > which also introduces more magic values. Maybe we should have a > different version of csiphy_lanes_enable, based on the phy compatible > or revision. > Thank you for the feedback! We agree with your suggestion and will refactor this to use a version-specific implementation of csiphy_lanes_enable, based on the PHY compatible or revision, in the upcoming patchset.>> >> val = 0x00; >> writel_relaxed(val, csiphy->base + >> -- >> 2.34.1 >> >>