Browse Source

littlefury: Convert to lowl_probe

Luke Dashjr 12 years ago
parent
commit
8bbf19087b
1 changed files with 11 additions and 9 deletions
  1. 11 9
      driver-littlefury.c

+ 11 - 9
driver-littlefury.c

@@ -19,6 +19,7 @@
 #include "fpgautils.h"
 #include "fpgautils.h"
 #include "libbitfury.h"
 #include "libbitfury.h"
 #include "logging.h"
 #include "logging.h"
+#include "lowlevel.h"
 #include "miner.h"
 #include "miner.h"
 #include "spidevc.h"
 #include "spidevc.h"
 #include "util.h"
 #include "util.h"
@@ -222,6 +223,12 @@ bool littlefury_txrx(struct spi_port *port)
 	return true;
 	return true;
 }
 }
 
 
+static
+bool littlefury_lowl_match(const struct lowlevel_device_info * const info)
+{
+	return lowlevel_match_lowlproduct(info, &lowl_vcom, "LittleFury");
+}
+
 static
 static
 bool littlefury_detect_one(const char *devpath)
 bool littlefury_detect_one(const char *devpath)
 {
 {
@@ -310,15 +317,9 @@ err:
 }
 }
 
 
 static
 static
-int littlefury_detect_auto(void)
-{
-	return serial_autodetect(littlefury_detect_one, "LittleFury");
-}
-
-static
-void littlefury_detect(void)
+bool littlefury_lowl_probe(const struct lowlevel_device_info * const info)
 {
 {
-	serial_detect_auto(&littlefury_drv, littlefury_detect_one, littlefury_detect_auto);
+	return vcom_lowl_probe_wrapper(info, littlefury_detect_one);
 }
 }
 
 
 static
 static
@@ -470,7 +471,8 @@ void littlefury_reinit(struct cgpu_info * const proc)
 struct device_drv littlefury_drv = {
 struct device_drv littlefury_drv = {
 	.dname = "littlefury",
 	.dname = "littlefury",
 	.name = "LFY",
 	.name = "LFY",
-	.drv_detect = littlefury_detect,
+	.lowl_match = littlefury_lowl_match,
+	.lowl_probe = littlefury_lowl_probe,
 	
 	
 	.thread_init = littlefury_thread_init,
 	.thread_init = littlefury_thread_init,
 	.thread_disable = littlefury_disable,
 	.thread_disable = littlefury_disable,