From patchwork Mon Jan 21 09:13:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 156182 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6156498jaa; Mon, 21 Jan 2019 01:15:36 -0800 (PST) X-Google-Smtp-Source: ALg8bN7sNrFrRmR1mWJ+NEzZn972D3oyTWfS9mTV5dUPBIa0AgZnM1yi7ChU0zmMwR3uxKWEqQyS X-Received: by 2002:a62:f907:: with SMTP id o7mr28704432pfh.244.1548062136259; Mon, 21 Jan 2019 01:15:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548062136; cv=none; d=google.com; s=arc-20160816; b=l3MwpTkKw4dBFz/4IW0qw02ej8EXpn+/W0yjaoeQE5NKKZtmXoa8Jblzc8bYqilQd/ EqDhT/X2LIOHNpzALwG//FSfPMpDpwmXDQMTIOnb+BC3eqvNBffdoDbACKhclBql2O8t kSh8X8DQwPQw5D6JUmHjt+xupsRjqUzMqQYIxZnbi2aIEPFk36/xSVPphhM13+B7ab04 h3Mp+5UkR1PXROAgpJmypj91c0gi5p2FnpEoGMT8FR7ZxWnjEg1WH36juB3jOsfFuAgp A8n485asVJtT98XDzOVO08CeDAcacCfFMCLAGPpx1Et9KLQVW/se60OVkFBa2iN42Lg2 /Vrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/W3aM8h2xOhD+kohQYuPP+RBTwUjcc+/tFnc6nT6VAM=; b=vJkCf5neA80Uv2l+CendGXnBgA+BQlsSrNF2/BLaZHI+Y/QyGRISwD9SmanaA0TMrP 33aJ/0/bZ0jP1A0Jb8c6SO/EDlQww7KCg0mup8mbxexn21+HwIjeoMqIp+ILShFLbL8D 3V7fswVtsEeEMLE1YZgu/0i5oI/7ZmSSM0nSRpzx1NPVc9rizzfbN4M2Bl+WB8UgOsiH 79I5q5D2XumznyD+dxeVn7DSevyM1MpVpxQ/q3LAixnHA56A4WhNK1SJ9T+XiDkeMwIX m7tW2WKNgSm57JVbnqQqtdA32bbXtPlUXy+HCMeFWQrj9q3YoYxbf3gmXMqCYgFDoRT+ eobw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="BWEYY/4I"; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r28si10768448pgm.317.2019.01.21.01.15.36; Mon, 21 Jan 2019 01:15:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="BWEYY/4I"; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727553AbfAUJPe (ORCPT + 15 others); Mon, 21 Jan 2019 04:15:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:49930 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727519AbfAUJPd (ORCPT ); Mon, 21 Jan 2019 04:15:33 -0500 Received: from localhost.localdomain (unknown [122.178.235.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9CF3120989; Mon, 21 Jan 2019 09:15:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548062133; bh=b9oD5s5xFLJe3/RIf6wv2tL3BvX+CWOWT8zW9XKQ99g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BWEYY/4IOgWdnFITTT81lRViRI7Hfs8h5rH3SQyY/WYarENN893QrEegyuPkAtyr5 0iseU5V+jtAbjegEobWowqmOfqo3Clw6frHx4ekrcz5Iod1KKefchrddO0BDJTKfnx j7ih1csC7SoY0o+vmwtcdE30hCIMJEqbn73iMMXs= From: Vinod Koul To: David S Miller Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, Niklas Cassel , Bjorn Andersson , Vinod Koul , Andrew Lunn , Florian Fainelli Subject: [PATCH v3 4/5] net: phy: at803x: Disable phy delay for RGMII mode Date: Mon, 21 Jan 2019 14:43:17 +0530 Message-Id: <20190121091318.20079-5-vkoul@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190121091318.20079-1-vkoul@kernel.org> References: <20190121091318.20079-1-vkoul@kernel.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org For RGMII mode, phy delay should be disabled. Add this case along with disable delay routines. Signed-off-by: Vinod Koul --- drivers/net/phy/at803x.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) -- 2.20.1 diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index f9432d053a22..8ff12938ab47 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c @@ -110,16 +110,16 @@ static int at803x_debug_reg_mask(struct phy_device *phydev, u16 reg, return phy_write(phydev, AT803X_DEBUG_DATA, val); } -static inline int at803x_enable_rx_delay(struct phy_device *phydev) +static inline int at803x_disable_rx_delay(struct phy_device *phydev) { - return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, 0, - AT803X_DEBUG_RX_CLK_DLY_EN); + return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, + AT803X_DEBUG_RX_CLK_DLY_EN, 0); } -static inline int at803x_enable_tx_delay(struct phy_device *phydev) +static inline int at803x_disable_tx_delay(struct phy_device *phydev) { - return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, 0, - AT803X_DEBUG_TX_CLK_DLY_EN); + return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, + AT803X_DEBUG_TX_CLK_DLY_EN, 0); } /* save relevant PHY registers to private copy */ @@ -256,15 +256,17 @@ static int at803x_config_init(struct phy_device *phydev) return ret; if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID || - phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) { - ret = at803x_enable_rx_delay(phydev); + phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || + phydev->interface == PHY_INTERFACE_MODE_RGMII) { + ret = at803x_disable_rx_delay(phydev); if (ret < 0) return ret; } if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID || - phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) { - ret = at803x_enable_tx_delay(phydev); + phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || + phydev->interface == PHY_INTERFACE_MODE_RGMII) { + ret = at803x_disable_tx_delay(phydev); if (ret < 0) return ret; }