]>
git.ipfire.org Git - people/ms/u-boot.git/blob - include/misc.h
2 * Copyright (C) 2015 Thomas Chou <thomas@wytron.com.tw>
4 * SPDX-License-Identifier: GPL-2.0+
11 * Read the device to buffer, optional.
14 * @offset: offset to read the device
15 * @buf: pointer to data buffer
16 * @size: data size in bytes to read the device
17 * @return: 0 if OK, -ve on error
19 int misc_read(struct udevice
*dev
, int offset
, void *buf
, int size
);
21 * Write buffer to the device, optional.
24 * @offset: offset to write the device
25 * @buf: pointer to data buffer
26 * @size: data size in bytes to write the device
27 * @return: 0 if OK, -ve on error
29 int misc_write(struct udevice
*dev
, int offset
, void *buf
, int size
);
31 * Assert command to the device, optional.
34 * @request: command to be sent to the device
35 * @buf: pointer to buffer related to the requset
36 * @return: 0 if OK, -ve on error
38 int misc_ioctl(struct udevice
*dev
, unsigned long request
, void *buf
);
41 * struct misc_ops - Driver model Misc operations
43 * The uclass interface is implemented by all miscellaneous devices which
48 * Read the device to buffer, optional.
51 * @offset: offset to read the device
52 * @buf: pointer to data buffer
53 * @size: data size in bytes to read the device
54 * @return: 0 if OK, -ve on error
56 int (*read
)(struct udevice
*dev
, int offset
, void *buf
, int size
);
58 * Write buffer to the device, optional.
61 * @offset: offset to write the device
62 * @buf: pointer to data buffer
63 * @size: data size in bytes to write the device
64 * @return: 0 if OK, -ve on error
66 int (*write
)(struct udevice
*dev
, int offset
, const void *buf
,
69 * Assert command to the device, optional.
72 * @request: command to be sent to the device
73 * @buf: pointer to buffer related to the requset
74 * @return: 0 if OK, -ve on error
76 int (*ioctl
)(struct udevice
*dev
, unsigned long request
, void *buf
);