umcpmio_io.h revision 1.2.4.2 1 1.2.4.2 perseant /* $NetBSD: umcpmio_io.h,v 1.2.4.2 2025/08/02 05:57:06 perseant Exp $ */
2 1.2.4.2 perseant
3 1.2.4.2 perseant /*
4 1.2.4.2 perseant * Copyright (c) 2024 Brad Spencer <brad (at) anduin.eldar.org>
5 1.2.4.2 perseant *
6 1.2.4.2 perseant * Permission to use, copy, modify, and distribute this software for any
7 1.2.4.2 perseant * purpose with or without fee is hereby granted, provided that the above
8 1.2.4.2 perseant * copyright notice and this permission notice appear in all copies.
9 1.2.4.2 perseant *
10 1.2.4.2 perseant * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 1.2.4.2 perseant * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 1.2.4.2 perseant * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 1.2.4.2 perseant * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 1.2.4.2 perseant * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 1.2.4.2 perseant * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 1.2.4.2 perseant * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 1.2.4.2 perseant */
18 1.2.4.2 perseant
19 1.2.4.2 perseant #ifndef _UMCPMIO_IO_H_
20 1.2.4.2 perseant #define _UMCPMIO_IO_H_
21 1.2.4.2 perseant
22 1.2.4.2 perseant #include <sys/types.h>
23 1.2.4.2 perseant
24 1.2.4.2 perseant #include <sys/ioccom.h>
25 1.2.4.2 perseant
26 1.2.4.2 perseant #include <dev/usb/umcpmio_hid_reports.h>
27 1.2.4.2 perseant
28 1.2.4.2 perseant struct umcpmio_ioctl_get_flash {
29 1.2.4.2 perseant uint8_t subcode;
30 1.2.4.2 perseant struct mcp2221_get_flash_res get_flash_res;
31 1.2.4.2 perseant };
32 1.2.4.2 perseant
33 1.2.4.2 perseant struct umcpmio_ioctl_put_flash {
34 1.2.4.2 perseant uint8_t subcode;
35 1.2.4.2 perseant struct mcp2221_put_flash_req put_flash_req;
36 1.2.4.2 perseant struct mcp2221_put_flash_res put_flash_res;
37 1.2.4.2 perseant };
38 1.2.4.2 perseant
39 1.2.4.2 perseant #define UMCPMIO_GET_STATUS _IOR('m', 1, struct mcp2221_status_res)
40 1.2.4.2 perseant #define UMCPMIO_GET_SRAM _IOR('m', 2, struct mcp2221_get_sram_res)
41 1.2.4.2 perseant #define UMCPMIO_GET_GP_CFG _IOR('m', 3, struct mcp2221_get_gpio_cfg_res)
42 1.2.4.2 perseant #define UMCPMIO_GET_FLASH _IOWR('m', 4, struct umcpmio_ioctl_get_flash)
43 1.2.4.2 perseant #define UMCPMIO_PUT_FLASH _IOWR('m', 5, struct umcpmio_ioctl_put_flash)
44 1.2.4.2 perseant
45 1.2.4.2 perseant #endif /* _UMCPMIO_IO_H_ */
46