On 04-05-20, 16:26, Dilip Kota wrote:I dont see a need of adding a comment, describing don't do regmap here.
On 5/4/2020 3:29 PM, Vinod Koul wrote:okay, perhaps add a comment somewhere that regmap is not used for this
On 30-04-20, 15:15, Dilip Kota wrote:It is not regmap address, one of the below two addresses are passed to this
+ u32 mask, u32 val)bypassing regmap here... why?
+{
+ u32 reg_val;
+
+ reg_val = readl(base + reg);
+ reg_val &= ~mask;
+ reg_val |= FIELD_PREP(mask, val);
+ writel(reg_val, base + reg);
function.
base?
Comments are already in place, mentioning Start and Stop of Rx Adaptation. And Stop is being is done as Start is triggered, so not needed to mention error and success.
struct intel_combo_phy {
...
ÂÂÂÂÂÂÂ void __iomemÂÂÂÂÂÂÂÂÂÂÂ *app_base;
ÂÂÂÂÂÂÂ void __iomemÂÂÂÂÂÂÂÂÂÂÂ *cr_base;
...
}
Again documenting this helps, pls add some comments on this behaviourNext step is stopping the Adaptation, it should be done in both error and+static int intel_cbphy_calibrate(struct phy *phy)you want to continue her and not return error?
+{
+ struct intel_cbphy_iphy *iphy = phy_get_drvdata(phy);
+ struct intel_combo_phy *cbphy = iphy->parent;
+ void __iomem *cr_base = cbphy->cr_base;
+ int val, ret, id;
+
+ if (cbphy->phy_mode != PHY_XPCS_MODE)
+ return 0;
+
+ id = PHY_ID(iphy);
+
+ /* trigger auto RX adaptation */
+ combo_phy_w32_off_mask(cr_base, CR_ADDR(PCS_XF_ATE_OVRD_IN_2, id),
+ ADAPT_REQ_MSK, 3);
+ /* Wait RX adaptation to finish */
+ ret = readl_poll_timeout(cr_base + CR_ADDR(PCS_XF_RX_ADAPT_ACK, id),
+ val, val & RX_ADAPT_ACK_BIT, 10, 5000);
+ if (ret)
+ dev_err(cbphy->dev, "RX Adaptation failed!\n");
success case.