diff options
author | Ye.Li <B37916@freescale.com> | 2015-03-26 15:24:04 +0800 |
---|---|---|
committer | Ye.Li <B37916@freescale.com> | 2015-03-26 17:27:11 +0800 |
commit | 83389e054d3cb7a905a3f81c20f395e784beb258 (patch) | |
tree | 27b3e1cd33111f10f1af94806928432d1636c576 | |
parent | 9b6ac1f82b09d243dc674c780abcacf0e12262c2 (diff) | |
download | u-boot-imx-83389e054d3cb7a905a3f81c20f395e784beb258.zip u-boot-imx-83389e054d3cb7a905a3f81c20f395e784beb258.tar.gz u-boot-imx-83389e054d3cb7a905a3f81c20f395e784beb258.tar.bz2 |
MLK-10476 imx: mx7dsabresd: Fix 74LV driver issue
Should write the bits to SDI in reverse order because of the bits
will be shifted.
Signed-off-by: Ye.Li <B37916@freescale.com>
-rw-r--r-- | board/freescale/mx7dsabresd/mx7dsabresd.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/board/freescale/mx7dsabresd/mx7dsabresd.c b/board/freescale/mx7dsabresd/mx7dsabresd.c index 13aed0e..64acf90 100644 --- a/board/freescale/mx7dsabresd/mx7dsabresd.c +++ b/board/freescale/mx7dsabresd/mx7dsabresd.c @@ -200,13 +200,15 @@ static enum qn_level seq[3][2] = { }; static enum qn_func qn_output[8] = { - qn_disable, qn_reset, qn_reset, qn_reset, qn_reset, qn_enable, qn_enable + qn_disable, qn_reset, qn_reset, qn_reset, qn_reset, qn_reset, qn_enable, + qn_enable }; void iox74lv_init(void) { - int i = 0; - for (i = 0; i < 8; i++) { + int i; + + for (i = 7; i >= 0; i--) { gpio_direction_output(IOX_SHCP, 0); gpio_direction_output(IOX_SDI, seq[qn_output[i]][0]); udelay(500); @@ -221,14 +223,13 @@ void iox74lv_init(void) */ gpio_direction_output(IOX_STCP, 1); - for (i = 0; i < 8; i++) { + for (i = 7; i >= 0; i--) { gpio_direction_output(IOX_SHCP, 0); gpio_direction_output(IOX_SDI, seq[qn_output[i]][1]); udelay(500); gpio_direction_output(IOX_SHCP, 1); udelay(500); } - gpio_direction_output(IOX_STCP, 0); udelay(500); /* @@ -239,8 +240,8 @@ void iox74lv_init(void) void iox74lv_set(int index) { - int i = 0; - for (i = 0; i < 8; i++) { + int i; + for (i = 7; i >= 0; i--) { gpio_direction_output(IOX_SHCP, 0); if (i == index) @@ -259,7 +260,7 @@ void iox74lv_set(int index) */ gpio_direction_output(IOX_STCP, 1); - for (i = 0; i < 8; i++) { + for (i = 7; i >= 0; i--) { gpio_direction_output(IOX_SHCP, 0); gpio_direction_output(IOX_SDI, seq[qn_output[i]][1]); udelay(500); |