vlynq: probe for an external clock first, needed to enable acx on the Leonardo board
authorMatteo Croce <rootkit85@yahoo.it>
Wed, 2 Apr 2008 11:06:50 +0000 (11:06 +0000)
committerMatteo Croce <rootkit85@yahoo.it>
Wed, 2 Apr 2008 11:06:50 +0000 (11:06 +0000)
SVN-Revision: 10707

target/linux/ar7/files/drivers/vlynq/vlynq.c

index 374562c6cdc6d0c0da4d4b3c80e575b44371ec86..c2ac536ba16819095c8cf5ac5a158db7ced63346 100644 (file)
@@ -369,6 +369,14 @@ static int __vlynq_enable_device(struct vlynq_device *dev)
        if (result)
                return result;
 
+       vlynq_reg_write(dev->local->control, 0);
+       vlynq_reg_write(dev->remote->control, 0);
+       if (vlynq_linked(dev)) {
+               printk(KERN_DEBUG "%s: using external clock\n",
+                       dev->dev.bus_id);
+               return 0;
+       }
+
        switch (dev->divisor) {
        case vlynq_div_auto:
                /* Only try locally supplied clock, others cause problems */
@@ -413,15 +421,6 @@ static int __vlynq_enable_device(struct vlynq_device *dev)
                        return 0;
                }
                break;
-       case vlynq_div_external:
-               vlynq_reg_write(dev->local->control, 0);
-               vlynq_reg_write(dev->remote->control, 0);
-               if (vlynq_linked(dev)) {
-                       printk(KERN_DEBUG "%s: using external clock\n",
-                              dev->dev.bus_id);
-                       return 0;
-               }
-               break;
        }
 
        ops->off(dev);