Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/imcsmb Our i2c addresses are right-justified 7-bit; ...



details:   https://anonhg.NetBSD.org/src/rev/ff8815e668cc
branches:  trunk
changeset: 359849:ff8815e668cc
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Tue Feb 27 05:45:14 2018 +0000

description:
Our i2c addresses are right-justified 7-bit;  we don't shift left
for the "write" bit

diffstat:

 sys/dev/imcsmb/imcsmb.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 0c7a2964c766 -r ff8815e668cc sys/dev/imcsmb/imcsmb.c
--- a/sys/dev/imcsmb/imcsmb.c   Tue Feb 27 05:43:20 2018 +0000
+++ b/sys/dev/imcsmb/imcsmb.c   Tue Feb 27 05:45:14 2018 +0000
@@ -271,7 +271,7 @@
         * the four high bits of the slave address.
         */
        cntl_val &= ~IMCSMB_CNTL_DTI_MASK;
-       cntl_val |= ((uint32_t) addr & 0xf0) << 24;
+       cntl_val |= ((uint32_t) addr & 0x78) << 25;
 
        /* [27:27] Set the CLK_OVERRIDE bit, to enable normal operation */
        cntl_val |= IMCSMB_CNTL_CLK_OVERRIDE;
@@ -304,7 +304,7 @@
        }
 
        /* [26:24] The three non-DTI, non-R/W bits of the slave address. */
-       cmd_val |= (uint32_t) ((addr & 0xe) << 23);
+       cmd_val |= (uint32_t) ((addr & 0x7) << 24);
 
        /* [23:16] The command (offset in the case of an EEPROM, or register in
         * the case of TSOD or NVDIMM controller).



Home | Main Index | Thread Index | Old Index