|
2 | 2 | * Core registration and callback routines for MTD |
3 | 3 | * drivers and users. |
4 | 4 | * |
| 5 | + * bdi bits are: |
| 6 | + * Copyright © 2006 Red Hat, Inc. All Rights Reserved. |
| 7 | + * Written by David Howells (dhowells@redhat.com) |
5 | 8 | */ |
6 | 9 |
|
7 | 10 | #include <linux/module.h> |
|
16 | 19 | #include <linux/init.h> |
17 | 20 | #include <linux/mtd/compatmac.h> |
18 | 21 | #include <linux/proc_fs.h> |
| 22 | +#include <linux/backing-dev.h> |
19 | 23 |
|
20 | 24 | #include <linux/mtd/mtd.h> |
21 | | -#include "internal.h" |
22 | 25 |
|
23 | 26 | #include "mtdcore.h" |
| 27 | +/* |
| 28 | + * backing device capabilities for non-mappable devices (such as NAND flash) |
| 29 | + * - permits private mappings, copies are taken of the data |
| 30 | + */ |
| 31 | +struct backing_dev_info mtd_bdi_unmappable = { |
| 32 | + .capabilities = BDI_CAP_MAP_COPY, |
| 33 | +}; |
| 34 | + |
| 35 | +/* |
| 36 | + * backing device capabilities for R/O mappable devices (such as ROM) |
| 37 | + * - permits private mappings, copies are taken of the data |
| 38 | + * - permits non-writable shared mappings |
| 39 | + */ |
| 40 | +struct backing_dev_info mtd_bdi_ro_mappable = { |
| 41 | + .capabilities = (BDI_CAP_MAP_COPY | BDI_CAP_MAP_DIRECT | |
| 42 | + BDI_CAP_EXEC_MAP | BDI_CAP_READ_MAP), |
| 43 | +}; |
| 44 | + |
| 45 | +/* |
| 46 | + * backing device capabilities for writable mappable devices (such as RAM) |
| 47 | + * - permits private mappings, copies are taken of the data |
| 48 | + * - permits non-writable shared mappings |
| 49 | + */ |
| 50 | +struct backing_dev_info mtd_bdi_rw_mappable = { |
| 51 | + .capabilities = (BDI_CAP_MAP_COPY | BDI_CAP_MAP_DIRECT | |
| 52 | + BDI_CAP_EXEC_MAP | BDI_CAP_READ_MAP | |
| 53 | + BDI_CAP_WRITE_MAP), |
| 54 | +}; |
24 | 55 |
|
25 | 56 | static int mtd_cls_suspend(struct device *dev, pm_message_t state); |
26 | 57 | static int mtd_cls_resume(struct device *dev); |
|
0 commit comments