Blame view
include/linux/reset-controller.h
3.09 KB
b24413180 License cleanup: ... |
1 |
/* SPDX-License-Identifier: GPL-2.0 */ |
61fc41317 reset: Add reset ... |
2 3 4 5 6 7 8 9 |
#ifndef _LINUX_RESET_CONTROLLER_H_ #define _LINUX_RESET_CONTROLLER_H_ #include <linux/list.h> struct reset_controller_dev; /** |
f430c7ed8 reset: fix reset_... |
10 |
* struct reset_control_ops - reset controller driver callbacks |
61fc41317 reset: Add reset ... |
11 12 13 14 15 |
* * @reset: for self-deasserting resets, does all necessary * things to reset the device * @assert: manually assert the reset line, if supported * @deassert: manually deassert the reset line, if supported |
729de41ba reset: add reset_... |
16 |
* @status: return the status of the reset line, if supported |
61fc41317 reset: Add reset ... |
17 18 19 20 21 |
*/ struct reset_control_ops { int (*reset)(struct reset_controller_dev *rcdev, unsigned long id); int (*assert)(struct reset_controller_dev *rcdev, unsigned long id); int (*deassert)(struct reset_controller_dev *rcdev, unsigned long id); |
729de41ba reset: add reset_... |
22 |
int (*status)(struct reset_controller_dev *rcdev, unsigned long id); |
61fc41317 reset: Add reset ... |
23 24 25 26 |
}; struct module; struct device_node; |
d0d44dd4a reset: Silence wa... |
27 |
struct of_phandle_args; |
61fc41317 reset: Add reset ... |
28 29 |
/** |
6691dffab reset: add suppor... |
30 31 32 |
* struct reset_control_lookup - represents a single lookup entry * * @list: internal list of all reset lookup entries |
e2749bb99 reset: modify the... |
33 |
* @provider: name of the reset controller device controlling this reset line |
6691dffab reset: add suppor... |
34 35 |
* @index: ID of the reset controller in the reset controller device * @dev_id: name of the device associated with this reset line |
ed713ce24 reset: fix reset_... |
36 |
* @con_id: name of the reset line (can be NULL) |
6691dffab reset: add suppor... |
37 38 39 |
*/ struct reset_control_lookup { struct list_head list; |
e2749bb99 reset: modify the... |
40 |
const char *provider; |
6691dffab reset: add suppor... |
41 42 43 44 |
unsigned int index; const char *dev_id; const char *con_id; }; |
e2749bb99 reset: modify the... |
45 |
#define RESET_LOOKUP(_provider, _index, _dev_id, _con_id) \ |
6691dffab reset: add suppor... |
46 |
{ \ |
e2749bb99 reset: modify the... |
47 48 |
.provider = _provider, \ .index = _index, \ |
6691dffab reset: add suppor... |
49 50 |
.dev_id = _dev_id, \ .con_id = _con_id, \ |
6691dffab reset: add suppor... |
51 52 53 |
} /** |
61fc41317 reset: Add reset ... |
54 55 56 57 58 |
* struct reset_controller_dev - reset controller entity that might * provide multiple reset controls * @ops: a pointer to device specific struct reset_control_ops * @owner: kernel module of the reset controller driver * @list: internal list of reset controller devices |
c15ddec2c reset: Share stru... |
59 |
* @reset_control_head: head of internal list of requested reset controls |
e2749bb99 reset: modify the... |
60 |
* @dev: corresponding driver model device struct |
61fc41317 reset: Add reset ... |
61 62 63 |
* @of_node: corresponding device tree node as phandle target * @of_reset_n_cells: number of cells in reset line specifiers * @of_xlate: translation function to translate from specifier as found in the |
a48108c0c reset: improve of... |
64 65 |
* device tree to id as given to the reset control ops, defaults * to :c:func:`of_reset_simple_xlate`. |
61fc41317 reset: Add reset ... |
66 67 68 |
* @nr_resets: number of reset controls in this reset controller device */ struct reset_controller_dev { |
203d4f347 reset: Make reset... |
69 |
const struct reset_control_ops *ops; |
61fc41317 reset: Add reset ... |
70 71 |
struct module *owner; struct list_head list; |
c15ddec2c reset: Share stru... |
72 |
struct list_head reset_control_head; |
e2749bb99 reset: modify the... |
73 |
struct device *dev; |
61fc41317 reset: Add reset ... |
74 75 76 77 78 79 80 81 82 |
struct device_node *of_node; int of_reset_n_cells; int (*of_xlate)(struct reset_controller_dev *rcdev, const struct of_phandle_args *reset_spec); unsigned int nr_resets; }; int reset_controller_register(struct reset_controller_dev *rcdev); void reset_controller_unregister(struct reset_controller_dev *rcdev); |
8d5b5d5ce reset: add devm_r... |
83 84 85 |
struct device; int devm_reset_controller_register(struct device *dev, struct reset_controller_dev *rcdev); |
e2749bb99 reset: modify the... |
86 |
void reset_controller_add_lookup(struct reset_control_lookup *lookup, |
6691dffab reset: add suppor... |
87 |
unsigned int num_entries); |
61fc41317 reset: Add reset ... |
88 |
#endif |