mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: martin.blumenstingl@googlemail.com (Martin Blumenstingl)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH net-next 1/5] net: phy: realtek: use the BIT and GENMASK macros
Date: Sat,  2 Dec 2017 22:51:24 +0100	[thread overview]
Message-ID: <20171202215128.20202-2-martin.blumenstingl@googlemail.com> (raw)
In-Reply-To: <20171202215128.20202-1-martin.blumenstingl@googlemail.com>

This makes it easier to compare the #defines with the datasheets.
No functional changes.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 drivers/net/phy/realtek.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
index eda0a6e86918..9708aa9c58dd 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -13,21 +13,22 @@
  * option) any later version.
  *
  */
+#include <linux/bitops.h>
 #include <linux/phy.h>
 #include <linux/module.h>
 
 #define RTL821x_PHYSR		0x11
-#define RTL821x_PHYSR_DUPLEX	0x2000
-#define RTL821x_PHYSR_SPEED	0xc000
+#define RTL821x_PHYSR_DUPLEX	BIT(13)
+#define RTL821x_PHYSR_SPEED	GENMASK(15, 14)
 #define RTL821x_INER		0x12
 #define RTL821x_INER_INIT	0x6400
 #define RTL821x_INSR		0x13
 #define RTL821x_PAGE_SELECT	0x1f
-#define RTL8211E_INER_LINK_STATUS 0x400
+#define RTL8211E_INER_LINK_STATUS	BIT(10)
 
-#define RTL8211F_INER_LINK_STATUS 0x0010
+#define RTL8211F_INER_LINK_STATUS	BIT(4)
 #define RTL8211F_INSR		0x1d
-#define RTL8211F_TX_DELAY	0x100
+#define RTL8211F_TX_DELAY	BIT(8)
 
 #define RTL8201F_ISR		0x1e
 #define RTL8201F_IER		0x13
-- 
2.15.1

  reply	other threads:[~2017-12-02 21:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-02 21:51 [PATCH net-next 0/5] Realtek Ethernet PHY driver improvements Martin Blumenstingl
2017-12-02 21:51 ` Martin Blumenstingl [this message]
2017-12-03  3:24   ` [PATCH net-next 1/5] net: phy: realtek: use the BIT and GENMASK macros Andrew Lunn
2017-12-02 21:51 ` [PATCH net-next 2/5] net: phy: realtek: rename RTL821x_INER_INIT to RTL8211B_INER_INIT Martin Blumenstingl
2017-12-03  3:24   ` Andrew Lunn
2017-12-02 21:51 ` [PATCH net-next 3/5] net: phy: realtek: group all register bit #defines for RTL821x_INER Martin Blumenstingl
2017-12-03  3:25   ` Andrew Lunn
2017-12-02 21:51 ` [PATCH net-next 4/5] net: phy: realtek: use the same indentation for all #defines Martin Blumenstingl
2017-12-03  3:26   ` Andrew Lunn
2017-12-02 21:51 ` [PATCH net-next 5/5] net: phy: realtek: add utility functions to read/write page addresses Martin Blumenstingl
2017-12-03  3:29   ` Andrew Lunn
2017-12-03 14:38 ` [PATCH net-next 0/5] Realtek Ethernet PHY driver improvements David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171202215128.20202-2-martin.blumenstingl@googlemail.com \
    --to=martin.blumenstingl@googlemail.com \
    --cc=linus-amlogic@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®