提交 3f45c684 编写于 作者: D Dragos Bogdan 提交者: Xie XiuQi

iio: ad_sigma_delta: select channel when reading register

commit fccfb9ce70ed4ea7a145f77b86de62e38178517f upstream.

The desired channel has to be selected in order to correctly fill the
buffer with the corresponding data.
The `ad_sd_write_reg()` already does this, but for the
`ad_sd_read_reg_raw()` this was omitted.

Fixes: af300848 ("iio:adc: Add common code for ADI Sigma Delta devices")
Signed-off-by: NDragos Bogdan <dragos.bogdan@analog.com>
Signed-off-by: NAlexandru Ardelean <alexandru.ardelean@analog.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 8a4d7655
...@@ -121,6 +121,7 @@ static int ad_sd_read_reg_raw(struct ad_sigma_delta *sigma_delta, ...@@ -121,6 +121,7 @@ static int ad_sd_read_reg_raw(struct ad_sigma_delta *sigma_delta,
if (sigma_delta->info->has_registers) { if (sigma_delta->info->has_registers) {
data[0] = reg << sigma_delta->info->addr_shift; data[0] = reg << sigma_delta->info->addr_shift;
data[0] |= sigma_delta->info->read_mask; data[0] |= sigma_delta->info->read_mask;
data[0] |= sigma_delta->comm;
spi_message_add_tail(&t[0], &m); spi_message_add_tail(&t[0], &m);
} }
spi_message_add_tail(&t[1], &m); spi_message_add_tail(&t[1], &m);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册