/* Set the sensor's bandwidth parameter (one of BMA4XX_BWP_*)  */
static int bma4xx_attr_set_bwp(const struct device *dev, const struct sensor_value *val)
/* Set the sensor's bandwidth parameter (one of BMA4XX_BWP_*)  */
static int bma4xx_attr_set_bwp(const struct device *dev, const struct sensor_value *val)
{
	if (val->val2 || val->val1 < BMA4XX_BWP_OSR4_AVG1 || val->val1 > BMA4XX_BWP_RES_AVG128) {
		return -EINVAL;
	}
	struct bma4xx_data *bma4xx = dev->data;
	return bma4xx->hw_ops->update_reg(dev, BMA4XX_REG_ACCEL_CONFIG, BMA4XX_MASK_ACC_CONF_BWP,
					  (((uint8_t)val->val1) << BMA4XX_SHIFT_ACC_CONF_BWP));
}