]>
git.ipfire.org Git - people/ms/u-boot.git/blob - drivers/misc/misc-uclass.c
2 * Copyright (C) 2010 Thomas Chou <thomas@wytron.com.tw>
4 * SPDX-License-Identifier: GPL-2.0+
13 * Implement a miscellaneous uclass for those do not fit other more
14 * general classes. A set of generic read, write and ioctl methods may
15 * be used to access the device.
18 int misc_read(struct udevice
*dev
, int offset
, void *buf
, int size
)
20 const struct misc_ops
*ops
= device_get_ops(dev
);
25 return ops
->read(dev
, offset
, buf
, size
);
28 int misc_write(struct udevice
*dev
, int offset
, void *buf
, int size
)
30 const struct misc_ops
*ops
= device_get_ops(dev
);
35 return ops
->write(dev
, offset
, buf
, size
);
38 int misc_ioctl(struct udevice
*dev
, unsigned long request
, void *buf
)
40 const struct misc_ops
*ops
= device_get_ops(dev
);
45 return ops
->ioctl(dev
, request
, buf
);
48 int misc_call(struct udevice
*dev
, int msgid
, void *tx_msg
, int tx_size
,
49 void *rx_msg
, int rx_size
)
51 const struct misc_ops
*ops
= device_get_ops(dev
);
56 return ops
->call(dev
, msgid
, tx_msg
, tx_size
, rx_msg
, rx_size
);
59 UCLASS_DRIVER(misc
) = {