Dan Williams | 51cf784 | 2017-07-12 17:58:21 -0700 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | /* Copyright(c) 2016 - 2018 Intel Corporation. All rights reserved. */ |
| 3 | #ifndef __DAX_BUS_H__ |
| 4 | #define __DAX_BUS_H__ |
| 5 | struct device; |
| 6 | struct dev_dax; |
| 7 | struct resource; |
| 8 | struct dax_device; |
| 9 | struct dax_region; |
| 10 | void dax_region_put(struct dax_region *dax_region); |
| 11 | struct dax_region *alloc_dax_region(struct device *parent, int region_id, |
| 12 | struct resource *res, unsigned int align, unsigned long flags); |
Dan Williams | 89ec9f2 | 2018-10-29 15:52:42 -0700 | [diff] [blame] | 13 | struct dev_dax *devm_create_dev_dax(struct dax_region *dax_region, int id, |
| 14 | struct dev_pagemap *pgmap); |
Dan Williams | d200781 | 2018-11-07 15:31:23 -0800 | [diff] [blame^] | 15 | |
| 16 | struct dax_device_driver { |
| 17 | struct device_driver drv; |
| 18 | struct list_head ids; |
| 19 | int match_always; |
| 20 | }; |
| 21 | |
| 22 | int __dax_driver_register(struct dax_device_driver *dax_drv, |
Dan Williams | 9567da0 | 2017-07-12 17:58:21 -0700 | [diff] [blame] | 23 | struct module *module, const char *mod_name); |
| 24 | #define dax_driver_register(driver) \ |
| 25 | __dax_driver_register(driver, THIS_MODULE, KBUILD_MODNAME) |
Dan Williams | d200781 | 2018-11-07 15:31:23 -0800 | [diff] [blame^] | 26 | void dax_driver_unregister(struct dax_device_driver *dax_drv); |
Dan Williams | 51cf784 | 2017-07-12 17:58:21 -0700 | [diff] [blame] | 27 | void kill_dev_dax(struct dev_dax *dev_dax); |
Dan Williams | 9567da0 | 2017-07-12 17:58:21 -0700 | [diff] [blame] | 28 | |
| 29 | /* |
| 30 | * While run_dax() is potentially a generic operation that could be |
| 31 | * defined in include/linux/dax.h we don't want to grow any users |
| 32 | * outside of drivers/dax/ |
| 33 | */ |
| 34 | void run_dax(struct dax_device *dax_dev); |
| 35 | |
| 36 | #define MODULE_ALIAS_DAX_DEVICE(type) \ |
| 37 | MODULE_ALIAS("dax:t" __stringify(type) "*") |
| 38 | #define DAX_DEVICE_MODALIAS_FMT "dax:t%d" |
| 39 | |
Dan Williams | 51cf784 | 2017-07-12 17:58:21 -0700 | [diff] [blame] | 40 | #endif /* __DAX_BUS_H__ */ |