phy: cadence: Sierra: Add support to get SSC type from device tree
authorSwapnil Jakhade <sjakhade@cadence.com>
Thu, 23 Dec 2021 06:01:27 +0000 (07:01 +0100)
committerVinod Koul <vkoul@kernel.org>
Mon, 27 Dec 2021 11:05:08 +0000 (16:35 +0530)
Add support to get SSC type from DT.

Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Reviewed-by: Aswath Govindraju <a-govindraju@ti.com>
Link: https://lore.kernel.org/r/20211223060137.9252-6-sjakhade@cadence.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/cadence/phy-cadence-sierra.c

index c82ac6716f5e6941ee0dc86a2edeaff4b9354642..4674328574f513f9407701190d9b3b75e07ff4be 100644 (file)
@@ -238,6 +238,7 @@ struct cdns_sierra_inst {
        u32 num_lanes;
        u32 mlane;
        struct reset_control *lnk_rst;
+       enum cdns_sierra_ssc_mode ssc_mode;
 };
 
 struct cdns_reg_pairs {
@@ -360,7 +361,7 @@ static int cdns_sierra_phy_init(struct phy *gphy)
        const struct cdns_sierra_data *init_data = phy->init_data;
        struct cdns_sierra_vals *pma_cmn_vals, *pma_ln_vals;
        enum cdns_sierra_phy_type phy_type = ins->phy_type;
-       enum cdns_sierra_ssc_mode ssc = EXTERNAL_SSC;
+       enum cdns_sierra_ssc_mode ssc = ins->ssc_mode;
        const struct cdns_reg_pairs *reg_pairs;
        struct regmap *regmap;
        u32 num_regs;
@@ -623,6 +624,9 @@ static int cdns_sierra_get_optional(struct cdns_sierra_inst *inst,
                return -EINVAL;
        }
 
+       inst->ssc_mode = EXTERNAL_SSC;
+       of_property_read_u32(child, "cdns,ssc-mode", &inst->ssc_mode);
+
        return 0;
 }