Hi,
On 19/02/2025 16:46, Niklas Söderlund wrote:
> On 2025-02-19 16:36:27 +0200, Tomi Valkeinen wrote:
>> Hi,
>>
>> On 19/02/2025 16:24, Niklas Söderlund wrote:
>>> Hi Tomi,
>>>
>>> On 2025-02-19 15:49:01 +0200, Tomi Valkeinen wrote:
>>>> Fix typo with variable name 'msps'.
>>>
>>> FWIW, this is not a typo, C-PHY uses symbols per seconds, not bits per
>>> second.
>>
>> Hmm, but the code calls rcsi2_calc_mbps() and uses the returned value as
>> msps. How can that be right, if it's symbols?
>
> I don't recall all the details off hand, but IIRC it's just a naming
> thing in the specification. I'm fine with using either, just wanted to
> point out it was not a typo but intentional name.
Ok. I don't mind either way that much, it was just very confusing. I'm
not familiar with C-PHY, but I thought usually "symbol" is something
else than a single bit. As msps is used in some other places in the
file, adding a comment to the place where we switch from mbps to msps
should be enough.
Tomi
>
>>
>> Tomi
>>
>>>>
>>>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
>>>> ---
>>>> drivers/media/platform/renesas/rcar-csi2.c | 10 +++++-----
>>>> 1 file changed, 5 insertions(+), 5 deletions(-)
>>>>
>>>> diff --git a/drivers/media/platform/renesas/rcar-csi2.c b/drivers/media/platform/renesas/rcar-csi2.c
>>>> index 845fb3e155f1..92697ea3df01 100644
>>>> --- a/drivers/media/platform/renesas/rcar-csi2.c
>>>> +++ b/drivers/media/platform/renesas/rcar-csi2.c
>>>> @@ -1301,7 +1301,7 @@ static int rcsi2_start_receiver_v4h(struct rcar_csi2 *priv,
>>>> const struct rcar_csi2_format *format;
>>>> const struct v4l2_mbus_framefmt *fmt;
>>>> unsigned int lanes;
>>>> - int msps;
>>>> + int mbps;
>>>> int ret;
>>>> /* Use the format on the sink pad to compute the receiver config. */
>>>> @@ -1314,9 +1314,9 @@ static int rcsi2_start_receiver_v4h(struct rcar_csi2 *priv,
>>>> if (ret)
>>>> return ret;
>>>> - msps = rcsi2_calc_mbps(priv, format->bpp, lanes);
>>>> - if (msps < 0)
>>>> - return msps;
>>>> + mbps = rcsi2_calc_mbps(priv, format->bpp, lanes);
>>>> + if (mbps < 0)
>>>> + return mbps;
>>>> /* Reset LINK and PHY*/
>>>> rcsi2_write(priv, V4H_CSI2_RESETN_REG, 0);
>>>> @@ -1352,7 +1352,7 @@ static int rcsi2_start_receiver_v4h(struct rcar_csi2 *priv,
>>>> rcsi2_write16(priv, V4H_PPI_RW_COMMON_CFG_REG, 0x0003);
>>>> /* C-PHY settings */
>>>> - ret = rcsi2_c_phy_setting_v4h(priv, msps);
>>>> + ret = rcsi2_c_phy_setting_v4h(priv, mbps);
>>>> if (ret)
>>>> return ret;
>>>>
>>>> --
>>>> 2.43.0
>>>>
>>>
>>
>