From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Juergen Beisert <jbe@pengutronix.de>
Subject: [PATCH 08/17] net: fec: Use clk API unconditionally
Date: Thu, 20 Jun 2013 08:54:12 +0200 [thread overview]
Message-ID: <1371711261-10039-9-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1371711261-10039-1-git-send-email-s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/net/fec_imx.c | 31 +++++++++----------------------
1 file changed, 9 insertions(+), 22 deletions(-)
diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 1346c91..2f31352 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -45,19 +45,6 @@ struct fec_frame {
uint8_t head[16]; /* MAC header(6 + 6 + 2) + 2(aligned) */
};
-#ifdef CONFIG_COMMON_CLK
-static inline unsigned long fec_clk_get_rate(struct fec_priv *fec)
-{
- return clk_get_rate(fec->clk);
-}
-#else
-static inline unsigned long fec_clk_get_rate(struct fec_priv *fec)
-{
- return imx_get_fecclk();
-}
-#endif
-
-
/*
* MII-interface related functions
*/
@@ -69,7 +56,7 @@ static int fec_miibus_read(struct mii_bus *bus, int phyAddr, int regAddr)
uint32_t phy; /* convenient holder for the PHY */
uint64_t start;
- writel(((fec_clk_get_rate(fec) >> 20) / 5) << 1,
+ writel(((clk_get_rate(fec->clk) >> 20) / 5) << 1,
fec->regs + FEC_MII_SPEED);
/*
* reading from any PHY's register is done by properly
@@ -112,7 +99,7 @@ static int fec_miibus_write(struct mii_bus *bus, int phyAddr,
uint32_t phy; /* convenient holder for the PHY */
uint64_t start;
- writel(((fec_clk_get_rate(fec) >> 20) / 5) << 1,
+ writel(((clk_get_rate(fec->clk) >> 20) / 5) << 1,
fec->regs + FEC_MII_SPEED);
reg = regAddr << FEC_MII_DATA_RA_SHIFT;
@@ -305,7 +292,7 @@ static int fec_init(struct eth_device *dev)
* Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
* and do not drop the Preamble.
*/
- writel(((fec_clk_get_rate(fec) >> 20) / 5) << 1,
+ writel(((clk_get_rate(fec->clk) >> 20) / 5) << 1,
fec->regs + FEC_MII_SPEED);
if (fec->interface == PHY_INTERFACE_MODE_RMII) {
@@ -674,14 +661,14 @@ static int fec_probe(struct device_d *dev)
edev->set_ethaddr = fec_set_hwaddr;
edev->parent = dev;
- if (IS_ENABLED(CONFIG_COMMON_CLK)) {
- fec->clk = clk_get(dev, NULL);
- if (IS_ERR(fec->clk)) {
- ret = PTR_ERR(fec->clk);
- goto err_free;
- }
+ fec->clk = clk_get(dev, NULL);
+ if (IS_ERR(fec->clk)) {
+ ret = PTR_ERR(fec->clk);
+ goto err_free;
}
+ clk_enable(fec->clk);
+
fec->regs = dev_request_mem_region(dev, 0);
/* Reset chip. */
--
1.8.3.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-06-20 6:55 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-20 6:54 [PATCH] convert MXS to common clk Sascha Hauer
2013-06-20 6:54 ` [PATCH 01/17] clk: divider: Add onebased divider support Sascha Hauer
2013-06-20 6:54 ` [PATCH 02/17] clk: gate: Add inverted gate support Sascha Hauer
2013-06-20 6:54 ` [PATCH 03/17] clk: add prototype for clk_is_enabled Sascha Hauer
2013-06-20 6:54 ` [PATCH 04/17] ARM: MXS: Add MXS specific clk types Sascha Hauer
2013-06-21 12:14 ` Jürgen Beisert
2013-06-20 6:54 ` [PATCH 05/17] ARM: MXS: add clk drivers Sascha Hauer
2013-06-20 6:54 ` [PATCH 06/17] ARM: MXS: remove board specific clock setups Sascha Hauer
2013-06-20 6:54 ` [PATCH 07/17] mci: mxs: Use dev_* Sascha Hauer
2013-06-20 6:54 ` Sascha Hauer [this message]
2013-06-20 6:54 ` [PATCH 09/17] mci: mxs: use common clk API Sascha Hauer
2013-06-20 6:54 ` [PATCH 10/17] mtd: gpmi-nand: switch to clk support Sascha Hauer
2013-06-20 6:54 ` [PATCH 11/17] serial: auart: Use " Sascha Hauer
2013-06-20 6:54 ` [PATCH 12/17] serial: stm: " Sascha Hauer
2013-06-20 6:54 ` [PATCH 13/17] spi: mxs: " Sascha Hauer
2013-06-20 6:54 ` [PATCH 14/17] ARM: MXS: octotp: switch to " Sascha Hauer
2013-06-20 6:54 ` [PATCH 15/17] ARM: MXS: remove imx_enable_enetclk Sascha Hauer
2013-06-20 6:54 ` [PATCH 16/17] video: stm: switch to clk support Sascha Hauer
2013-06-20 6:54 ` [PATCH 17/17] ARM: MXS: remove old clock support Sascha Hauer
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=1371711261-10039-9-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=jbe@pengutronix.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