Commit 9436abc4 authored by Linus Walleij's avatar Linus Walleij Committed by Jonathan Cameron

iio: accel: bma180: Use explicit member assignment

This uses the C99 explicit .member assignment for the
variant data in struct bma180_part_info. This makes it
easier to understand and add new variants.

Cc: Peter Meerwald <pmeerw@pmeerw.net>
Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent c35aae74
...@@ -632,32 +632,52 @@ static const struct iio_chan_spec bma250_channels[] = { ...@@ -632,32 +632,52 @@ static const struct iio_chan_spec bma250_channels[] = {
static const struct bma180_part_info bma180_part_info[] = { static const struct bma180_part_info bma180_part_info[] = {
[BMA180] = { [BMA180] = {
bma180_channels, ARRAY_SIZE(bma180_channels), .channels = bma180_channels,
bma180_scale_table, ARRAY_SIZE(bma180_scale_table), .num_channels = ARRAY_SIZE(bma180_channels),
bma180_bw_table, ARRAY_SIZE(bma180_bw_table), .scale_table = bma180_scale_table,
BMA180_CTRL_REG0, BMA180_RESET_INT, .num_scales = ARRAY_SIZE(bma180_scale_table),
BMA180_CTRL_REG0, BMA180_SLEEP, .bw_table = bma180_bw_table,
BMA180_BW_TCS, BMA180_BW, .num_bw = ARRAY_SIZE(bma180_bw_table),
BMA180_OFFSET_LSB1, BMA180_RANGE, .int_reset_reg = BMA180_CTRL_REG0,
BMA180_TCO_Z, BMA180_MODE_CONFIG, BMA180_LOW_POWER, .int_reset_mask = BMA180_RESET_INT,
BMA180_CTRL_REG3, BMA180_NEW_DATA_INT, .sleep_reg = BMA180_CTRL_REG0,
BMA180_RESET, .sleep_mask = BMA180_SLEEP,
bma180_chip_config, .bw_reg = BMA180_BW_TCS,
bma180_chip_disable, .bw_mask = BMA180_BW,
.scale_reg = BMA180_OFFSET_LSB1,
.scale_mask = BMA180_RANGE,
.power_reg = BMA180_TCO_Z,
.power_mask = BMA180_MODE_CONFIG,
.lowpower_val = BMA180_LOW_POWER,
.int_enable_reg = BMA180_CTRL_REG3,
.int_enable_mask = BMA180_NEW_DATA_INT,
.softreset_reg = BMA180_RESET,
.chip_config = bma180_chip_config,
.chip_disable = bma180_chip_disable,
}, },
[BMA250] = { [BMA250] = {
bma250_channels, ARRAY_SIZE(bma250_channels), .channels = bma250_channels,
bma250_scale_table, ARRAY_SIZE(bma250_scale_table), .num_channels = ARRAY_SIZE(bma250_channels),
bma250_bw_table, ARRAY_SIZE(bma250_bw_table), .scale_table = bma250_scale_table,
BMA250_INT_RESET_REG, BMA250_INT_RESET_MASK, .num_scales = ARRAY_SIZE(bma250_scale_table),
BMA250_POWER_REG, BMA250_SUSPEND_MASK, .bw_table = bma250_bw_table,
BMA250_BW_REG, BMA250_BW_MASK, .num_bw = ARRAY_SIZE(bma250_bw_table),
BMA250_RANGE_REG, BMA250_RANGE_MASK, .int_reset_reg = BMA250_INT_RESET_REG,
BMA250_POWER_REG, BMA250_LOWPOWER_MASK, 1, .int_reset_mask = BMA250_INT_RESET_MASK,
BMA250_INT_ENABLE_REG, BMA250_DATA_INTEN_MASK, .sleep_reg = BMA250_POWER_REG,
BMA250_RESET_REG, .sleep_mask = BMA250_SUSPEND_MASK,
bma250_chip_config, .bw_reg = BMA250_BW_REG,
bma250_chip_disable, .bw_mask = BMA250_BW_MASK,
.scale_reg = BMA250_RANGE_REG,
.scale_mask = BMA250_RANGE_MASK,
.power_reg = BMA250_POWER_REG,
.power_mask = BMA250_LOWPOWER_MASK,
.lowpower_val = 1,
.int_enable_reg = BMA250_INT_ENABLE_REG,
.int_enable_mask = BMA250_DATA_INTEN_MASK,
.softreset_reg = BMA250_RESET_REG,
.chip_config = bma250_chip_config,
.chip_disable = bma250_chip_disable,
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment