netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] [DM9000] External PHY support
@ 2007-08-16  8:16 Laurent Pinchart
  2007-08-16 17:00 ` Ben Dooks
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent Pinchart @ 2007-08-16  8:16 UTC (permalink / raw)
  To: netdev; +Cc: Ben Dooks

This patch adds a flag to the DM9000 platform data which, when set,
configures the device to use an external PHY.

Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
---
 drivers/net/dm9000.c   |    6 ++++++
 include/linux/dm9000.h |    1 +
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index a424810..a86984e 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -136,6 +136,7 @@ typedef struct board_info {
 	u16 dbug_cnt;
 	u8 io_mode;		/* 0:word, 2:byte */
 	u8 phy_addr;
+	unsigned int flags;
 
 	void (*inblk)(void __iomem *port, void *data, int length);
 	void (*outblk)(void __iomem *port, void *data, int length);
@@ -528,6 +529,8 @@ dm9000_probe(struct platform_device *pdev)
 
 		if (pdata->dumpblk != NULL)
 			db->dumpblk = pdata->dumpblk;
+
+		db->flags = pdata->flags;
 	}
 
 	dm9000_reset(db);
@@ -670,6 +673,9 @@ dm9000_init_dm9000(struct net_device *dev)
 	iow(db, DM9000_GPCR, GPCR_GEP_CNTL);	/* Let GPIO0 output */
 	iow(db, DM9000_GPR, 0);	/* Enable PHY */
 
+	if (db->flags & DM9000_PLATF_EXT_PHY)
+		iow(db, DM9000_NCR, NCR_EXT_PHY);
+
 	/* Program operating register */
 	iow(db, DM9000_TCR, 0);	        /* TX Polling clear */
 	iow(db, DM9000_BPTR, 0x3f);	/* Less 3Kb, 200us */
diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h
index 0008e2a..ea530fd 100644
--- a/include/linux/dm9000.h
+++ b/include/linux/dm9000.h
@@ -19,6 +19,7 @@
 #define DM9000_PLATF_8BITONLY	(0x0001)
 #define DM9000_PLATF_16BITONLY	(0x0002)
 #define DM9000_PLATF_32BITONLY	(0x0004)
+#define DM9000_PLATF_EXT_PHY	(0x0008)
 
 /* platfrom data for platfrom device structure's platfrom_data field */
 
-- 
1.5.0

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussée de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] [DM9000] External PHY support
  2007-08-16  8:16 [PATCH 2/2] [DM9000] External PHY support Laurent Pinchart
@ 2007-08-16 17:00 ` Ben Dooks
  0 siblings, 0 replies; 2+ messages in thread
From: Ben Dooks @ 2007-08-16 17:00 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: netdev, Ben Dooks

On Thu, Aug 16, 2007 at 10:16:08AM +0200, Laurent Pinchart wrote:
> This patch adds a flag to the DM9000 platform data which, when set,
> configures the device to use an external PHY.
> 
> Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
> ---
>  drivers/net/dm9000.c   |    6 ++++++
>  include/linux/dm9000.h |    1 +
>  2 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
> index a424810..a86984e 100644
> --- a/drivers/net/dm9000.c
> +++ b/drivers/net/dm9000.c
> @@ -136,6 +136,7 @@ typedef struct board_info {
>  	u16 dbug_cnt;
>  	u8 io_mode;		/* 0:word, 2:byte */
>  	u8 phy_addr;
> +	unsigned int flags;
>  
>  	void (*inblk)(void __iomem *port, void *data, int length);
>  	void (*outblk)(void __iomem *port, void *data, int length);
> @@ -528,6 +529,8 @@ dm9000_probe(struct platform_device *pdev)
>  
>  		if (pdata->dumpblk != NULL)
>  			db->dumpblk = pdata->dumpblk;
> +
> +		db->flags = pdata->flags;
>  	}
>  
>  	dm9000_reset(db);
> @@ -670,6 +673,9 @@ dm9000_init_dm9000(struct net_device *dev)
>  	iow(db, DM9000_GPCR, GPCR_GEP_CNTL);	/* Let GPIO0 output */
>  	iow(db, DM9000_GPR, 0);	/* Enable PHY */
>  
> +	if (db->flags & DM9000_PLATF_EXT_PHY)
> +		iow(db, DM9000_NCR, NCR_EXT_PHY);
> +
>  	/* Program operating register */
>  	iow(db, DM9000_TCR, 0);	        /* TX Polling clear */
>  	iow(db, DM9000_BPTR, 0x3f);	/* Less 3Kb, 200us */
> diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h
> index 0008e2a..ea530fd 100644
> --- a/include/linux/dm9000.h
> +++ b/include/linux/dm9000.h
> @@ -19,6 +19,7 @@
>  #define DM9000_PLATF_8BITONLY	(0x0001)
>  #define DM9000_PLATF_16BITONLY	(0x0002)
>  #define DM9000_PLATF_32BITONLY	(0x0004)
> +#define DM9000_PLATF_EXT_PHY	(0x0008)
>  
>  /* platfrom data for platfrom device structure's platfrom_data field */
>  
> -- 
> 1.5.0
> 
> -- 
> Laurent Pinchart
> CSE Semaphore Belgium
> 
> Chauss?e de Bruxelles, 732A
> B-1410 Waterloo
> Belgium
> 
> T +32 (2) 387 42 59
> F +32 (2) 387 42 75
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Ben (ben@fluff.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-16 17:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-16  8:16 [PATCH 2/2] [DM9000] External PHY support Laurent Pinchart
2007-08-16 17:00 ` Ben Dooks

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).