[RFC fs_enet: Convert MII bitbang driver to use GPIO lib

Grant Likely grant.likely at secretlab.ca
Mon Apr 21 08:42:57 EST 2008


On Wed, Apr 16, 2008 at 8:40 AM, Laurent Pinchart
<laurentp at cse-semaphore.com> wrote:
> This patch converts the MII bitband driver to use GPIO lib for GPIO access.
>  The driver can now handle MDC and MDIO on different GPIO banks.
>
>  The patch depends on Anton Vorontsov GPIO lib support scheduled for 2.6.26.
>  It is by no means complete, I just would like to get some feedback on the
>  approach. I'll resubmit it when the CPM2 GPIO support patches will be
>  available in the powerpc git tree.

I agree with Anton; nice rework.  This would be useful on other
platforms too.  Comment below.

>  --- a/Documentation/powerpc/booting-without-of.txt
>  +++ b/Documentation/powerpc/booting-without-of.txt
>  @@ -2030,21 +2030,19 @@ platforms are moved over to use the flattened-device-tree model.
>     fsl,cpm2-mdio-bitbang (reg is port C registers)
>
>     Properties for fsl,cpm2-mdio-bitbang:
>  -   fsl,mdio-pin : pin of port C controlling mdio data
>  -   fsl,mdc-pin : pin of port C controlling mdio clock
>  +   gpios : GPIOs controlling mdio clock and mdio data (in that order).
>
>     Example:
>
>  -       mdio at 10d40 {
>  +       mdio {
>                 device_type = "mdio";
>                 compatible = "fsl,mpc8272ads-mdio-bitbang",
>                              "fsl,mpc8272-mdio-bitbang",
>                              "fsl,cpm2-mdio-bitbang";

I think it would be better for the defined binding to use something
like "virtual,mdio-bitbang" or "gpio-mdio".  (I like the first better,
but there is already some precedence with the "gpio-led" driver.  I
think there is less chance of namespace conflicts with the first)

Of course; the *driver* could also accept these additional compatible
values for backwards compatibility.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.



More information about the Linuxppc-dev mailing list