Message ID | 20110726010154.GG21641@S2100-06.ap.freescale.net |
---|---|
State | New |
Headers | show |
On Tue, 26 Jul 2011, Shawn Guo wrote: > On Mon, Jul 25, 2011 at 03:37:23PM -0600, Grant Likely wrote: > > On Mon, Jul 25, 2011 at 05:44:00PM +0800, Shawn Guo wrote: > > > It adds device tree probe support for smsc911x driver. > > > > > > Signed-off-by: Shawn Guo <shawn.guo@linaro.org> > > > Cc: Grant Likely <grant.likely@secretlab.ca> > > > Cc: Steve Glendinning <steve.glendinning@smsc.com> > > > Cc: David S. Miller <davem@davemloft.net> > > > --- > > > Documentation/devicetree/bindings/net/smsc.txt | 34 +++++++ > > > drivers/net/smsc911x.c | 123 +++++++++++++++++++----- > > > 2 files changed, 132 insertions(+), 25 deletions(-) > > > create mode 100644 Documentation/devicetree/bindings/net/smsc.txt > > > > > > diff --git a/Documentation/devicetree/bindings/net/smsc.txt b/Documentation/devicetree/bindings/net/smsc.txt > > > new file mode 100644 > > > index 0000000..1920695 > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/net/smsc.txt > > > @@ -0,0 +1,34 @@ > > > +* Smart Mixed-Signal Connectivity (SMSC) LAN Controller > > > + > > > +Required properties: > > > +- compatible : Should be "smsc,lan<model>""smsc,lan" > > > > Drop "smsc,lan". That's far too generic. > > > The following devices are supported by the driver. > > LAN9115, LAN9116, LAN9117, LAN9118 > LAN9215, LAN9216, LAN9217, LAN9218 > LAN9210, LAN9211 > LAN9220, LAN9221 > > If we only keep specific <model> as the compatible, we will have a > long match table which is actually used nowhere to distinguish the > device. > > So we need some level generic compatible to save the meaningless > long match table. What about: > > static const struct of_device_id smsc_dt_ids[] = { > { .compatible = "smsc,lan9", }, > { /* sentinel */ } > }; > > Or: > > static const struct of_device_id smsc_dt_ids[] = { > { .compatible = "smsc,lan91", }, > { .compatible = "smsc,lan92", }, > { /* sentinel */ } > }; None of this unambiguously distinguish the devices supported by this driver and the smc91x driver which supports LAN91C92, LAN91C94, LAN91C95, LAN91C96, LAN91C100, LAN91C110. Nicolas
On Mon, Jul 25, 2011 at 09:16:40PM -0400, Nicolas Pitre wrote: > On Tue, 26 Jul 2011, Shawn Guo wrote: > > > On Mon, Jul 25, 2011 at 03:37:23PM -0600, Grant Likely wrote: > > > On Mon, Jul 25, 2011 at 05:44:00PM +0800, Shawn Guo wrote: > > > > It adds device tree probe support for smsc911x driver. > > > > > > > > Signed-off-by: Shawn Guo <shawn.guo@linaro.org> > > > > Cc: Grant Likely <grant.likely@secretlab.ca> > > > > Cc: Steve Glendinning <steve.glendinning@smsc.com> > > > > Cc: David S. Miller <davem@davemloft.net> > > > > --- > > > > Documentation/devicetree/bindings/net/smsc.txt | 34 +++++++ > > > > drivers/net/smsc911x.c | 123 +++++++++++++++++++----- > > > > 2 files changed, 132 insertions(+), 25 deletions(-) > > > > create mode 100644 Documentation/devicetree/bindings/net/smsc.txt > > > > > > > > diff --git a/Documentation/devicetree/bindings/net/smsc.txt b/Documentation/devicetree/bindings/net/smsc.txt > > > > new file mode 100644 > > > > index 0000000..1920695 > > > > --- /dev/null > > > > +++ b/Documentation/devicetree/bindings/net/smsc.txt > > > > @@ -0,0 +1,34 @@ > > > > +* Smart Mixed-Signal Connectivity (SMSC) LAN Controller > > > > + > > > > +Required properties: > > > > +- compatible : Should be "smsc,lan<model>""smsc,lan" > > > > > > Drop "smsc,lan". That's far too generic. > > > > > The following devices are supported by the driver. > > > > LAN9115, LAN9116, LAN9117, LAN9118 > > LAN9215, LAN9216, LAN9217, LAN9218 > > LAN9210, LAN9211 > > LAN9220, LAN9221 > > > > If we only keep specific <model> as the compatible, we will have a > > long match table which is actually used nowhere to distinguish the > > device. > > > > So we need some level generic compatible to save the meaningless > > long match table. What about: > > > > static const struct of_device_id smsc_dt_ids[] = { > > { .compatible = "smsc,lan9", }, > > { /* sentinel */ } > > }; > > > > Or: > > > > static const struct of_device_id smsc_dt_ids[] = { > > { .compatible = "smsc,lan91", }, > > { .compatible = "smsc,lan92", }, > > { /* sentinel */ } > > }; > > None of this unambiguously distinguish the devices supported by this > driver and the smc91x driver which supports LAN91C92, LAN91C94, > LAN91C95, LAN91C96, LAN91C100, LAN91C110. > So you suggest to make a long list to explicitly tell the device type that the driver supports?
On Tue, 26 Jul 2011, Shawn Guo wrote: > On Mon, Jul 25, 2011 at 09:16:40PM -0400, Nicolas Pitre wrote: > > On Tue, 26 Jul 2011, Shawn Guo wrote: > > > > > On Mon, Jul 25, 2011 at 03:37:23PM -0600, Grant Likely wrote: > > > > On Mon, Jul 25, 2011 at 05:44:00PM +0800, Shawn Guo wrote: > > > > > It adds device tree probe support for smsc911x driver. > > > > > > > > > > Signed-off-by: Shawn Guo <shawn.guo@linaro.org> > > > > > Cc: Grant Likely <grant.likely@secretlab.ca> > > > > > Cc: Steve Glendinning <steve.glendinning@smsc.com> > > > > > Cc: David S. Miller <davem@davemloft.net> > > > > > --- > > > > > Documentation/devicetree/bindings/net/smsc.txt | 34 +++++++ > > > > > drivers/net/smsc911x.c | 123 +++++++++++++++++++----- > > > > > 2 files changed, 132 insertions(+), 25 deletions(-) > > > > > create mode 100644 Documentation/devicetree/bindings/net/smsc.txt > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/net/smsc.txt b/Documentation/devicetree/bindings/net/smsc.txt > > > > > new file mode 100644 > > > > > index 0000000..1920695 > > > > > --- /dev/null > > > > > +++ b/Documentation/devicetree/bindings/net/smsc.txt > > > > > @@ -0,0 +1,34 @@ > > > > > +* Smart Mixed-Signal Connectivity (SMSC) LAN Controller > > > > > + > > > > > +Required properties: > > > > > +- compatible : Should be "smsc,lan<model>""smsc,lan" > > > > > > > > Drop "smsc,lan". That's far too generic. > > > > > > > The following devices are supported by the driver. > > > > > > LAN9115, LAN9116, LAN9117, LAN9118 > > > LAN9215, LAN9216, LAN9217, LAN9218 > > > LAN9210, LAN9211 > > > LAN9220, LAN9221 > > > > > > If we only keep specific <model> as the compatible, we will have a > > > long match table which is actually used nowhere to distinguish the > > > device. > > > > > > So we need some level generic compatible to save the meaningless > > > long match table. What about: > > > > > > static const struct of_device_id smsc_dt_ids[] = { > > > { .compatible = "smsc,lan9", }, > > > { /* sentinel */ } > > > }; > > > > > > Or: > > > > > > static const struct of_device_id smsc_dt_ids[] = { > > > { .compatible = "smsc,lan91", }, > > > { .compatible = "smsc,lan92", }, > > > { /* sentinel */ } > > > }; > > > > None of this unambiguously distinguish the devices supported by this > > driver and the smc91x driver which supports LAN91C92, LAN91C94, > > LAN91C95, LAN91C96, LAN91C100, LAN91C110. > > > So you suggest to make a long list to explicitly tell the device type > that the driver supports? I'm not suggesting anything. :-) I'm merely pointing out that the above .compatible = "smsc,lan9" or .compatible = "smsc,lan91" are too generic given that there is another driver with different devices to which they could also apply. Nicolas
On Mon, Jul 25, 2011 at 10:28:05PM -0400, Nicolas Pitre wrote: > On Tue, 26 Jul 2011, Shawn Guo wrote: > > > On Mon, Jul 25, 2011 at 09:16:40PM -0400, Nicolas Pitre wrote: > > > On Tue, 26 Jul 2011, Shawn Guo wrote: > > > > > > > On Mon, Jul 25, 2011 at 03:37:23PM -0600, Grant Likely wrote: > > > > > On Mon, Jul 25, 2011 at 05:44:00PM +0800, Shawn Guo wrote: > > > > > > It adds device tree probe support for smsc911x driver. > > > > > > > > > > > > Signed-off-by: Shawn Guo <shawn.guo@linaro.org> > > > > > > Cc: Grant Likely <grant.likely@secretlab.ca> > > > > > > Cc: Steve Glendinning <steve.glendinning@smsc.com> > > > > > > Cc: David S. Miller <davem@davemloft.net> > > > > > > --- > > > > > > Documentation/devicetree/bindings/net/smsc.txt | 34 +++++++ > > > > > > drivers/net/smsc911x.c | 123 +++++++++++++++++++----- > > > > > > 2 files changed, 132 insertions(+), 25 deletions(-) > > > > > > create mode 100644 Documentation/devicetree/bindings/net/smsc.txt > > > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/net/smsc.txt b/Documentation/devicetree/bindings/net/smsc.txt > > > > > > new file mode 100644 > > > > > > index 0000000..1920695 > > > > > > --- /dev/null > > > > > > +++ b/Documentation/devicetree/bindings/net/smsc.txt > > > > > > @@ -0,0 +1,34 @@ > > > > > > +* Smart Mixed-Signal Connectivity (SMSC) LAN Controller > > > > > > + > > > > > > +Required properties: > > > > > > +- compatible : Should be "smsc,lan<model>""smsc,lan" > > > > > > > > > > Drop "smsc,lan". That's far too generic. > > > > > > > > > The following devices are supported by the driver. > > > > > > > > LAN9115, LAN9116, LAN9117, LAN9118 > > > > LAN9215, LAN9216, LAN9217, LAN9218 > > > > LAN9210, LAN9211 > > > > LAN9220, LAN9221 > > > > > > > > If we only keep specific <model> as the compatible, we will have a > > > > long match table which is actually used nowhere to distinguish the > > > > device. > > > > > > > > So we need some level generic compatible to save the meaningless > > > > long match table. What about: > > > > > > > > static const struct of_device_id smsc_dt_ids[] = { > > > > { .compatible = "smsc,lan9", }, > > > > { /* sentinel */ } > > > > }; > > > > > > > > Or: > > > > > > > > static const struct of_device_id smsc_dt_ids[] = { > > > > { .compatible = "smsc,lan91", }, > > > > { .compatible = "smsc,lan92", }, > > > > { /* sentinel */ } > > > > }; > > > > > > None of this unambiguously distinguish the devices supported by this > > > driver and the smc91x driver which supports LAN91C92, LAN91C94, > > > LAN91C95, LAN91C96, LAN91C100, LAN91C110. > > > > > So you suggest to make a long list to explicitly tell the device type > > that the driver supports? > > I'm not suggesting anything. :-) I'm merely pointing out that the > above .compatible = "smsc,lan9" or .compatible = "smsc,lan91" are too > generic given that there is another driver with different devices to > which they could also apply. > Since I do not get any suggestion here, I'm going to follow the driver name to use '911' as the model number. Please tell me if there is any better one.
On Tue, Jul 26, 2011 at 09:30:26AM +0800, Shawn Guo wrote: > On Mon, Jul 25, 2011 at 09:16:40PM -0400, Nicolas Pitre wrote: > > On Tue, 26 Jul 2011, Shawn Guo wrote: > > > > > On Mon, Jul 25, 2011 at 03:37:23PM -0600, Grant Likely wrote: > > > > On Mon, Jul 25, 2011 at 05:44:00PM +0800, Shawn Guo wrote: > > > > > It adds device tree probe support for smsc911x driver. > > > > > > > > > > Signed-off-by: Shawn Guo <shawn.guo@linaro.org> > > > > > Cc: Grant Likely <grant.likely@secretlab.ca> > > > > > Cc: Steve Glendinning <steve.glendinning@smsc.com> > > > > > Cc: David S. Miller <davem@davemloft.net> > > > > > --- > > > > > Documentation/devicetree/bindings/net/smsc.txt | 34 +++++++ > > > > > drivers/net/smsc911x.c | 123 +++++++++++++++++++----- > > > > > 2 files changed, 132 insertions(+), 25 deletions(-) > > > > > create mode 100644 Documentation/devicetree/bindings/net/smsc.txt > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/net/smsc.txt b/Documentation/devicetree/bindings/net/smsc.txt > > > > > new file mode 100644 > > > > > index 0000000..1920695 > > > > > --- /dev/null > > > > > +++ b/Documentation/devicetree/bindings/net/smsc.txt > > > > > @@ -0,0 +1,34 @@ > > > > > +* Smart Mixed-Signal Connectivity (SMSC) LAN Controller > > > > > + > > > > > +Required properties: > > > > > +- compatible : Should be "smsc,lan<model>""smsc,lan" > > > > > > > > Drop "smsc,lan". That's far too generic. > > > > > > > The following devices are supported by the driver. > > > > > > LAN9115, LAN9116, LAN9117, LAN9118 > > > LAN9215, LAN9216, LAN9217, LAN9218 > > > LAN9210, LAN9211 > > > LAN9220, LAN9221 > > > > > > If we only keep specific <model> as the compatible, we will have a > > > long match table which is actually used nowhere to distinguish the > > > device. > > > > > > So we need some level generic compatible to save the meaningless > > > long match table. What about: > > > > > > static const struct of_device_id smsc_dt_ids[] = { > > > { .compatible = "smsc,lan9", }, > > > { /* sentinel */ } > > > }; > > > > > > Or: > > > > > > static const struct of_device_id smsc_dt_ids[] = { > > > { .compatible = "smsc,lan91", }, > > > { .compatible = "smsc,lan92", }, > > > { /* sentinel */ } > > > }; > > > > None of this unambiguously distinguish the devices supported by this > > driver and the smc91x driver which supports LAN91C92, LAN91C94, > > LAN91C95, LAN91C96, LAN91C100, LAN91C110. > > > So you suggest to make a long list to explicitly tell the device type > that the driver supports? If newer devices are 100% backwards compatible with an older device, then the newer device doesn't need to appear in this list because the device node can claim compatibility. If it isn't backwards compatible, then you do need an entry in this list. g.
On Fri, Jul 29, 2011 at 10:36:26AM +0800, Shawn Guo wrote: > On Mon, Jul 25, 2011 at 10:28:05PM -0400, Nicolas Pitre wrote: > > On Tue, 26 Jul 2011, Shawn Guo wrote: > > > > > On Mon, Jul 25, 2011 at 09:16:40PM -0400, Nicolas Pitre wrote: > > > > On Tue, 26 Jul 2011, Shawn Guo wrote: > > > > > > > > > On Mon, Jul 25, 2011 at 03:37:23PM -0600, Grant Likely wrote: > > > > > > On Mon, Jul 25, 2011 at 05:44:00PM +0800, Shawn Guo wrote: > > > > > > > It adds device tree probe support for smsc911x driver. > > > > > > > > > > > > > > Signed-off-by: Shawn Guo <shawn.guo@linaro.org> > > > > > > > Cc: Grant Likely <grant.likely@secretlab.ca> > > > > > > > Cc: Steve Glendinning <steve.glendinning@smsc.com> > > > > > > > Cc: David S. Miller <davem@davemloft.net> > > > > > > > --- > > > > > > > Documentation/devicetree/bindings/net/smsc.txt | 34 +++++++ > > > > > > > drivers/net/smsc911x.c | 123 +++++++++++++++++++----- > > > > > > > 2 files changed, 132 insertions(+), 25 deletions(-) > > > > > > > create mode 100644 Documentation/devicetree/bindings/net/smsc.txt > > > > > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/net/smsc.txt b/Documentation/devicetree/bindings/net/smsc.txt > > > > > > > new file mode 100644 > > > > > > > index 0000000..1920695 > > > > > > > --- /dev/null > > > > > > > +++ b/Documentation/devicetree/bindings/net/smsc.txt > > > > > > > @@ -0,0 +1,34 @@ > > > > > > > +* Smart Mixed-Signal Connectivity (SMSC) LAN Controller > > > > > > > + > > > > > > > +Required properties: > > > > > > > +- compatible : Should be "smsc,lan<model>""smsc,lan" > > > > > > > > > > > > Drop "smsc,lan". That's far too generic. > > > > > > > > > > > The following devices are supported by the driver. > > > > > > > > > > LAN9115, LAN9116, LAN9117, LAN9118 > > > > > LAN9215, LAN9216, LAN9217, LAN9218 > > > > > LAN9210, LAN9211 > > > > > LAN9220, LAN9221 > > > > > > > > > > If we only keep specific <model> as the compatible, we will have a > > > > > long match table which is actually used nowhere to distinguish the > > > > > device. > > > > > > > > > > So we need some level generic compatible to save the meaningless > > > > > long match table. What about: > > > > > > > > > > static const struct of_device_id smsc_dt_ids[] = { > > > > > { .compatible = "smsc,lan9", }, > > > > > { /* sentinel */ } > > > > > }; > > > > > > > > > > Or: > > > > > > > > > > static const struct of_device_id smsc_dt_ids[] = { > > > > > { .compatible = "smsc,lan91", }, > > > > > { .compatible = "smsc,lan92", }, > > > > > { /* sentinel */ } > > > > > }; > > > > > > > > None of this unambiguously distinguish the devices supported by this > > > > driver and the smc91x driver which supports LAN91C92, LAN91C94, > > > > LAN91C95, LAN91C96, LAN91C100, LAN91C110. > > > > > > > So you suggest to make a long list to explicitly tell the device type > > > that the driver supports? > > > > I'm not suggesting anything. :-) I'm merely pointing out that the > > above .compatible = "smsc,lan9" or .compatible = "smsc,lan91" are too > > generic given that there is another driver with different devices to > > which they could also apply. > > > Since I do not get any suggestion here, I'm going to follow the driver > name to use '911' as the model number. Please tell me if there is any > better one. What is the manufacturer part name? lan9111 or lan91c11? The manufacturer's documented part number is almost always preferred. g.
On Fri, Jul 29, 2011 at 09:47:23AM -0600, Grant Likely wrote: > On Fri, Jul 29, 2011 at 10:36:26AM +0800, Shawn Guo wrote: > > On Mon, Jul 25, 2011 at 10:28:05PM -0400, Nicolas Pitre wrote: > > > On Tue, 26 Jul 2011, Shawn Guo wrote: > > > > > > > On Mon, Jul 25, 2011 at 09:16:40PM -0400, Nicolas Pitre wrote: > > > > > On Tue, 26 Jul 2011, Shawn Guo wrote: > > > > > > > > > > > On Mon, Jul 25, 2011 at 03:37:23PM -0600, Grant Likely wrote: > > > > > > > On Mon, Jul 25, 2011 at 05:44:00PM +0800, Shawn Guo wrote: > > > > > > > > It adds device tree probe support for smsc911x driver. > > > > > > > > > > > > > > > > Signed-off-by: Shawn Guo <shawn.guo@linaro.org> > > > > > > > > Cc: Grant Likely <grant.likely@secretlab.ca> > > > > > > > > Cc: Steve Glendinning <steve.glendinning@smsc.com> > > > > > > > > Cc: David S. Miller <davem@davemloft.net> > > > > > > > > --- > > > > > > > > Documentation/devicetree/bindings/net/smsc.txt | 34 +++++++ > > > > > > > > drivers/net/smsc911x.c | 123 +++++++++++++++++++----- > > > > > > > > 2 files changed, 132 insertions(+), 25 deletions(-) > > > > > > > > create mode 100644 Documentation/devicetree/bindings/net/smsc.txt > > > > > > > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/net/smsc.txt b/Documentation/devicetree/bindings/net/smsc.txt > > > > > > > > new file mode 100644 > > > > > > > > index 0000000..1920695 > > > > > > > > --- /dev/null > > > > > > > > +++ b/Documentation/devicetree/bindings/net/smsc.txt > > > > > > > > @@ -0,0 +1,34 @@ > > > > > > > > +* Smart Mixed-Signal Connectivity (SMSC) LAN Controller > > > > > > > > + > > > > > > > > +Required properties: > > > > > > > > +- compatible : Should be "smsc,lan<model>""smsc,lan" > > > > > > > > > > > > > > Drop "smsc,lan". That's far too generic. > > > > > > > > > > > > > The following devices are supported by the driver. > > > > > > > > > > > > LAN9115, LAN9116, LAN9117, LAN9118 > > > > > > LAN9215, LAN9216, LAN9217, LAN9218 > > > > > > LAN9210, LAN9211 > > > > > > LAN9220, LAN9221 > > > > > > > > > > > > If we only keep specific <model> as the compatible, we will have a > > > > > > long match table which is actually used nowhere to distinguish the > > > > > > device. > > > > > > > > > > > > So we need some level generic compatible to save the meaningless > > > > > > long match table. What about: > > > > > > > > > > > > static const struct of_device_id smsc_dt_ids[] = { > > > > > > { .compatible = "smsc,lan9", }, > > > > > > { /* sentinel */ } > > > > > > }; > > > > > > > > > > > > Or: > > > > > > > > > > > > static const struct of_device_id smsc_dt_ids[] = { > > > > > > { .compatible = "smsc,lan91", }, > > > > > > { .compatible = "smsc,lan92", }, > > > > > > { /* sentinel */ } > > > > > > }; > > > > > > > > > > None of this unambiguously distinguish the devices supported by this > > > > > driver and the smc91x driver which supports LAN91C92, LAN91C94, > > > > > LAN91C95, LAN91C96, LAN91C100, LAN91C110. > > > > > > > > > So you suggest to make a long list to explicitly tell the device type > > > > that the driver supports? > > > > > > I'm not suggesting anything. :-) I'm merely pointing out that the > > > above .compatible = "smsc,lan9" or .compatible = "smsc,lan91" are too > > > generic given that there is another driver with different devices to > > > which they could also apply. > > > > > Since I do not get any suggestion here, I'm going to follow the driver > > name to use '911' as the model number. Please tell me if there is any > > better one. > > What is the manufacturer part name? lan9111 or lan91c11? The > manufacturer's documented part number is almost always preferred. > I just posted the v2 of the patch, and chose to use 'smsc,lan9115' which is the first model supported in the driver. This is the same approach I used with i.mx device bindings.
On Sat, Jul 30, 2011 at 12:03:44AM +0800, Shawn Guo wrote: > On Fri, Jul 29, 2011 at 09:47:23AM -0600, Grant Likely wrote: > > On Fri, Jul 29, 2011 at 10:36:26AM +0800, Shawn Guo wrote: > > > Since I do not get any suggestion here, I'm going to follow the driver > > > name to use '911' as the model number. Please tell me if there is any > > > better one. > > > > What is the manufacturer part name? lan9111 or lan91c11? The > > manufacturer's documented part number is almost always preferred. > > > I just posted the v2 of the patch, and chose to use 'smsc,lan9115' > which is the first model supported in the driver. This is the same > approach I used with i.mx device bindings. You haven't answered the question. g.
On Fri, Jul 29, 2011 at 10:26:29AM -0600, Grant Likely wrote: > On Sat, Jul 30, 2011 at 12:03:44AM +0800, Shawn Guo wrote: > > On Fri, Jul 29, 2011 at 09:47:23AM -0600, Grant Likely wrote: > > > On Fri, Jul 29, 2011 at 10:36:26AM +0800, Shawn Guo wrote: > > > > Since I do not get any suggestion here, I'm going to follow the driver > > > > name to use '911' as the model number. Please tell me if there is any > > > > better one. > > > > > > What is the manufacturer part name? lan9111 or lan91c11? The > > > manufacturer's documented part number is almost always preferred. > > > > > I just posted the v2 of the patch, and chose to use 'smsc,lan9115' > > which is the first model supported in the driver. This is the same > > approach I used with i.mx device bindings. > > You haven't answered the question. > For 9115 example, the part number in data sheet is "LAN9115".
On Sat, Jul 30, 2011 at 01:13:15AM +0800, Shawn Guo wrote: > On Fri, Jul 29, 2011 at 10:26:29AM -0600, Grant Likely wrote: > > On Sat, Jul 30, 2011 at 12:03:44AM +0800, Shawn Guo wrote: > > > On Fri, Jul 29, 2011 at 09:47:23AM -0600, Grant Likely wrote: > > > > On Fri, Jul 29, 2011 at 10:36:26AM +0800, Shawn Guo wrote: > > > > > Since I do not get any suggestion here, I'm going to follow the driver > > > > > name to use '911' as the model number. Please tell me if there is any > > > > > better one. > > > > > > > > What is the manufacturer part name? lan9111 or lan91c11? The > > > > manufacturer's documented part number is almost always preferred. > > > > > > > I just posted the v2 of the patch, and chose to use 'smsc,lan9115' > > > which is the first model supported in the driver. This is the same > > > approach I used with i.mx device bindings. > > > > You haven't answered the question. > > > For 9115 example, the part number in data sheet is "LAN9115". Okay, good. Thanks. g.
diff --git a/arch/arm/boot/dts/imx53-ard.dts b/arch/arm/boot/dts/imx53-ard.dts index 6a007f1..0b17af8 100644 --- a/arch/arm/boot/dts/imx53-ard.dts +++ b/arch/arm/boot/dts/imx53-ard.dts @@ -320,7 +320,8 @@ compatible = "smsc,lan9220", "smsc,lan"; reg = <0xf4000000 0x2000000>; phy-mode = "mii"; - smsc-int-gpios = <&gpio1 31 0>; /* GPIO2_31 */ + interrupt-parent = <&gpio1>; + interrupts = <31>; smsc,irq-push-pull; smsc,access-in-32bit; }; diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi index 746221c..224f67f 100644 --- a/arch/arm/boot/dts/imx53.dtsi +++ b/arch/arm/boot/dts/imx53.dtsi @@ -89,6 +89,8 @@ interrupts = <50 51>; gpio-controller; #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <1>; }; gpio1: gpio@53f88000 { /* GPIO2 */ @@ -97,6 +99,8 @@ interrupts = <52 53>; gpio-controller; #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <1>; }; gpio2: gpio@53f8c000 { /* GPIO3 */ @@ -105,6 +109,8 @@ interrupts = <54 55>; gpio-controller; #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <1>; }; gpio3: gpio@53f90000 { /* GPIO4 */ @@ -113,6 +119,8 @@ interrupts = <56 57>; gpio-controller; #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <1>; }; wdt@53f98000 { /* WDOG1 */ @@ -950,6 +958,8 @@ interrupts = <103 104>; gpio-controller; #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <1>; }; gpio5: gpio@53fe0000 { /* GPIO6 */ @@ -958,6 +968,8 @@ interrupts = <105 106>; gpio-controller; #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <1>; }; gpio6: gpio@53fe4000 { /* GPIO7 */ @@ -966,6 +978,8 @@ interrupts = <107 108>; gpio-controller; #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <1>; }; i2c@53fec000 { /* I2C3 */ diff --git a/arch/arm/mach-mx5/imx53-dt.c b/arch/arm/mach-mx5/imx53-dt.c index ac06f04..04dc1ab 100644 --- a/arch/arm/mach-mx5/imx53-dt.c +++ b/arch/arm/mach-mx5/imx53-dt.c @@ -51,6 +51,11 @@ static const struct of_device_id imx53_tzic_of_match[] __initconst = { { /* sentinel */ } }; +static const struct of_device_id imx53_gpio_of_match[] __initconst = { + { .compatible = "fsl,imx53-gpio", }, + { /* sentinel */ } +}; + static const struct of_device_id imx53_iomuxc_of_match[] __initconst = { { .compatible = "fsl,imx53-iomuxc", }, { /* sentinel */ } @@ -90,12 +95,28 @@ static void __init imx53_ard_eim_config(void) static void __init imx53_dt_init(void) { + int gpio_irq = MXC_INTERNAL_IRQS + ARCH_NR_GPIOS; + if (of_machine_is_compatible("fsl,imx53-ard")) imx53_ard_eim_config(); mxc_iomuxc_dt_init(imx53_iomuxc_of_match); irq_domain_generate_simple(imx53_tzic_of_match, MX53_TZIC_BASE_ADDR, 0); + gpio_irq -= 32; + irq_domain_generate_simple(imx53_gpio_of_match, MX53_GPIO1_BASE_ADDR, gpio_irq); + gpio_irq -= 32; + irq_domain_generate_simple(imx53_gpio_of_match, MX53_GPIO2_BASE_ADDR, gpio_irq); + gpio_irq -= 32; + irq_domain_generate_simple(imx53_gpio_of_match, MX53_GPIO3_BASE_ADDR, gpio_irq); + gpio_irq -= 32; + irq_domain_generate_simple(imx53_gpio_of_match, MX53_GPIO4_BASE_ADDR, gpio_irq); + gpio_irq -= 32; + irq_domain_generate_simple(imx53_gpio_of_match, MX53_GPIO5_BASE_ADDR, gpio_irq); + gpio_irq -= 32; + irq_domain_generate_simple(imx53_gpio_of_match, MX53_GPIO6_BASE_ADDR, gpio_irq); + gpio_irq -= 32; + irq_domain_generate_simple(imx53_gpio_of_match, MX53_GPIO7_BASE_ADDR, gpio_irq); of_platform_populate(NULL, of_default_bus_match_table, imx53_auxdata_lookup, NULL); diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c index 0097048..6dd025e 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c @@ -2187,25 +2187,10 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) pdata = netdev_priv(dev); - if (np) { - irq_gpio = of_get_named_gpio(np, "smsc-int-gpios", 0); - retval = gpio_request_one(irq_gpio, GPIOF_IN, "smsc-int-gpio"); - if (!retval) - dev->irq = gpio_to_irq(irq_gpio); - } else { - irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (irq_res) { - dev->irq = irq_res->start; - irq_flags = irq_res->flags & IRQF_TRIGGER_MASK; - } else { - retval = -ENODEV; - } - } - - if (retval) { - SMSC_WARN(pdata, probe, "Error smsc911x irq not found"); - retval = -EINVAL; - goto out_free_netdev_2; + irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); + if (irq_res) { + dev->irq = irq_res->start; + irq_flags = irq_res->flags & IRQF_TRIGGER_MASK; } pdata->ioaddr = ioremap_nocache(res->start, res_size);