Re: Using mdio-gpio driver with smsc PHY driver (driver stacking?)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 09, 2009 at 03:44:01PM -0700, Greg KH wrote:
> On Wed, Sep 09, 2009 at 09:09:21AM -0700, Amit Uttamchandani wrote:
> > On Wed, Sep 09, 2009 at 06:44:05AM -0700, Greg KH wrote:
> > > On Wed, Sep 09, 2009 at 12:34:03AM -0700, Amit Uttamchandani wrote:
> > > >
> > > > I am interested in using mdio-gpio driver to emulate the MDIO bus over
> > > > GPIO. This is needed to control the SMSC LAN 8700 PHY. Now, there is a
> > > > driver that already exists to control the phy (smsc.c).
> > > >
> > > > How do I 'connect' the two drivers? Do I write a new driver? Or do I use
> > > > the mdio-gpio to set up the necessary pins, and then the smsc.c phy
> > > > driver (which uses MDIO already) will automatically use the mdio over
> > > > gpio.
> > >
> > > The later option sounds like a good idea, have you tried this to see if
> > > it works?
> > >
> > >
> > Thanks for the reply Greg.
> >
> > I haven't tried the latter option as I am not too sure how this is done.
> > I am thinking right now I have to load the driver (mdio-gpio) first. But
> > then after this I'm lost. Where do I configure which GPIO pins to use?
> > There must be some userspace app/config to do that correct?
> 
> Yes, you can do this from userspace through sysfs.  Look at
> Documentation/gpio.txt
> 

Thanks.

I was able to toggle LEDs using the userspace method.

Now, I was able to figure out how to load the mdio-gpio driver. lsmod
shows that it is loaded and loads mdio-bitbang as well because of
dependency. At this point, I do not know which pins are associated with
this mdio-gpio driver.

 1. /sys/bus/mdio_bus - Is loaded properly and contains drivers for the
 MDIO based PHYs.

 2. /sys/module/mdio_gpio/drivers/mdio-gpio - Has a 'bind' file. I guess
 I have to bind this driver to some device (the gpio device?).

 3. Doing a search for mdio* under the root directory reveals the
 following:

 ./sys/bus/platform/drivers/mdio-gpio
 ./sys/bus/mdio_bus
 ./sys/class/mdio_bus
 ./sys/module/smsc/drivers/mdio_bus:SMSC LAN83C185
 ./sys/module/smsc/drivers/mdio_bus:SMSC LAN8187
 ./sys/module/smsc/drivers/mdio_bus:SMSC LAN8700
 ./sys/module/smsc/drivers/mdio_bus:SMSC LAN911x Internal PHY
 ./sys/module/mdio_bitbang
 ./sys/module/mdio_bitbang/holders/mdio_gpio
 ./sys/module/mdio_gpio

Any ideas on how to do this?

Thanks for any help.

Amit

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux