/* Convert an ODR rate in Hz to a register value.  */
static int bma4xx_odr_to_reg(uint32_t microhertz, uint8_t *reg_val)
/* Convert an ODR rate in Hz to a register value.  */
static int bma4xx_odr_to_reg(uint32_t microhertz, uint8_t *reg_val)
{
	if (microhertz == 0) {
		return -ERANGE;
	}
	for (uint8_t i = 0; i < ARRAY_SIZE(odr_to_reg_map); i++) {
		if (microhertz <= odr_to_reg_map[i]) {
			*reg_val = i;
			return 0;
		}
	}
	return -ERANGE;
}