at45db: Use .prepare_access hook for non-power-of-2 preparations

We performed some additional preparations in probe_spi_at45db(). Turn
it into a .prepare_access hook, spi_prepare_at45db(), so we can use
a pure probing function.

Change-Id: I75570078301b9a06a229543f44714a0941457a5a
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/74895
diff --git a/flashchips.c b/flashchips.c
index 990914f..5744ad7 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -2810,7 +2810,7 @@
 		/* OTP: 128B total, 64B pre-programmed; read 0x77; write 0x9B */
 		.feature_bits	= FEATURE_OTP,
 		.tested		= TEST_OK_PREW,
-		.probe		= probe_spi_at45db,
+		.probe		= probe_spi_rdid,
 		.probe_timing	= TIMING_ZERO,
 		.block_erasers	=
 		{
@@ -2838,6 +2838,7 @@
 		.write		= spi_write_at45db,
 		.read		= spi_read_at45db, /* Fast read (0x0B) supported */
 		.voltage	= {2700, 3600},
+		.prepare_access	= spi_prepare_at45db,
 	},
 
 	{
@@ -2852,7 +2853,7 @@
 		/* OTP: 128B total, 64B pre-programmed; read 0x77; write 0x9B */
 		.feature_bits	= FEATURE_OTP,
 		.tested		= TEST_OK_PREW,
-		.probe		= probe_spi_at45db,
+		.probe		= probe_spi_rdid,
 		.probe_timing	= TIMING_ZERO,
 		.block_erasers	=
 		{
@@ -2880,6 +2881,7 @@
 		.write		= spi_write_at45db,
 		.read		= spi_read_at45db, /* Fast read (0x0B) supported */
 		.voltage	= {2700, 3600},
+		.prepare_access	= spi_prepare_at45db,
 	},
 
 	{
@@ -2894,7 +2896,7 @@
 		/* OTP: 128B total, 64B pre-programmed; read 0x77; write 0x9B */
 		.feature_bits	= FEATURE_OTP,
 		.tested		= TEST_OK_PREW,
-		.probe		= probe_spi_at45db,
+		.probe		= probe_spi_rdid,
 		.probe_timing	= TIMING_ZERO,
 		.block_erasers	=
 		{
@@ -2922,6 +2924,7 @@
 		.write		= spi_write_at45db,
 		.read		= spi_read_at45db, /* Fast read (0x0B) supported */
 		.voltage	= {2700, 3600}, /* 2.5-3.6V & 2.7-3.6V models available */
+		.prepare_access	= spi_prepare_at45db,
 	},
 
 	{
@@ -2936,7 +2939,7 @@
 		/* OTP: 128B total, 64B pre-programmed; read 0x77; write 0x9B */
 		.feature_bits	= FEATURE_OTP,
 		.tested		= TEST_OK_PREW,
-		.probe		= probe_spi_at45db,
+		.probe		= probe_spi_rdid,
 		.probe_timing	= TIMING_ZERO,
 		.block_erasers	=
 		{
@@ -2964,6 +2967,7 @@
 		.write		= spi_write_at45db,
 		.read		= spi_read_at45db, /* Fast read (0x0B) supported */
 		.voltage	= {2700, 3600}, /* 2.5-3.6V & 2.7-3.6V models available */
+		.prepare_access	= spi_prepare_at45db,
 	},
 
 	{
@@ -2978,7 +2982,7 @@
 		/* OTP: 128B total, 64B pre-programmed; read 0x77; write 0x9B */
 		.feature_bits	= FEATURE_OTP,
 		.tested		= TEST_OK_PREW,
-		.probe		= probe_spi_at45db,
+		.probe		= probe_spi_rdid,
 		.probe_timing	= TIMING_ZERO,
 		.block_erasers	=
 		{
@@ -3006,6 +3010,7 @@
 		.write		= spi_write_at45db,
 		.read		= spi_read_at45db, /* Fast read (0x0B) supported */
 		.voltage	= {2700, 3600}, /* 2.5-3.6V & 2.7-3.6V models available */
+		.prepare_access	= spi_prepare_at45db,
 	},
 
 	{
@@ -3063,7 +3068,7 @@
 		/* OTP: 128B total, 64B pre-programmed; read 0x77; write 0x9B */
 		.feature_bits	= FEATURE_OTP,
 		.tested		= TEST_OK_PREW,
-		.probe		= probe_spi_at45db,
+		.probe		= probe_spi_rdid,
 		.probe_timing	= TIMING_ZERO,
 		.block_erasers	=
 		{
@@ -3091,6 +3096,7 @@
 		.write		= spi_write_at45db,
 		.read		= spi_read_at45db, /* Fast read (0x0B) supported */
 		.voltage	= {2700, 3600}, /* 2.5-3.6V & 2.7-3.6V models available */
+		.prepare_access	= spi_prepare_at45db,
 	},
 
 	{
@@ -3105,7 +3111,7 @@
 		/* OTP: 128B total, 64B pre-programmed; read 0x77; write 0x9B */
 		.feature_bits	= FEATURE_OTP,
 		.tested		= TEST_UNTESTED,
-		.probe		= probe_spi_at45db,
+		.probe		= probe_spi_rdid,
 		.probe_timing	= TIMING_ZERO,
 		.block_erasers	=
 		{
@@ -3133,6 +3139,7 @@
 		.write		= spi_write_at45db,
 		.read		= spi_read_at45db, /* Fast read (0x0B) supported */
 		.voltage	= {2500, 3600}, /* 2.3-3.6V & 2.5-3.6V models available */
+		.prepare_access	= spi_prepare_at45db,
 	},
 
 	{
@@ -3147,7 +3154,7 @@
 		/* OTP: 128B total, 64B pre-programmed; read 0x77; write 0x9B */
 		.feature_bits	= FEATURE_OTP,
 		.tested		= TEST_OK_PREW,
-		.probe		= probe_spi_at45db,
+		.probe		= probe_spi_rdid,
 		.probe_timing	= TIMING_ZERO,
 		.block_erasers	=
 		{
@@ -3175,6 +3182,7 @@
 		.write		= spi_write_at45db,
 		.read		= spi_read_at45db, /* Fast read (0x0B) supported */
 		.voltage	= {2700, 3600},
+		.prepare_access	= spi_prepare_at45db,
 	},
 
 	{