On 5/10/22 10:51, Raphael Gallais-Pou wrote:
On 5/5/22 19:40, Marek Vasut wrote:
On 5/4/22 09:59, Raphael Gallais-Pou wrote:
Hi Marek,
Hi,
[...]
@@ -499,8 +512,16 @@ static int dw_mipi_dsi_stm_probe(struct platform_device
*pdev)
}
dsi->hw_version = dsi_read(dsi, DSI_VERSION) & VERSION;
+
+ ret = dw_mipi_dsi_phy_regulator_on(dsi);
clk_disable_unprepare(pclk);
+ if (ret) {
+ DRM_ERROR("%s: Failed to enable wrapper regulator, ret=%d\n",
+ __func__, ret);
+ goto err_dsi_probe;
+ }
+
I have no problem until here. If I understand this correctly, it enables the
regulator during all the life of the driver.
If you feel an urge to merge this patch into the Linux kernel, the st display
team could gladly do it because it enables more hardware bridges. However
another solution could be to rework a bit the regulator part of the driver so
that you would have only device tree to change, introducing a 'reg-always-on'
property.
This driver needs in fact a bit of a rework with the power management. A
solution could be to move the regulator-related part in
dw_mipi_dsi_stm_power_on/off() so that it is only activated when needed.
Those functions would integrate the enabling of the regulator, the switch for
the internal regulator, and eventually handle the PLL if it cannot lock when
the regulator is off.
With the DT property, the power management would be only in the
probe()/remove(). In that way the DSI bridges would have the logic they need
to work.
Ultimately there is two possibilities :
* You really need this patch to be merged asap
* You are ok to wait until we send the solution described above
If you want to write those patches (each for DT and regulator), feel free to
do it.
What do you think about it ?
Maybe a more generic question first -- is there a way to pull the data lanes
to LP11 without enabling the regulator ?
Also note that you likely want to wait with this patch, there is likely soon
going to be a discussion about how to handle all those different requirements
for initial DSI LP states and clock needed by DSI bridges, encoding such
policy into DT is not the right approach.
After quite some time of internal research, it is unfortunately not possible to
adjust data lanes state to LP11 without the regulator enabled.
So I guess, without a change to handle DSI LP states differently within DRM,
your patch may be the best approach to operate such bridges.
Note that I am still trying to understand how other chip vendors managed the
case. Maybe their hardware can effectively handle the DL states without enabling
their regulator ?
I think they just keep the DSI data lanes in LP11 when the bridge comes
up, but this is probably currently inconsistent and totally ad-hoc,
hence the need for some sort of new API to control these states better.
I wonder if another solution could be to move the TC356787 bridge reset outside
the probe, so we could also delay the regulator_enable on STM driver side.
No, you cannot do that, because of the (e)DP aux channel which has to be
available early on that bridge, i.e. in probe. That is also something
which makes clocking it from DSI HS clock hard on that chip.
Anyway I agree with you that modifying the device tree is not the right method,
and having the driver always powered is not so nice either.
Let's postpone this patch until we know what to do about the LP states
in general. Of course, if another bridge which has problems like this
TC358767 pops up on STM32, you can just apply this patch then, oh well.