diff target-utils/libbase/abbdrv.c @ 496:3d73d4d3527f

target-utils: removed osmo_delay_ms() from ABB access code
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 25 May 2019 20:17:27 +0000
parents e7502631a0f9
children 74610c4f10f7
line wrap: on
line diff
--- a/target-utils/libbase/abbdrv.c	Sat May 25 18:51:19 2019 +0000
+++ b/target-utils/libbase/abbdrv.c	Sat May 25 20:17:27 2019 +0000
@@ -58,7 +58,8 @@
 
 	/* A read cycle contains two SPI transfers */
 	spi_xfer(TWL3025_DEV_IDX, 16, &tx, &rx);
-	osmo_delay_ms(1);
+	/* delay of seven 13MHz cycles */
+	wait_ARM_cycles(7);
 	spi_xfer(TWL3025_DEV_IDX, 16, &tx, &rx);
 
 	rx >>= 6;
@@ -85,10 +86,12 @@
 	abb_select_page(0);
 	/* CLK13M enable */
 	abb_reg_write(TOGBR2, TOGBR2_ACTS);
-	osmo_delay_ms(1);
+	/* ABB_Wait_IBIC_Access() delay of 210 us */
+	wait_ARM_cycles(210 * 13);
 	/* for whatever reason we need to do this twice */
 	abb_reg_write(TOGBR2, TOGBR2_ACTS);
-	osmo_delay_ms(1);
+	/* ABB_Wait_IBIC_Access() delay of 210 us */
+	wait_ARM_cycles(210 * 13);
 	abb_state_initdone = 1;
 	return(1);
 }