[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ynrvqt24hjgng25r2xa3hxj35cvgotx7sdfrbqfjcvj3foegmr@4lqhen5yu6fh>
Date: Mon, 15 May 2023 15:36:57 +0200
From: Julien Stephan <jstephan@...libre.com>
To: AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>
Cc: krzysztof.kozlowski@...aro.org, robh@...nel.org,
chunkuang.hu@...nel.org, linux-mediatek@...ts.infradead.org,
Phi-bang Nguyen <pnguyen@...libre.com>,
Louis Kuo <louis.kuo@...iatek.com>,
Chunfeng Yun <chunfeng.yun@...iatek.com>,
Vinod Koul <vkoul@...nel.org>,
Kishon Vijay Abraham I <kishon@...nel.org>,
Andy Hsieh <andy.hsieh@...iatek.com>,
Philipp Zabel <p.zabel@...gutronix.de>,
Matthias Brugger <matthias.bgg@...il.com>,
open list <linux-kernel@...r.kernel.org>,
"moderated list:ARM/Mediatek USB3 PHY DRIVER"
<linux-arm-kernel@...ts.infradead.org>,
"open list:GENERIC PHY FRAMEWORK" <linux-phy@...ts.infradead.org>,
"open list:DRM DRIVERS FOR MEDIATEK"
<dri-devel@...ts.freedesktop.org>
Subject: Re: [PATCH v2 2/2] phy: mtk-mipi-csi: add driver for CSI phy
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 ?
Regards
Julien
.. snip..
> > +
> > + phy = devm_phy_create(dev, NULL, &mtk_dphy_ops);
> > + if (IS_ERR(phy)) {
> > + dev_err(dev, "Failed to create PHY: %ld\n", PTR_ERR(phy));
> > + return PTR_ERR(phy);
> > + }
>
> Regards,
> Angelo
>
Powered by blists - more mailing lists