Commit d84155c95806d45dd26140793bc99e7defef6ed2

Con Kolivas 2014-01-04T10:19:34

Set the initial spi settings for nanofury driver.

diff --git a/driver-bitfury.c b/driver-bitfury.c
index 765724f..a0b9c39 100644
--- a/driver-bitfury.c
+++ b/driver-bitfury.c
@@ -279,6 +279,7 @@ out_close:
 
 static bool nf1_detect_one(struct cgpu_info *bitfury, struct bitfury_info __maybe_unused *info)
 {
+	unsigned int bitrate, icsv, acsv, cstdd, ldbtcsd, sdbd, bpst, spimode;
 	bool ret = false;
 	int i;
 
@@ -326,6 +327,16 @@ static bool nf1_detect_one(struct cgpu_info *bitfury, struct bitfury_info __mayb
 	/* Cancel any transfers in progress */
 	if (!mcp2210_spi_cancel(bitfury))
 		goto out;
+	if (!mcp2210_get_spi_transfer_settings(bitfury, &bitrate, &icsv, &acsv, &cstdd,
+	    &ldbtcsd, &sdbd, &bpst, &spimode))
+		goto out;
+	bitrate = 200000;
+	icsv = 0xffff;
+	acsv = 0xffef;
+	cstdd = ldbtcsd = sdbd = spimode = 0;
+	if (!mcp2210_set_spi_transfer_settings(bitfury, bitrate, icsv, acsv, cstdd,
+	    ldbtcsd, sdbd, bpst, spimode))
+		goto out;
 out:
 	return ret;
 }