* [PATCH V2 11/14] NET: MIPS: lantiq: convert etop driver to clkdev api
[not found] <1330012993-13510-1-git-send-email-blogic@openwrt.org>
@ 2012-02-23 16:03 ` John Crispin
2012-02-24 8:28 ` David Miller
2012-02-24 10:55 ` Sergei Shtylyov
0 siblings, 2 replies; 5+ messages in thread
From: John Crispin @ 2012-02-23 16:03 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips, John Crispin, netdev
Update from old pmu_{dis,en}able() to ckldev api.
Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: netdev@vger.kernel.org
---
drivers/net/ethernet/lantiq_etop.c | 47 ++++++++++++++++++++++++++++++-----
1 files changed, 40 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
index e5ec8b1..6b2e4b4 100644
--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -36,6 +36,7 @@
#include <linux/io.h>
#include <linux/dma-mapping.h>
#include <linux/module.h>
+#include <linux/clk.h>
#include <asm/checksum.h>
@@ -148,6 +149,11 @@ struct ltq_etop_priv {
int tx_free[MAX_DMA_CHAN >> 1];
spinlock_t lock;
+
+ struct clk *clk_ppe;
+ struct clk *clk_switch;
+ struct clk *clk_ephy;
+ struct clk *clk_ephycgu;
};
static int ltq_etop_mdio_wr(struct mii_bus *bus, int phy_addr,
@@ -281,16 +287,27 @@ ltq_etop_hw_exit(struct net_device *dev)
struct ltq_etop_priv *priv = netdev_priv(dev);
int i;
- ltq_pmu_disable(PMU_PPE);
+ clk_disable(priv->clk_ppe);
+
+ if (ltq_has_gbit())
+ clk_disable(priv->clk_switch);
+
+ if (ltq_is_ase()) {
+ clk_disable(priv->clk_ephy);
+ clk_disable(priv->clk_ephycgu);
+ }
+
for (i = 0; i < MAX_DMA_CHAN; i++)
if (IS_TX(i) || IS_RX(i))
ltq_etop_free_channel(dev, &priv->ch[i]);
}
static void
-ltq_etop_gbit_init(void)
+ltq_etop_gbit_init(struct net_device *dev)
{
- ltq_pmu_enable(PMU_SWITCH);
+ struct ltq_etop_priv *priv = netdev_priv(dev);
+
+ clk_enable(priv->clk_switch);
ltq_gbit_w32_mask(0, GCTL0_SE, LTQ_GBIT_GCTL0);
/** Disable MDIO auto polling mode */
@@ -313,10 +330,10 @@ ltq_etop_hw_init(struct net_device *dev)
int err = 0;
int i;
- ltq_pmu_enable(PMU_PPE);
+ clk_enable(priv->clk_ppe);
if (ltq_has_gbit()) {
- ltq_etop_gbit_init();
+ ltq_etop_gbit_init(dev);
/* force the etops link to the gbit to MII */
mii_mode = PHY_INTERFACE_MODE_MII;
}
@@ -334,11 +351,11 @@ ltq_etop_hw_init(struct net_device *dev)
default:
if (ltq_is_ase()) {
- ltq_pmu_enable(PMU_EPHY);
+ clk_enable(priv->clk_ephy);
/* disable external MII */
ltq_etop_w32_mask(0, ETOP_CFG_MII0, LTQ_ETOP_CFG);
/* enable clock for internal PHY */
- ltq_cgu_enable(CGU_EPHY);
+ clk_enable(priv->clk_ephycgu);
/* we need to write this magic to the internal phy to
make it work */
ltq_etop_mdio_wr(NULL, 0x8, 0x12, 0xC020);
@@ -886,6 +903,22 @@ ltq_etop_probe(struct platform_device *pdev)
priv->pdev = pdev;
priv->pldata = dev_get_platdata(&pdev->dev);
priv->netdev = dev;
+
+ priv->clk_ppe = clk_get(&pdev->dev, NULL);
+ if (!priv->clk_ppe)
+ return -ENOENT;
+ if (ltq_has_gbit()) {
+ priv->clk_switch = clk_get(&pdev->dev, "switch");
+ if (!priv->clk_switch)
+ return -ENOENT;
+ }
+ if (ltq_is_ase()) {
+ priv->clk_ephy = clk_get(&pdev->dev, "ephy");
+ priv->clk_ephycgu = clk_get(&pdev->dev, "ephycgu");
+ if (!priv->clk_ephy || !priv->clk_ephycgu)
+ return -ENOENT;
+ }
+
spin_lock_init(&priv->lock);
for (i = 0; i < MAX_DMA_CHAN; i++) {
--
1.7.7.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH V2 11/14] NET: MIPS: lantiq: convert etop driver to clkdev api
2012-02-23 16:03 ` [PATCH V2 11/14] NET: MIPS: lantiq: convert etop driver to clkdev api John Crispin
@ 2012-02-24 8:28 ` David Miller
2012-02-24 8:40 ` John Crispin
2012-02-24 10:55 ` Sergei Shtylyov
1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2012-02-24 8:28 UTC (permalink / raw)
To: blogic; +Cc: ralf, linux-mips, netdev
From: John Crispin <blogic@openwrt.org>
Date: Thu, 23 Feb 2012 17:03:10 +0100
> Update from old pmu_{dis,en}able() to ckldev api.
>
> Signed-off-by: John Crispin <blogic@openwrt.org>
Come on guys, don't do crap like this.
When you have a 14 patch series, and I only see one or two of them
I have no idea what in the world you want me to do with these patches.
Are they dependent upon the previous patches that weren't sent to me?
Are they not and I can just apply them as-is?
Could I apply them as-is, but you want them to go via the MIPS tree
for some reason and just want my ACK?
Nobody knows because you didn't bother to say one way or another
and that is extremely irritating because as a result I have to
ask you all of these stupid questions and write this rediculious
email.
I'm just ignoring every single one of these MIPS patches, sorry.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V2 11/14] NET: MIPS: lantiq: convert etop driver to clkdev api
2012-02-24 8:28 ` David Miller
@ 2012-02-24 8:40 ` John Crispin
2012-02-24 8:53 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: John Crispin @ 2012-02-24 8:40 UTC (permalink / raw)
To: David Miller; +Cc: ralf, linux-mips, netdev
On 24/02/12 09:28, David Miller wrote:
> From: John Crispin <blogic@openwrt.org>
> Date: Thu, 23 Feb 2012 17:03:10 +0100
>
>> Update from old pmu_{dis,en}able() to ckldev api.
>>
>> Signed-off-by: John Crispin <blogic@openwrt.org>
> Come on guys, don't do crap like this.
>
> When you have a 14 patch series, and I only see one or two of them
> I have no idea what in the world you want me to do with these patches.
>
> Are they dependent upon the previous patches that weren't sent to me?
>
> Are they not and I can just apply them as-is?
>
> Could I apply them as-is, but you want them to go via the MIPS tree
> for some reason and just want my ACK?
>
> Nobody knows because you didn't bother to say one way or another
> and that is extremely irritating because as a result I have to
> ask you all of these stupid questions and write this rediculious
> email.
>
> I'm just ignoring every single one of these MIPS patches, sorry.
Hi,
you are right, totally stupid of me to waste other peoples time like this.
I forgot the following things
* mention that i would welcome a ack'ed by from you
* mention that these patches should go via MIPS with the other patches
in the series
* I should have put in the commit messages, that you were CC'ed on, what
the rest of the series does
* on the last "fix locking issues" patch I also forgot to CC Ralf and MIPS
One question if I may ask
* do you want to be CC'ed for a full series even if only 1 patch relates
to netdev or should I simply think more about the commit message so it
is apparent what i expect ?
again, sorry for wasting your time with stupidity ... I will clean up
the mess I made during today ...
hope you accept my apology,
John
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V2 11/14] NET: MIPS: lantiq: convert etop driver to clkdev api
2012-02-24 8:40 ` John Crispin
@ 2012-02-24 8:53 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2012-02-24 8:53 UTC (permalink / raw)
To: blogic; +Cc: ralf, linux-mips, netdev
From: John Crispin <blogic@openwrt.org>
Date: Fri, 24 Feb 2012 09:40:34 +0100
> One question if I may ask
> * do you want to be CC'ed for a full series even if only 1 patch relates
> to netdev or should I simply think more about the commit message so it
> is apparent what i expect ?
Only post the networking patches and mention the situation at hand
in this kind of case.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V2 11/14] NET: MIPS: lantiq: convert etop driver to clkdev api
2012-02-23 16:03 ` [PATCH V2 11/14] NET: MIPS: lantiq: convert etop driver to clkdev api John Crispin
2012-02-24 8:28 ` David Miller
@ 2012-02-24 10:55 ` Sergei Shtylyov
1 sibling, 0 replies; 5+ messages in thread
From: Sergei Shtylyov @ 2012-02-24 10:55 UTC (permalink / raw)
To: John Crispin; +Cc: Ralf Baechle, linux-mips, netdev
Hello.
On 23-02-2012 20:03, John Crispin wrote:
> Update from old pmu_{dis,en}able() to ckldev api.
> Signed-off-by: John Crispin<blogic@openwrt.org>
> Cc: netdev@vger.kernel.org
[...]
> diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
> index e5ec8b1..6b2e4b4 100644
> --- a/drivers/net/ethernet/lantiq_etop.c
> +++ b/drivers/net/ethernet/lantiq_etop.c
[...]
> @@ -886,6 +903,22 @@ ltq_etop_probe(struct platform_device *pdev)
> priv->pdev = pdev;
> priv->pldata = dev_get_platdata(&pdev->dev);
> priv->netdev = dev;
> +
> + priv->clk_ppe = clk_get(&pdev->dev, NULL);
> + if (!priv->clk_ppe)
> + return -ENOENT;
> + if (ltq_has_gbit()) {
> + priv->clk_switch = clk_get(&pdev->dev, "switch");
> + if (!priv->clk_switch)
clk_get() doesn't retirn NULL, it returns error code.
> + return -ENOENT;
> + }
> + if (ltq_is_ase()) {
> + priv->clk_ephy = clk_get(&pdev->dev, "ephy");
> + priv->clk_ephycgu = clk_get(&pdev->dev, "ephycgu");
> + if (!priv->clk_ephy || !priv->clk_ephycgu)
Same here.
WBR, Sergei
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-02-24 10:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1330012993-13510-1-git-send-email-blogic@openwrt.org>
2012-02-23 16:03 ` [PATCH V2 11/14] NET: MIPS: lantiq: convert etop driver to clkdev api John Crispin
2012-02-24 8:28 ` David Miller
2012-02-24 8:40 ` John Crispin
2012-02-24 8:53 ` David Miller
2012-02-24 10:55 ` Sergei Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).