/* iis2dlpc_set_range - set full scale range for acc @dev: Pointer to instance of struct device (I2C or SPI) @range: Full scale range (2, 4, 8 and 16 G)  */
static int iis2dlpc_set_range(const struct device *dev, uint8_t fs)
/* iis2dlpc_set_range - set full scale range for acc @dev: Pointer to instance of struct device (I2C or SPI) @range: Full scale range (2, 4, 8 and 16 G)  */
static int iis2dlpc_set_range(const struct device *dev, uint8_t fs)
{
	int err;
	struct iis2dlpc_data *iis2dlpc = dev->data;
	const struct iis2dlpc_config *cfg = dev->config;
	stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx;
	uint8_t shift_gain = 0U;
	err = iis2dlpc_full_scale_set(ctx, fs);
	if (cfg->pm == IIS2DLPC_CONT_LOW_PWR_12bit) {
		shift_gain = IIS2DLPC_SHFT_GAIN_NOLP1;
	}
	if (!err) {
		iis2dlpc->gain = IIS2DLPC_FS_TO_GAIN(fs, shift_gain);
	}
	return err;
}