printf: Remove unused 'bprintf'
[drm/drm-misc.git] / drivers / nvmem / internals.h
blob18fed57270e5e3391cf24d5e49836121a53a8cd6
1 /* SPDX-License-Identifier: GPL-2.0 */
3 #ifndef _LINUX_NVMEM_INTERNALS_H
4 #define _LINUX_NVMEM_INTERNALS_H
6 #include <linux/device.h>
7 #include <linux/nvmem-consumer.h>
8 #include <linux/nvmem-provider.h>
10 struct nvmem_device {
11 struct module *owner;
12 struct device dev;
13 struct list_head node;
14 int stride;
15 int word_size;
16 int id;
17 struct kref refcnt;
18 size_t size;
19 bool read_only;
20 bool root_only;
21 int flags;
22 enum nvmem_type type;
23 struct bin_attribute eeprom;
24 struct device *base_dev;
25 struct list_head cells;
26 void (*fixup_dt_cell_info)(struct nvmem_device *nvmem,
27 struct nvmem_cell_info *cell);
28 const struct nvmem_keepout *keepout;
29 unsigned int nkeepout;
30 nvmem_reg_read_t reg_read;
31 nvmem_reg_write_t reg_write;
32 struct gpio_desc *wp_gpio;
33 struct nvmem_layout *layout;
34 void *priv;
35 bool sysfs_cells_populated;
38 #if IS_ENABLED(CONFIG_OF)
39 int nvmem_layout_bus_register(void);
40 void nvmem_layout_bus_unregister(void);
41 int nvmem_populate_layout(struct nvmem_device *nvmem);
42 void nvmem_destroy_layout(struct nvmem_device *nvmem);
43 #else /* CONFIG_OF */
44 static inline int nvmem_layout_bus_register(void)
46 return 0;
49 static inline void nvmem_layout_bus_unregister(void) {}
51 static inline int nvmem_populate_layout(struct nvmem_device *nvmem)
53 return 0;
56 static inline void nvmem_destroy_layout(struct nvmem_device *nvmem) { }
57 #endif /* CONFIG_OF */
59 #endif /* ifndef _LINUX_NVMEM_INTERNALS_H */