提交 815f1647 编写于 作者: M Marcus Folkesson 提交者: Jonathan Cameron

iio: adc: mcp3911: use correct id bits

The device ID should be shifted 6 bits to left according to datasheet.

Fixes: 3a89b289 ("iio: adc: add support for mcp3911")
Signed-off-by: NMarcus Folkesson <marcus.folkesson@gmail.com>
Link: https://lore.kernel.org/r/20221010194641.676484-1-marcus.folkesson@gmail.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
上级 a83695a6
......@@ -55,8 +55,8 @@
/* Internal voltage reference in mV */
#define MCP3911_INT_VREF_MV 1200
#define MCP3911_REG_READ(reg, id) ((((reg) << 1) | ((id) << 5) | (1 << 0)) & 0xff)
#define MCP3911_REG_WRITE(reg, id) ((((reg) << 1) | ((id) << 5) | (0 << 0)) & 0xff)
#define MCP3911_REG_READ(reg, id) ((((reg) << 1) | ((id) << 6) | (1 << 0)) & 0xff)
#define MCP3911_REG_WRITE(reg, id) ((((reg) << 1) | ((id) << 6) | (0 << 0)) & 0xff)
#define MCP3911_NUM_CHANNELS 2
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册