xref: /openbmc/linux/drivers/nvdimm/nd.h (revision 4d88a97aa9e8cfa6460aab119c5da60ad2267423)
1 /*
2  * Copyright(c) 2013-2015 Intel Corporation. All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of version 2 of the GNU General Public License as
6  * published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * General Public License for more details.
12  */
13 #ifndef __ND_H__
14 #define __ND_H__
15 #include <linux/device.h>
16 #include <linux/mutex.h>
17 #include <linux/ndctl.h>
18 
19 struct nvdimm_drvdata {
20 	struct device *dev;
21 	struct nd_cmd_get_config_size nsarea;
22 	void *data;
23 };
24 
25 enum nd_async_mode {
26 	ND_SYNC,
27 	ND_ASYNC,
28 };
29 
30 void nd_device_register(struct device *dev);
31 void nd_device_unregister(struct device *dev, enum nd_async_mode mode);
32 int __init nvdimm_init(void);
33 void nvdimm_exit(void);
34 int nvdimm_init_nsarea(struct nvdimm_drvdata *ndd);
35 int nvdimm_init_config_data(struct nvdimm_drvdata *ndd);
36 #endif /* __ND_H__ */
37