Lines Matching full:data

38 	struct i2c_eeprom_target_data *data = dev->data;  in eeprom_target_program()  local
40 if (length > data->buffer_size) { in eeprom_target_program()
44 memcpy(data->buffer, eeprom_data, length); in eeprom_target_program()
52 struct i2c_eeprom_target_data *data = dev->data; in eeprom_target_read() local
54 if (!data || offset >= data->buffer_size) { in eeprom_target_read()
58 *eeprom_data = data->buffer[offset]; in eeprom_target_read()
67 struct i2c_eeprom_target_data *data = dev->data; in eeprom_target_set_addr() local
70 ret = i2c_target_unregister(cfg->bus.bus, &data->config); in eeprom_target_set_addr()
76 data->config.address = addr; in eeprom_target_set_addr()
78 return i2c_target_register(cfg->bus.bus, &data->config); in eeprom_target_set_addr()
84 struct i2c_eeprom_target_data *data = CONTAINER_OF(config, in eeprom_target_write_requested() local
90 data->idx_write_cnt = 0; in eeprom_target_write_requested()
98 struct i2c_eeprom_target_data *data = CONTAINER_OF(config, in eeprom_target_read_requested() local
102 *val = data->buffer[data->buffer_idx]; in eeprom_target_read_requested()
114 struct i2c_eeprom_target_data *data = CONTAINER_OF(config, in eeprom_target_write_received() local
125 if (data->idx_write_cnt < (data->address_width >> 3)) { in eeprom_target_write_received()
126 if (data->idx_write_cnt == 0) { in eeprom_target_write_received()
127 data->buffer_idx = 0; in eeprom_target_write_received()
130 data->buffer_idx = val | (data->buffer_idx << 8); in eeprom_target_write_received()
131 data->idx_write_cnt++; in eeprom_target_write_received()
133 data->buffer[data->buffer_idx++] = val; in eeprom_target_write_received()
136 data->buffer_idx = data->buffer_idx % data->buffer_size; in eeprom_target_write_received()
144 struct i2c_eeprom_target_data *data = CONTAINER_OF(config, in eeprom_target_read_processed() local
149 data->buffer_idx = (data->buffer_idx + 1) % data->buffer_size; in eeprom_target_read_processed()
151 *val = data->buffer[data->buffer_idx]; in eeprom_target_read_processed()
164 struct i2c_eeprom_target_data *data = CONTAINER_OF(config, in eeprom_target_stop() local
170 data->idx_write_cnt = 0; in eeprom_target_stop()
179 struct i2c_eeprom_target_data *data = CONTAINER_OF(config, in eeprom_target_buf_write_received() local
185 data->buffer_idx = 0; in eeprom_target_buf_write_received()
186 while (idx_write_cnt < (data->address_width >> 3)) { in eeprom_target_buf_write_received()
187 data->buffer_idx = (data->buffer_idx << 8) | *ptr++; in eeprom_target_buf_write_received()
193 memcpy(&data->buffer[data->buffer_idx], ptr, len); in eeprom_target_buf_write_received()
200 struct i2c_eeprom_target_data *data = CONTAINER_OF(config, in eeprom_target_buf_read_requested() local
204 *ptr = &data->buffer[data->buffer_idx]; in eeprom_target_buf_read_requested()
205 *len = data->buffer_size; in eeprom_target_buf_read_requested()
214 struct i2c_eeprom_target_data *data = dev->data; in eeprom_target_register() local
216 return i2c_target_register(cfg->bus.bus, &data->config); in eeprom_target_register()
222 struct i2c_eeprom_target_data *data = dev->data; in eeprom_target_unregister() local
224 return i2c_target_unregister(cfg->bus.bus, &data->config); in eeprom_target_unregister()
246 struct i2c_eeprom_target_data *data = dev->data; in i2c_eeprom_target_init() local
254 data->buffer_size = cfg->buffer_size; in i2c_eeprom_target_init()
255 data->buffer = cfg->buffer; in i2c_eeprom_target_init()
256 data->config.address = cfg->bus.addr; in i2c_eeprom_target_init()
257 data->config.callbacks = &eeprom_callbacks; in i2c_eeprom_target_init()