From: Dan Murphy <dmurphy@ti.com>
To: u-boot@lists.denx.de
Subject: [PATCH v3 1/5] net: phy: Add missing kernel doc to phy functions
Date: Thu, 30 Apr 2020 11:30:43 -0500 [thread overview]
Message-ID: <20200430163047.6898-2-dmurphy@ti.com> (raw)
In-Reply-To: <20200430163047.6898-1-dmurphy@ti.com>
Add kernel doc to the phy_read/write utility functions in phy.h
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
include/phy.h | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/include/phy.h b/include/phy.h
index b5de14cbfc29..c1f6509e42fc 100644
--- a/include/phy.h
+++ b/include/phy.h
@@ -170,6 +170,13 @@ struct fixed_link {
int asym_pause;
};
+/**
+ * phy_read - Convenience function for reading a given PHY register
+ * @phydev: the phy_device struct
+ * @devad: The MMD to read from
+ * @regnum: register number to read
+ * @return: value for success or negative errno for failure
+ */
static inline int phy_read(struct phy_device *phydev, int devad, int regnum)
{
struct mii_dev *bus = phydev->bus;
@@ -182,6 +189,14 @@ static inline int phy_read(struct phy_device *phydev, int devad, int regnum)
return bus->read(bus, phydev->addr, devad, regnum);
}
+/**
+ * phy_write - Convenience function for writing a given PHY register
+ * @phydev: the phy_device struct
+ * @devad: The MMD to read from
+ * @regnum: register number to write
+ * @val: value to write to @regnum
+ * @return: 0 for success or negative errno for failure
+ */
static inline int phy_write(struct phy_device *phydev, int devad, int regnum,
u16 val)
{
@@ -195,6 +210,13 @@ static inline int phy_write(struct phy_device *phydev, int devad, int regnum,
return bus->write(bus, phydev->addr, devad, regnum, val);
}
+/**
+ * phy_mmd_start_indirect - Convenience function for writing MMD registers
+ * @phydev: the phy_device struct
+ * @devad: The MMD to read from
+ * @regnum: register number to write
+ * @return: None
+ */
static inline void phy_mmd_start_indirect(struct phy_device *phydev, int devad,
int regnum)
{
@@ -209,6 +231,14 @@ static inline void phy_mmd_start_indirect(struct phy_device *phydev, int devad,
(devad | MII_MMD_CTRL_NOINCR));
}
+/**
+ * phy_read_mmd - Convenience function for reading a register
+ * from an MMD on a given PHY.
+ * @phydev: The phy_device struct
+ * @devad: The MMD to read from
+ * @regnum: The register on the MMD to read
+ * @return: Value for success or negative errno for failure
+ */
static inline int phy_read_mmd(struct phy_device *phydev, int devad,
int regnum)
{
@@ -233,6 +263,15 @@ static inline int phy_read_mmd(struct phy_device *phydev, int devad,
return phy_read(phydev, MDIO_DEVAD_NONE, MII_MMD_DATA);
}
+/**
+ * phy_write_mmd - Convenience function for writing a register
+ * on an MMD on a given PHY.
+ * @phydev: The phy_device struct
+ * @devad: The MMD to read from
+ * @regnum: The register on the MMD to read
+ * @val: value to write to @regnum
+ * @return: 0 for success or negative errno for failure
+ */
static inline int phy_write_mmd(struct phy_device *phydev, int devad,
int regnum, u16 val)
{
--
2.25.1
next prev parent reply other threads:[~2020-04-30 16:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-30 16:30 [PATCH v3 0/5] TI Ethernet PHY changes Dan Murphy
2020-04-30 16:30 ` Dan Murphy [this message]
2020-05-04 9:45 ` [PATCH v3 1/5] net: phy: Add missing kernel doc to phy functions Michal Simek
2020-04-30 16:30 ` [PATCH v3 2/5] net: phy: Fix kernel doc issues in phy.h Dan Murphy
2020-05-04 9:45 ` Michal Simek
2020-04-30 16:30 ` [PATCH v3 3/5] net: phy: Add helper routines to set and clear bits Dan Murphy
2020-05-04 9:46 ` Michal Simek
2020-04-30 16:30 ` [PATCH v3 4/5] net: phy: Add support for TI PHY init Dan Murphy
2020-05-04 9:46 ` Michal Simek
2020-05-04 16:59 ` Dan Murphy
2020-04-30 16:30 ` [PATCH v3 5/5] net: phy: Add DP8382x phy registration to " Dan Murphy
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=20200430163047.6898-2-dmurphy@ti.com \
--to=dmurphy@ti.com \
--cc=u-boot@lists.denx.de \
/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