diff options
author | Ye.Li <B37916@freescale.com> | 2015-03-26 15:24:04 +0800 |
---|---|---|
committer | Peng Fan <Peng.Fan@freescale.com> | 2015-04-29 15:04:25 +0800 |
commit | a3e51689d0ef7d204b4a6b74afd064c0315b09e8 (patch) | |
tree | 4652932dea825f3b07a270bff45fe0a87b0c983b /board/freescale | |
parent | 0a619caee7b6fec513214a3bd4baa00a552efc61 (diff) | |
download | u-boot-imx-a3e51689d0ef7d204b4a6b74afd064c0315b09e8.zip u-boot-imx-a3e51689d0ef7d204b4a6b74afd064c0315b09e8.tar.gz u-boot-imx-a3e51689d0ef7d204b4a6b74afd064c0315b09e8.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>
(cherry picked from commit 83389e054d3cb7a905a3f81c20f395e784beb258)
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Diffstat (limited to 'board/freescale')
-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 a653c08..815fd68 100644 --- a/board/freescale/mx7dsabresd/mx7dsabresd.c +++ b/board/freescale/mx7dsabresd/mx7dsabresd.c @@ -203,13 +203,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); @@ -224,14 +226,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); /* @@ -242,8 +243,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) @@ -262,7 +263,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); |