OSDN Git Service

net: dsa: xrs700x: Correctly address device over I2C
authorTobias Waldekranz <tobias@waldekranz.com>
Tue, 2 Feb 2021 19:16:45 +0000 (20:16 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 5 Feb 2021 03:09:47 +0000 (19:09 -0800)
commitadd285bce37720675af5b1873f71af8561d0e2fe
tree310c81935e04b68c396c93aa4a76f6abf31b9e54
parentb53014f0791cbc4925f52d7c46220845e42d0a91
net: dsa: xrs700x: Correctly address device over I2C

On read, master should send 31 MSB of the register (only even values
are ever used), followed by a 1 to indicate read. Then, reading two
bytes, the device will output the register's value.

On write, master sends 31 MSB of the register, followed by a 0 to
indicate write, followed by two bytes containing the register value.

Flexibilis' documentation (version 1.3) specifies the opposite
polarity (#read/write), but the scope indicates that it is, in fact,
read/#write.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: George McCollister <george.mccollister@gmail.com>
Link: https://lore.kernel.org/r/20210202191645.439-1-tobias@waldekranz.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/xrs700x/xrs700x_i2c.c