Lines Matching +full:data +full:- +full:shift

3  * SPDX-License-Identifier: Apache-2.0
30 struct f75303_emul_data *data = target->data; in f75303_emul_set_reg() local
33 data->reg[reg] = val; in f75303_emul_set_reg()
38 struct f75303_emul_data *data = target->data; in f75303_emul_get_reg() local
41 return data->reg[reg]; in f75303_emul_get_reg()
46 struct f75303_emul_data *data = target->data; in f75303_emul_reset() local
48 memset(data->reg, 0, NUM_REGS); in f75303_emul_reset()
60 i2c_dump_msgs_rw(target->dev, msgs, num_msgs, addr, false); in f75303_emul_transfer_i2c()
63 if (msgs->flags & I2C_MSG_READ) { in f75303_emul_transfer_i2c()
65 return -EIO; in f75303_emul_transfer_i2c()
67 if (msgs->len != 1) { in f75303_emul_transfer_i2c()
68 LOG_ERR("Unexpected msg0 length %d", msgs->len); in f75303_emul_transfer_i2c()
69 return -EIO; in f75303_emul_transfer_i2c()
71 reg = msgs->buf[0]; in f75303_emul_transfer_i2c()
75 if (msgs->flags & I2C_MSG_READ) { in f75303_emul_transfer_i2c()
76 switch (msgs->len) { in f75303_emul_transfer_i2c()
79 msgs->buf[0] = val; in f75303_emul_transfer_i2c()
82 LOG_ERR("Unexpected msg1 length %d", msgs->len); in f75303_emul_transfer_i2c()
83 return -EIO; in f75303_emul_transfer_i2c()
86 if (msgs->len != 1) { in f75303_emul_transfer_i2c()
87 LOG_ERR("Unexpected msg1 length %d", msgs->len); in f75303_emul_transfer_i2c()
89 f75303_emul_set_reg(target, reg, msgs->buf[0]); in f75303_emul_transfer_i2c()
94 return -EIO; in f75303_emul_transfer_i2c()
107 const q31_t *value, int8_t shift) in f75303_emul_set_channel() argument
109 struct f75303_emul_data *data = target->data; in f75303_emul_set_channel() local
129 return -ENOTSUP; in f75303_emul_set_channel()
132 scaled_value = (int64_t)*value << shift; in f75303_emul_set_channel()
136 data->reg[reg_h] = reg_value >> 3; in f75303_emul_set_channel()
137 data->reg[reg_l] = (reg_value & 0x7) << 5; in f75303_emul_set_channel()
143 q31_t *lower, q31_t *upper, q31_t *epsilon, int8_t *shift) in f75303_emul_get_sample_range() argument
148 return -ENOTSUP; in f75303_emul_get_sample_range()
151 *shift = 8; in f75303_emul_get_sample_range()
153 *upper = (int64_t)(255.875 * ((int64_t)INT32_MAX + 1)) >> *shift; in f75303_emul_get_sample_range()
154 *epsilon = (int64_t)(0.125 * ((int64_t)INT32_MAX + 1)) >> *shift; in f75303_emul_get_sample_range()