xref: /haiku/headers/private/drivers/mmc.h (revision ad2226790662c78e979960a0c7237cf4b5a6fad2)
1 /*
2  * Copyright 2019, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Adrien Destugues, pulkomandy@pulkomandy.tk
7  */
8 #ifndef _MMC_H
9 #define _MMC_H
10 
11 
12 #include <device_manager.h>
13 
14 
15 #define MMC_BUS_MODULE_NAME "bus_managers/mmc_bus/driver_v1"
16 
17 
18 enum {
19 	CARD_TYPE_MMC,
20 	CARD_TYPE_SD,
21 	CARD_TYPE_SDHC,
22 	CARD_TYPE_UHS1,
23 	CARD_TYPE_UHS2,
24 	CARD_TYPE_SDIO
25 };
26 
27 
28 // Interface between mmc_bus and underlying implementation
29 typedef struct mmc_bus_interface {
30 	driver_module_info info;
31 
32 	status_t (*set_clock)(void* controller, uint32_t kilohertz);
33 	status_t (*execute_command)(void* controller, uint8_t command,
34 		uint32_t argument, uint32_t* result);
35 } mmc_bus_interface;
36 
37 
38 // Interface between mmc device driver (mmc_disk, sdio drivers, ...) and mmc_bus
39 typedef struct mmc_device_interface {
40 	driver_module_info info;
41 
42 	status_t (*execute_command)(device_node* node, uint8_t command,
43 		uint32_t argument, uint32_t* result);
44 } mmc_device_interface;
45 
46 
47 #endif /* _MMC_H */
48