提交 5ff6a99d 编写于 作者: L Lars-Peter Clausen 提交者: Greg Kroah-Hartman

staging:iio:dac:ad5446: Remove duplicated write sample functions

AD5620_LOAD and AD5446_LOAD are both 0, so all these three functions are
identical and we can replace them with only one.
Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
Acked-by: NJonathan Cameron <jic23@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 07ffd0d0
...@@ -25,20 +25,10 @@ ...@@ -25,20 +25,10 @@
#include "ad5446.h" #include "ad5446.h"
static void ad5446_store_sample(struct ad5446_state *st, unsigned val) static void ad5446_store_sample(struct ad5446_state *st, unsigned val)
{
st->data.d16 = cpu_to_be16(AD5446_LOAD | val);
}
static void ad5542_store_sample(struct ad5446_state *st, unsigned val)
{ {
st->data.d16 = cpu_to_be16(val); st->data.d16 = cpu_to_be16(val);
} }
static void ad5620_store_sample(struct ad5446_state *st, unsigned val)
{
st->data.d16 = cpu_to_be16(AD5620_LOAD | val);
}
static void ad5660_store_sample(struct ad5446_state *st, unsigned val) static void ad5660_store_sample(struct ad5446_state *st, unsigned val)
{ {
val |= AD5660_LOAD; val |= AD5660_LOAD;
...@@ -174,61 +164,61 @@ static const struct ad5446_chip_info ad5446_chip_info_tbl[] = { ...@@ -174,61 +164,61 @@ static const struct ad5446_chip_info ad5446_chip_info_tbl[] = {
}, },
[ID_AD5541A] = { [ID_AD5541A] = {
.channel = AD5446_CHANNEL(16, 16, 0), .channel = AD5446_CHANNEL(16, 16, 0),
.store_sample = ad5542_store_sample, .store_sample = ad5446_store_sample,
}, },
[ID_AD5542A] = { [ID_AD5542A] = {
.channel = AD5446_CHANNEL(16, 16, 0), .channel = AD5446_CHANNEL(16, 16, 0),
.store_sample = ad5542_store_sample, .store_sample = ad5446_store_sample,
}, },
[ID_AD5543] = { [ID_AD5543] = {
.channel = AD5446_CHANNEL(16, 16, 0), .channel = AD5446_CHANNEL(16, 16, 0),
.store_sample = ad5542_store_sample, .store_sample = ad5446_store_sample,
}, },
[ID_AD5512A] = { [ID_AD5512A] = {
.channel = AD5446_CHANNEL(12, 16, 4), .channel = AD5446_CHANNEL(12, 16, 4),
.store_sample = ad5542_store_sample, .store_sample = ad5446_store_sample,
}, },
[ID_AD5553] = { [ID_AD5553] = {
.channel = AD5446_CHANNEL(14, 16, 0), .channel = AD5446_CHANNEL(14, 16, 0),
.store_sample = ad5542_store_sample, .store_sample = ad5446_store_sample,
}, },
[ID_AD5601] = { [ID_AD5601] = {
.channel = AD5446_CHANNEL(8, 16, 6), .channel = AD5446_CHANNEL(8, 16, 6),
.store_sample = ad5542_store_sample, .store_sample = ad5446_store_sample,
.store_pwr_down = ad5620_store_pwr_down, .store_pwr_down = ad5620_store_pwr_down,
}, },
[ID_AD5611] = { [ID_AD5611] = {
.channel = AD5446_CHANNEL(10, 16, 4), .channel = AD5446_CHANNEL(10, 16, 4),
.store_sample = ad5542_store_sample, .store_sample = ad5446_store_sample,
.store_pwr_down = ad5620_store_pwr_down, .store_pwr_down = ad5620_store_pwr_down,
}, },
[ID_AD5621] = { [ID_AD5621] = {
.channel = AD5446_CHANNEL(12, 16, 2), .channel = AD5446_CHANNEL(12, 16, 2),
.store_sample = ad5542_store_sample, .store_sample = ad5446_store_sample,
.store_pwr_down = ad5620_store_pwr_down, .store_pwr_down = ad5620_store_pwr_down,
}, },
[ID_AD5620_2500] = { [ID_AD5620_2500] = {
.channel = AD5446_CHANNEL(12, 16, 2), .channel = AD5446_CHANNEL(12, 16, 2),
.int_vref_mv = 2500, .int_vref_mv = 2500,
.store_sample = ad5620_store_sample, .store_sample = ad5446_store_sample,
.store_pwr_down = ad5620_store_pwr_down, .store_pwr_down = ad5620_store_pwr_down,
}, },
[ID_AD5620_1250] = { [ID_AD5620_1250] = {
.channel = AD5446_CHANNEL(12, 16, 2), .channel = AD5446_CHANNEL(12, 16, 2),
.int_vref_mv = 1250, .int_vref_mv = 1250,
.store_sample = ad5620_store_sample, .store_sample = ad5446_store_sample,
.store_pwr_down = ad5620_store_pwr_down, .store_pwr_down = ad5620_store_pwr_down,
}, },
[ID_AD5640_2500] = { [ID_AD5640_2500] = {
.channel = AD5446_CHANNEL(14, 16, 0), .channel = AD5446_CHANNEL(14, 16, 0),
.int_vref_mv = 2500, .int_vref_mv = 2500,
.store_sample = ad5620_store_sample, .store_sample = ad5446_store_sample,
.store_pwr_down = ad5620_store_pwr_down, .store_pwr_down = ad5620_store_pwr_down,
}, },
[ID_AD5640_1250] = { [ID_AD5640_1250] = {
.channel = AD5446_CHANNEL(14, 16, 0), .channel = AD5446_CHANNEL(14, 16, 0),
.int_vref_mv = 1250, .int_vref_mv = 1250,
.store_sample = ad5620_store_sample, .store_sample = ad5446_store_sample,
.store_pwr_down = ad5620_store_pwr_down, .store_pwr_down = ad5620_store_pwr_down,
}, },
[ID_AD5660_2500] = { [ID_AD5660_2500] = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册