Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
struct mii_bus *mii = mdiodev->bus;
struct ar7240sw *as;
struct switch_dev *swdev;
+ struct reset_control *switch_reset;
u32 ctrl;
int phy_if_mode, err, i;
swdev = &as->swdev;
+ switch_reset = devm_reset_control_get_optional(&mdiodev->dev, "switch");
+ if (switch_reset) {
+ reset_control_assert(switch_reset);
+ msleep(50);
+ reset_control_deassert(switch_reset);
+ msleep(200);
+ }
+
ctrl = ar7240sw_reg_read(mii, AR7240_REG_MASK_CTRL);
as->ver = (ctrl >> AR7240_MASK_CTRL_VERSION_S) &
AR7240_MASK_CTRL_VERSION_M;