Re: [PATCH] phylib: make mdio-gpio work without OF (v2)

2008-11-05 Thread David Brownell
On Wednesday 05 November 2008, Grant Likely wrote: > >  Maybe the best solution is > > to write separate driver for OF which will be just wrapper for platform > > driver... Just like you suggested. I'd certainly prefer that: packaging all the OF glue in a small bit of OF glue code, which does

Re: [PATCH] phylib: make mdio-gpio work without OF (v2)

2008-11-05 Thread David Brownell
On Wednesday 05 November 2008, Marc Pignat wrote: > This is why I proposed to split the driver in two parts (gpio only mdio > driver + OF platform device). Just treating OF GPIO as any other GPIO. I think that's overall a much cleaner approach too. Keeps OF's hardware abstraction layer out of dri

Re: [PATCH] phylib: make mdio-gpio work without OF (v2)

2008-11-05 Thread Grant Likely
On Wed, Nov 5, 2008 at 1:57 AM, Paulius Zaleckas <[EMAIL PROTECTED]> wrote: > Mike Frysinger wrote: >> On Wed, Nov 5, 2008 at 03:11, David Brownell wrote: >>> On Tuesday 04 November 2008, Mike Frysinger wrote: > If indeed OF functions don't have declarations which are > available on all pla

Re: [PATCH] phylib: make mdio-gpio work without OF (v2)

2008-11-05 Thread Paulius Zaleckas
Paulius Zaleckas wrote: > Mike Frysinger wrote: >> On Wed, Nov 5, 2008 at 03:11, David Brownell wrote: >>> On Tuesday 04 November 2008, Mike Frysinger wrote: > If indeed OF functions don't have declarations which are > available on all platforms, that might be worth fixing > to enable t

Re: [PATCH] phylib: make mdio-gpio work without OF (v2)

2008-11-05 Thread Paulius Zaleckas
Mike Frysinger wrote: > On Wed, Nov 5, 2008 at 03:11, David Brownell wrote: >> On Tuesday 04 November 2008, Mike Frysinger wrote: If indeed OF functions don't have declarations which are available on all platforms, that might be worth fixing to enable this approach to #ifdef eliminat

Re: [PATCH] phylib: make mdio-gpio work without OF (v2)

2008-11-05 Thread Marc Pignat
On Wednesday 05 November 2008, Mike Frysinger wrote: ... > i understand the compiler side just fine. my point is that the > current linux/of_gpio.h only defines the OF structure and related > prototypes when CONFIG_OF_GPIO is defined. so it needs updating > first. This is why I proposed to spli

Re: [PATCH] phylib: make mdio-gpio work without OF (v2)

2008-11-05 Thread Mike Frysinger
On Wed, Nov 5, 2008 at 03:11, David Brownell wrote: > On Tuesday 04 November 2008, Mike Frysinger wrote: >> > If indeed OF functions don't have declarations which are >> > available on all platforms, that might be worth fixing >> > to enable this approach to #ifdef elimination. >> >> OF is open fir

Re: [PATCH] phylib: make mdio-gpio work without OF (v2)

2008-11-05 Thread David Brownell
On Tuesday 04 November 2008, Mike Frysinger wrote: > > If indeed OF functions don't have declarations which are > > available on all platforms, that might be worth fixing > > to enable this approach to #ifdef elimination. > > OF is open firmware right ?  no way there's going to be OF for every > p

Re: [PATCH] phylib: make mdio-gpio work without OF (v2)

2008-11-04 Thread Mike Frysinger
On Tue, Nov 4, 2008 at 23:45, David Brownell wrote: > On Tuesday 04 November 2008, Mike Frysinger wrote: >> > That's generally the preferred way to handle #ifdeffery. >> > But I could imagine OF isn't (yet?) set up to handle it. >> >> i agree completely with the inclination to do it all in C as you

Re: [PATCH] phylib: make mdio-gpio work without OF (v2)

2008-11-04 Thread David Brownell
On Tuesday 04 November 2008, Mike Frysinger wrote: > > That's generally the preferred way to handle #ifdeffery. > > But I could imagine OF isn't (yet?) set up to handle it. > > i agree completely with the inclination to do it all in C as you've > suggested and let the compiler do dead code elimina

Re: [PATCH] phylib: make mdio-gpio work without OF (v2)

2008-11-04 Thread Mike Frysinger
On Tue, Nov 4, 2008 at 19:04, David Brownell wrote: > On Tuesday 04 November 2008, Grant Likely wrote: >> At this point, instead of #ifdeffing the function signature, I would >> much rather see this generalized as something like >> 'mdio_gpio_setup()'. Then move the OF and non-OF specific bits int

Re: [PATCH] phylib: make mdio-gpio work without OF (v2)

2008-11-04 Thread David Brownell
On Tuesday 04 November 2008, Grant Likely wrote: > At this point, instead of #ifdeffing the function signature, I would > much rather see this generalized as something like > 'mdio_gpio_setup()'.  Then move the OF and non-OF specific bits into > two new functions; mdio_ofgpio_probe() and mdio_gpio_

Re: [PATCH] phylib: make mdio-gpio work without OF (v2)

2008-11-04 Thread Grant Likely
On Tue, Nov 4, 2008 at 7:45 AM, Paulius Zaleckas <[EMAIL PROTECTED]> wrote: > make mdio-gpio work with non OpenFirmware gpio implementation. > > Aditional changes to mdio-gpio: > - use gpio_request() and gpio_free() > - place irq[] array in struct mdio_gpio_info > - add module description, author a

Re: [PATCH] phylib: make mdio-gpio work without OF (v2)

2008-11-04 Thread Grant Likely
On Tue, Nov 4, 2008 at 8:45 AM, Marc Pignat <[EMAIL PROTECTED]> wrote: > Hiü > > On Tuesday 04 November 2008, Paulius Zaleckas wrote: >> make mdio-gpio work with non OpenFirmware gpio implementation. > > of_gpio.c provides generic gpio compatible gpios. > > Why not remove all OF specific code from

Re: [PATCH] phylib: make mdio-gpio work without OF (v2)

2008-11-04 Thread Marc Pignat
Hiü On Tuesday 04 November 2008, Paulius Zaleckas wrote: > make mdio-gpio work with non OpenFirmware gpio implementation. of_gpio.c provides generic gpio compatible gpios. Why not remove all OF specific code from this file and add another one creating the struct mdio_gpio_platform_data using OF

[PATCH] phylib: make mdio-gpio work without OF (v2)

2008-11-04 Thread Paulius Zaleckas
make mdio-gpio work with non OpenFirmware gpio implementation. Aditional changes to mdio-gpio: - use gpio_request() and gpio_free() - place irq[] array in struct mdio_gpio_info - add module description, author and license - add note about compiling this driver as module - rename mdc and mdio funct