/* iis2dlpc_set_odr - set new sampling frequency @dev: Pointer to instance of struct device (I2C or SPI) @odr: Output data rate  */
static int iis2dlpc_set_odr(const struct device *dev, uint16_t odr)
/* iis2dlpc_set_odr - set new sampling frequency @dev: Pointer to instance of struct device (I2C or SPI) @odr: Output data rate  */
static int iis2dlpc_set_odr(const struct device *dev, uint16_t odr)
{
	const struct iis2dlpc_config *cfg = dev->config;
	stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx;
	uint8_t val;
	if (odr == 0U) {
		return iis2dlpc_data_rate_set(ctx, IIS2DLPC_XL_ODR_OFF);
	}
	val = IIS2DLPC_ODR_TO_REG(odr);
	if (val > IIS2DLPC_XL_ODR_1k6Hz) {
		LOG_ERR("ODR too high");
		return -ENOTSUP;
	}
	return iis2dlpc_data_rate_set(ctx, val);
}