Lines Matching +full:read +full:- +full:write
1 /* SPDX-License-Identifier: GPL-2.0+ */
21 * Read and write functions are supplied, which can read/write data of
25 * tree settings via the boolean "little-endian", "big-endian", and
26 * "native-endian" properties.
34 * accesses the register map as regular IO-mapped memory.
38 * enum regmap_size_t - Access sizes for regmap reads and writes
40 * @REGMAP_SIZE_8: 8-bit read/write access size
41 * @REGMAP_SIZE_16: 16-bit read/write access size
42 * @REGMAP_SIZE_32: 32-bit read/write access size
43 * @REGMAP_SIZE_64: 64-bit read/write access size
53 * enum regmap_endianness_t - Endianness for regmap reads and writes
55 * @REGMAP_NATIVE_ENDIAN: Native endian read/write accesses
56 * @REGMAP_LITTLE_ENDIAN: Little endian read/write accesses
57 * @REGMAP_BIG_ENDIAN: Big endian read/write accesses
66 * struct regmap_range - a register map range
77 * struct regmap - a way of accessing hardware/bus registers
94 * regmap_write() - Write a 32-bit value to a regmap
96 * @map: Regmap to write to
97 * @offset: Offset in the regmap to write to
98 * @val: Data to write to the regmap at the specified offset
100 * Note that this function will only write values of 32 bit width to the
101 * regmap; if the size of data to be read is different, the regmap_raw_write
104 * Return: 0 if OK, -ve on error
109 * regmap_read() - Read a 32-bit value from a regmap
111 * @map: Regmap to read from
112 * @offset: Offset in the regmap to read from
113 * @valp: Pointer to the buffer to receive the data read from the regmap
116 * Note that this function will only read values of 32 bit width from the
117 * regmap; if the size of data to be read is different, the regmap_raw_read
120 * Return: 0 if OK, -ve on error
125 * regmap_raw_write() - Write a value of specified length to a regmap
127 * @map: Regmap to write to
128 * @offset: Offset in the regmap to write to
129 * @val: Value to write to the regmap at the specified offset
132 * Note that this function will, as opposed to regmap_write, write data of
133 * arbitrary length to the regmap, and not just 32-bit values, and is thus a
136 * Return: 0 if OK, -ve on error
142 * regmap_raw_read() - Read a value of specified length from a regmap
144 * @map: Regmap to read from
145 * @offset: Offset in the regmap to read from
146 * @valp: Pointer to the buffer to receive the data read from the regmap
148 * @val_len: Length of the data to be read from the regmap
150 * Note that this function will, as opposed to regmap_read, read data of
151 * arbitrary length from the regmap, and not just 32-bit values, and is thus a
154 * Return: 0 if OK, -ve on error
160 * regmap_raw_write_range() - Write a value of specified length to a range of a
163 * @map: Regmap to write to
164 * @range_num: Number of the range in the regmap to write to
165 * @offset: Offset in the regmap to write to
166 * @val: Value to write to the regmap at the specified offset
169 * Return: 0 if OK, -ve on error
175 * regmap_raw_read_range() - Read a value of specified length from a range of a
178 * @map: Regmap to read from
179 * @range_num: Number of the range in the regmap to write to
180 * @offset: Offset in the regmap to read from
181 * @valp: Pointer to the buffer to receive the data read from the regmap
183 * @val_len: Length of the data to be read from the regmap
185 * Return: 0 if OK, -ve on error
191 * regmap_range_set() - Set a value in a regmap range described by a struct
201 typeof(((type *)0)->member) __tmp = val; \
203 &__tmp, sizeof(((type *)0)->member)); \
207 * regmap_set() - Set a value in a regmap described by a struct
217 * regmap_range_get() - Get a value from a regmap range described by a struct
218 * @map: Regmap from which a value should be read
219 * @range: Range of the regmap from which a value should be read
222 * @member: Member of the describing structure that should be read in the
224 * @valp: Variable that receives the value read from the regmap range
228 (void *)valp, sizeof(((type *)0)->member))
231 * regmap_get() - Get a value from a regmap described by a struct
232 * @map: Regmap from which a value should be read
235 * @member: Member of the describing structure that should be read in the
237 * @valp: Variable that receives the value read from the regmap
243 * regmap_read_poll_timeout - Poll until a condition is met or a timeout occurs
245 * @map: Regmap to read from
247 * @val: Unsigned integer variable to read the value into
249 * @sleep_us: Maximum time to sleep between reads in us (0 tight-loops).
251 * @test_add_time: Used for sandbox testing - amount of time to add after
254 * Returns 0 on success and -ETIMEDOUT upon a timeout or the regmap_read
255 * error return value in case of a error read. In the two former cases,
256 * the last read value at @addr is stored in @val. Must not be called
285 __ret ?: ((cond) ? 0 : -ETIMEDOUT); \
293 * regmap_update_bits() - Perform a read/modify/write using a mask
297 * @mask: Mask to apply to the read value
298 * @val: Value to apply to the value to write
299 * Return: 0 if OK, -ve on error
304 * regmap_init_mem() - Set up a new register map that uses memory access
308 * Return: 0 if OK, -ve on error
315 * regmap_init_mem_platdata() - Set up a new memory register map for
316 * of-platdata
322 * Return: 0 if OK, -ve on error
325 * using the device tree. It only supports 32-bit machines.
334 * regmap_get_range() - Obtain the base memory address of a regmap range
343 * regmap_uninit() - free a previously inited regmap
346 * Return: 0 if OK, -ve on error