xref: /haiku/src/add-ons/kernel/bus_managers/mmc/mmc_bus.h (revision 99158cceddacb52ebe30708c4e6a27b4fb711c8f)
1 /*
2  * Copyright 2018 Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		B Krishnan Iyer, krishnaniyer97@gmail.com
7  */
8 #ifndef MMC_BUS_H
9 #define MMC_BUS_H
10 
11 
12 #include <new>
13 #include <stdio.h>
14 #include <string.h>
15 
16 #include <lock.h>
17 #include <util/AutoLock.h>
18 #include "../../busses/mmc/sdhci_pci.h"
19 
20 
21 #define MMCBUS_TRACE
22 #ifdef MMCBUS_TRACE
23 #	define TRACE(x...)		dprintf("\33[33mmmc_bus:\33[0m " x)
24 #else
25 #	define TRACE(x...)
26 #endif
27 #define TRACE_ALWAYS(x...)	dprintf("\33[33mmmc_bus:\33[0m " x)
28 #define ERROR(x...)			dprintf("\33[33mmmc_bus:\33[0m " x)
29 #define CALLED() 			TRACE("CALLED %s\n", __PRETTY_FUNCTION__)
30 
31 extern device_manager_info *gDeviceManager;
32 
33 
34 class MMCBus;
35 
36 class MMCBus {
37 public:
38 
39 			MMCBus(device_node *node);
40 			~MMCBus();
41 			status_t InitCheck();
42 
43 private:
44 
45 		device_node* 				fNode;
46 		sdhci_mmc_bus_interface* 	fController;
47 		void* 						fCookie;
48 		status_t					fStatus;
49 		void*						fDriverCookie;
50 };
51 
52 
53 #endif /*MMC_BUS_H*/