From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Julien Stephan <jstephan@baylibre.com>
Cc: krzysztof.kozlowski@linaro.org, robh@kernel.org,
chunkuang.hu@kernel.org, linux-mediatek@lists.infradead.org,
Phi-bang Nguyen <pnguyen@baylibre.com>,
Louis Kuo <louis.kuo@mediatek.com>,
Chunfeng Yun <chunfeng.yun@mediatek.com>,
Vinod Koul <vkoul@kernel.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Andy Hsieh <andy.hsieh@mediatek.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Matthias Brugger <matthias.bgg@gmail.com>,
open list <linux-kernel@vger.kernel.org>,
"moderated list:ARM/Mediatek USB3 PHY DRIVER"
<linux-arm-kernel@lists.infradead.org>,
"open list:GENERIC PHY FRAMEWORK" <linux-phy@lists.infradead.org>,
"open list:DRM DRIVERS FOR MEDIATEK"
<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH v2 2/2] phy: mtk-mipi-csi: add driver for CSI phy
Date: Mon, 15 May 2023 16:22:38 +0200 [thread overview]
Message-ID: <85500bcc-c5e8-8ce2-edea-233de86c2d35@collabora.com> (raw)
In-Reply-To: <ynrvqt24hjgng25r2xa3hxj35cvgotx7sdfrbqfjcvj3foegmr@4lqhen5yu6fh>
Il 15/05/23 15:36, Julien Stephan ha scritto:
> On Mon, May 15, 2023 at 02:22:52PM +0200, AngeloGioacchino Del Regno wrote:
>> Il 15/05/23 11:05, Julien Stephan ha scritto:
> ..snip..
>>> + port->is_cdphy = of_property_read_bool(dev->of_node, "mediatek,is_cdphy");
>>
>> This driver doesn't support C-PHY mode, so you either add support for that, or in
>> my opinion you should simply refuse to probe it, as it is *dysfunctional* for the
>> unsupported case (and might even introduce unstabilities).
>>
>> /* At the moment, only D-PHY mode is supported */
>> if (!port->is_cdphy)
>> return -EINVAL;
>>
>> Also, please don't use underscores for devicetree properties: "mediatek,is-cdphy"
>> is fine.
>>
> Hi Angelo,
> You are right this driver does not support C-PHY mode, but some of the
> PHYs themselves support BOTH C-PHY AND D-PHY. The idea of `is_cdphy` variable
> is to know if the CSI port supports BOTH C-PHY AND D-PHY or only DPHY.
> For example mt8365 has 2 PHYs: CSI0 and CSI1. CSI1 support only D-PHY,
> while CSI0 can be configured in C-PHY or D-PHY. Registers for CD-PHY and
> D-PHY are almost identical, except that CD-PHY compatible has some extra
> bitfields to configure properly the mode and the lanes (because supporting
> trios for CD-PHY).
> If C-PHY support is eventually added into the driver, I think we will need
> another variable such as `mode` to know the mode. I was also thinking
> of adding a phy argument to determine if the mode is C-PHY or D-PHY.
>
> So here, I don't want to stop the probe if `is_cdphy` variable is set to
> true. Does it make sense ?
>
Comments in the code convinced me that the other PHYs providing only C or D PHY
support weren't compatible at all with this driver.
I got it now - but at this point can you please add a comment in the code actually
clarifying that this driver supports both PHYs providing *only* D-PHY and ones
providing selectable C-or-D PHY?
That clarified, it would not make sense to stop probing if it's not a CDPHY because
as you said there might be a D-only PHY that would be actually supported here.
Regards,
Angelo
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2023-05-15 14:22 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230515090551.1251389-1-jstephan@baylibre.com>
2023-05-15 9:05 ` [PATCH v2 1/2] dt-bindings: phy: add mediatek mipi csi driver v 0.5 Julien Stephan
2023-05-15 12:25 ` AngeloGioacchino Del Regno
2023-05-16 8:07 ` Krzysztof Kozlowski
2023-05-16 9:41 ` Julien Stephan
2023-05-16 12:56 ` Krzysztof Kozlowski
2023-05-16 17:00 ` Kevin Hilman
2023-05-16 17:46 ` Krzysztof Kozlowski
2023-05-16 21:31 ` Kevin Hilman
2023-05-17 7:40 ` Krzysztof Kozlowski
2023-05-22 19:15 ` Kevin Hilman
2023-05-30 8:53 ` Krzysztof Kozlowski
2023-06-05 8:44 ` Julien Stephan
2023-06-08 13:49 ` Rob Herring
2023-05-25 7:09 ` Chunfeng Yun (云春峰)
2023-05-15 9:05 ` [PATCH v2 2/2] phy: mtk-mipi-csi: add driver for CSI phy Julien Stephan
2023-05-15 12:22 ` AngeloGioacchino Del Regno
2023-05-15 13:36 ` Julien Stephan
2023-05-15 14:22 ` AngeloGioacchino Del Regno [this message]
2023-05-15 14:52 ` Julien Stephan
2023-05-15 14:07 ` Julien Stephan
2023-05-15 14:32 ` AngeloGioacchino Del Regno
2023-05-16 9:30 ` Julien Stephan
2023-05-16 14:55 ` AngeloGioacchino Del Regno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=85500bcc-c5e8-8ce2-edea-233de86c2d35@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=andy.hsieh@mediatek.com \
--cc=chunfeng.yun@mediatek.com \
--cc=chunkuang.hu@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jstephan@baylibre.com \
--cc=kishon@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-phy@lists.infradead.org \
--cc=louis.kuo@mediatek.com \
--cc=matthias.bgg@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=pnguyen@baylibre.com \
--cc=robh@kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).