[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <689db2b8-6845-4ac8-a012-e589dc11e45d@oss.qualcomm.com>
Date: Wed, 17 Dec 2025 14:31:18 +0100
From: Konrad Dybcio <konrad.dybcio@....qualcomm.com>
To: David Heidelberg <david@...t.cz>, Robert Foss <rfoss@...nel.org>,
Todor Tomov <todor.too@...il.com>,
Bryan O'Donoghue <bryan.odonoghue@...aro.org>,
Vladimir Zapolskiy <vladimir.zapolskiy@...aro.org>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Luca Weiss <luca.weiss@...rphone.com>,
Petr Hodina <phodina@...tonmail.com>,
Casey Connolly <casey.connolly@...aro.org>,
"Dr. Git" <drgitx@...il.com>
Cc: Joel Selvaraj <foss@...lselvaraj.com>,
Kieran Bingham <kbingham@...nel.org>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
linux-media@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org, phone-devel@...r.kernel.org
Subject: Re: [PATCH WIP v2 3/8] media: qcom: camss: Prepare CSID for C-PHY
support
On 12/11/25 4:20 PM, David Heidelberg wrote:
> On 05/12/2025 10:43, Konrad Dybcio wrote:
>> On 12/4/25 5:32 PM, David Heidelberg via B4 Relay wrote:
>>> From: David Heidelberg <david@...t.cz>
>>>
>>> Inherit C-PHY information from CSIPHY, so we can configure CSID
>>> properly.
>>>
>>> CSI2_RX_CFG0_PHY_TYPE_SEL must be set to 1, when C-PHY mode is used.
>>>
>>> Signed-off-by: David Heidelberg <david@...t.cz>
>>> ---
>>> drivers/media/platform/qcom/camss/camss-csid-gen2.c | 1 +
>>> drivers/media/platform/qcom/camss/camss-csid.c | 1 +
>>> drivers/media/platform/qcom/camss/camss-csid.h | 1 +
>>> 3 files changed, 3 insertions(+)
>>>
>>> diff --git a/drivers/media/platform/qcom/camss/camss-csid-gen2.c b/drivers/media/platform/qcom/camss/camss-csid-gen2.c
>>> index 2a1746dcc1c5b..033036ae28a4f 100644
>>> --- a/drivers/media/platform/qcom/camss/camss-csid-gen2.c
>>> +++ b/drivers/media/platform/qcom/camss/camss-csid-gen2.c
>>> @@ -183,6 +183,7 @@ static void __csid_configure_rx(struct csid_device *csid,
>>> val = (lane_cnt - 1) << CSI2_RX_CFG0_NUM_ACTIVE_LANES;
>>> val |= phy->lane_assign << CSI2_RX_CFG0_DL0_INPUT_SEL;
>>> val |= phy->csiphy_id << CSI2_RX_CFG0_PHY_NUM_SEL;
>>> + val |= csid->phy.cphy << CSI2_RX_CFG0_PHY_TYPE_SEL;
>>
>> This field is 1-wide, this would be neater:
>>
>> if (csid->phy.cphy)
>> val |= BIT(CSI2_RX_CFG0_PHY_TYPE_SEL);
>
> Hello Konrad,
>
> while your change make sense as we work with 1-bit.
> On other hand, due to TYPE_SEL naming, it's not very explicit why we set this bit when cphy is on.
This is the actual name of the register field
>
> Maybe I could propose renaming CSI2_RX_CFG0_PHY_TYPE_SEL to CSI2_RX_CFG0_PHY_TYPE_SEL_CPHY, then setting 1 to it would make sense.
>
> Most clean solution to me would be something like
>
> #define TYPE_SEL_DPHY 0
> #define TYPE_SEL_CPHY 1
>
> val |= (csid->phy.cphy ? TYPE_SEL_CPHY : TYPE_SEL_DPHY) << CSI2_RX_CFG0_PHY_TYPE_SEL
>
> Do I overthinking this? What do you think?
Perhaps just:
/* Set the PHY_TYPE_SEL bit to enable C-PHY mode */
if (csid->phy.cphy)
val |= BIT(CSI2_RX_CFG0_PHY_TYPE_SEL);
?
Konrad
Powered by blists - more mailing lists