diff mbox series

[v3,2/5] phy: qcom-qmp-combo: add support for the USB+DP PHY on SM8150 platform

Message ID 20230531023415.1209301-3-dmitry.baryshkov@linaro.org
State Accepted
Commit 4daee20877df04b96bc36752acdc41dfc581b34c
Headers show
Series phy: qcom-qmp-usb: split away legacy USB+DP code | expand

Commit Message

Dmitry Baryshkov May 31, 2023, 2:34 a.m. UTC
SM8150 and SC8180X are close relatives. Reuse sc8180x data to support
USB+DP combo PHY on SM8150 platform.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Konrad Dybcio May 31, 2023, 11:35 a.m. UTC | #1
On 31.05.2023 04:34, Dmitry Baryshkov wrote:
> SM8150 and SC8180X are close relatives. Reuse sc8180x data to support
> USB+DP combo PHY on SM8150 platform.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
I'm not sure this is right. Downstream reuses SA8195 USB seq.

Konrad
>  drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> index 33cc99d9c77d..2bff1bbb8610 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> @@ -3614,6 +3614,10 @@ static const struct of_device_id qmp_combo_of_match_table[] = {
>  		.compatible = "qcom,sm6350-qmp-usb3-dp-phy",
>  		.data = &sm6350_usb3dpphy_cfg,
>  	},
> +	{
> +		.compatible = "qcom,sm8150-qmp-usb3-dp-phy",
> +		.data = &sc8180x_usb3dpphy_cfg,
> +	},
>  	{
>  		.compatible = "qcom,sm8250-qmp-usb3-dp-phy",
>  		.data = &sm8250_usb3dpphy_cfg,
Dmitry Baryshkov May 31, 2023, 12:13 p.m. UTC | #2
On Wed, 31 May 2023 at 14:35, Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
> On 31.05.2023 04:34, Dmitry Baryshkov wrote:
> > SM8150 and SC8180X are close relatives. Reuse sc8180x data to support
> > USB+DP combo PHY on SM8150 platform.
> >
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > ---
> I'm not sure this is right. Downstream reuses SA8195 USB seq.

The upstream driver uses sm8150 data for sc8180x. So even if sc8180x
data is not correct for sc8180x, it is definitely the one that we
should use for sm8150:

static const struct qmp_phy_cfg sc8180x_usb3dpphy_cfg = {
        .serdes_tbl             = sm8150_usb3_serdes_tbl,
        .serdes_tbl_num         = ARRAY_SIZE(sm8150_usb3_serdes_tbl),
        .tx_tbl                 = sm8150_usb3_tx_tbl,
        .tx_tbl_num             = ARRAY_SIZE(sm8150_usb3_tx_tbl),
        .rx_tbl                 = sm8150_usb3_rx_tbl,
        .rx_tbl_num             = ARRAY_SIZE(sm8150_usb3_rx_tbl),
        .pcs_tbl                = sm8150_usb3_pcs_tbl,
        .pcs_tbl_num            = ARRAY_SIZE(sm8150_usb3_pcs_tbl),
        .pcs_usb_tbl            = sm8150_usb3_pcs_usb_tbl,
        .pcs_usb_tbl_num        = ARRAY_SIZE(sm8150_usb3_pcs_usb_tbl),

        .dp_serdes_tbl          = qmp_v4_dp_serdes_tbl,
        .dp_serdes_tbl_num      = ARRAY_SIZE(qmp_v4_dp_serdes_tbl),
        .dp_tx_tbl              = qmp_v4_dp_tx_tbl,
        .dp_tx_tbl_num          = ARRAY_SIZE(qmp_v4_dp_tx_tbl),



>
> Konrad
> >  drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> > index 33cc99d9c77d..2bff1bbb8610 100644
> > --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> > +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> > @@ -3614,6 +3614,10 @@ static const struct of_device_id qmp_combo_of_match_table[] = {
> >               .compatible = "qcom,sm6350-qmp-usb3-dp-phy",
> >               .data = &sm6350_usb3dpphy_cfg,
> >       },
> > +     {
> > +             .compatible = "qcom,sm8150-qmp-usb3-dp-phy",
> > +             .data = &sc8180x_usb3dpphy_cfg,
> > +     },
> >       {
> >               .compatible = "qcom,sm8250-qmp-usb3-dp-phy",
> >               .data = &sm8250_usb3dpphy_cfg,
Konrad Dybcio May 31, 2023, 12:16 p.m. UTC | #3
On 31.05.2023 14:13, Dmitry Baryshkov wrote:
> On Wed, 31 May 2023 at 14:35, Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
>> On 31.05.2023 04:34, Dmitry Baryshkov wrote:
>>> SM8150 and SC8180X are close relatives. Reuse sc8180x data to support
>>> USB+DP combo PHY on SM8150 platform.
>>>
>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> ---
>> I'm not sure this is right. Downstream reuses SA8195 USB seq.
> 
> The upstream driver uses sm8150 data for sc8180x. So even if sc8180x
> data is not correct for sc8180x, it is definitely the one that we
> should use for sm8150:
Right sorry, this patch adds support for 81*5*0. I wanted to point out
that 8180 has a different set of init commands and one of them is probably
incorrect.

Konrad
> 
> static const struct qmp_phy_cfg sc8180x_usb3dpphy_cfg = {
>         .serdes_tbl             = sm8150_usb3_serdes_tbl,
>         .serdes_tbl_num         = ARRAY_SIZE(sm8150_usb3_serdes_tbl),
>         .tx_tbl                 = sm8150_usb3_tx_tbl,
>         .tx_tbl_num             = ARRAY_SIZE(sm8150_usb3_tx_tbl),
>         .rx_tbl                 = sm8150_usb3_rx_tbl,
>         .rx_tbl_num             = ARRAY_SIZE(sm8150_usb3_rx_tbl),
>         .pcs_tbl                = sm8150_usb3_pcs_tbl,
>         .pcs_tbl_num            = ARRAY_SIZE(sm8150_usb3_pcs_tbl),
>         .pcs_usb_tbl            = sm8150_usb3_pcs_usb_tbl,
>         .pcs_usb_tbl_num        = ARRAY_SIZE(sm8150_usb3_pcs_usb_tbl),
> 
>         .dp_serdes_tbl          = qmp_v4_dp_serdes_tbl,
>         .dp_serdes_tbl_num      = ARRAY_SIZE(qmp_v4_dp_serdes_tbl),
>         .dp_tx_tbl              = qmp_v4_dp_tx_tbl,
>         .dp_tx_tbl_num          = ARRAY_SIZE(qmp_v4_dp_tx_tbl),
> 
> 
> 
>>
>> Konrad
>>>  drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
>>> index 33cc99d9c77d..2bff1bbb8610 100644
>>> --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
>>> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
>>> @@ -3614,6 +3614,10 @@ static const struct of_device_id qmp_combo_of_match_table[] = {
>>>               .compatible = "qcom,sm6350-qmp-usb3-dp-phy",
>>>               .data = &sm6350_usb3dpphy_cfg,
>>>       },
>>> +     {
>>> +             .compatible = "qcom,sm8150-qmp-usb3-dp-phy",
>>> +             .data = &sc8180x_usb3dpphy_cfg,
>>> +     },
>>>       {
>>>               .compatible = "qcom,sm8250-qmp-usb3-dp-phy",
>>>               .data = &sm8250_usb3dpphy_cfg,
> 
> 
>
Bjorn Andersson July 10, 2023, 3:27 a.m. UTC | #4
On Wed, May 31, 2023 at 02:16:42PM +0200, Konrad Dybcio wrote:
> 
> 
> On 31.05.2023 14:13, Dmitry Baryshkov wrote:
> > On Wed, 31 May 2023 at 14:35, Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
> >> On 31.05.2023 04:34, Dmitry Baryshkov wrote:
> >>> SM8150 and SC8180X are close relatives. Reuse sc8180x data to support
> >>> USB+DP combo PHY on SM8150 platform.
> >>>
> >>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> >>> ---
> >> I'm not sure this is right. Downstream reuses SA8195 USB seq.
> > 
> > The upstream driver uses sm8150 data for sc8180x. So even if sc8180x
> > data is not correct for sc8180x, it is definitely the one that we
> > should use for sm8150:
> Right sorry, this patch adds support for 81*5*0. I wanted to point out
> that 8180 has a different set of init commands and one of them is probably
> incorrect.
> 

FWIW, DP works on my sc8180x devices. (But perhaps still not correct?)

Regards,
Bjorn
diff mbox series

Patch

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
index 33cc99d9c77d..2bff1bbb8610 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
@@ -3614,6 +3614,10 @@  static const struct of_device_id qmp_combo_of_match_table[] = {
 		.compatible = "qcom,sm6350-qmp-usb3-dp-phy",
 		.data = &sm6350_usb3dpphy_cfg,
 	},
+	{
+		.compatible = "qcom,sm8150-qmp-usb3-dp-phy",
+		.data = &sc8180x_usb3dpphy_cfg,
+	},
 	{
 		.compatible = "qcom,sm8250-qmp-usb3-dp-phy",
 		.data = &sm8250_usb3dpphy_cfg,