phy: qualcomm: phy-qcom-eusb2-repeater: Add support for SMB2360
authorAbel Vesa <abel.vesa@linaro.org>
Tue, 20 Feb 2024 19:42:00 +0000 (21:42 +0200)
committerVinod Koul <vkoul@kernel.org>
Thu, 28 Mar 2024 19:11:50 +0000 (00:41 +0530)
The SMB2360 PMICs contain the same repeater as the PM8550B, but requiring
different settings, so add dedicated compatible for SMB2360.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20240220-phy-qualcomm-eusb2-repeater-smb2360-v2-2-213338ca1d5f@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c

index a43e20abb10d54a2ff2bbe29907f5c4597d6871d..68cc8e24f38367eabd0da0687e90270b3c66056c 100644 (file)
@@ -88,6 +88,12 @@ static const u32 pm8550b_init_tbl[NUM_TUNE_FIELDS] = {
        [TUNE_USB2_PREEM] = 0x5,
 };
 
+static const u32 smb2360_init_tbl[NUM_TUNE_FIELDS] = {
+       [TUNE_IUSB2] = 0x5,
+       [TUNE_SQUELCH_U] = 0x3,
+       [TUNE_USB2_PREEM] = 0x2,
+};
+
 static const struct eusb2_repeater_cfg pm8550b_eusb2_cfg = {
        .init_tbl       = pm8550b_init_tbl,
        .init_tbl_num   = ARRAY_SIZE(pm8550b_init_tbl),
@@ -95,6 +101,13 @@ static const struct eusb2_repeater_cfg pm8550b_eusb2_cfg = {
        .num_vregs      = ARRAY_SIZE(pm8550b_vreg_l),
 };
 
+static const struct eusb2_repeater_cfg smb2360_eusb2_cfg = {
+       .init_tbl       = smb2360_init_tbl,
+       .init_tbl_num   = ARRAY_SIZE(smb2360_init_tbl),
+       .vreg_list      = pm8550b_vreg_l,
+       .num_vregs      = ARRAY_SIZE(pm8550b_vreg_l),
+};
+
 static int eusb2_repeater_init_vregs(struct eusb2_repeater *rptr)
 {
        int num = rptr->cfg->num_vregs;
@@ -271,6 +284,10 @@ static const struct of_device_id eusb2_repeater_of_match_table[] = {
                .compatible = "qcom,pm8550b-eusb2-repeater",
                .data = &pm8550b_eusb2_cfg,
        },
+       {
+               .compatible = "qcom,smb2360-eusb2-repeater",
+               .data = &smb2360_eusb2_cfg,
+       },
        { },
 };
 MODULE_DEVICE_TABLE(of, eusb2_repeater_of_match_table);