aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/reset-controller.h
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2012-11-19 11:23:13 -0500
committerPhilipp Zabel <p.zabel@pengutronix.de>2013-04-12 04:26:23 -0400
commit61fc41317666be400802ac793f47de816ef7bd57 (patch)
treeec7e7f11ca78aec2d861190c19279fb7653e64b9 /include/linux/reset-controller.h
parent4e11f848c65b1c87782cb232a6e3b47a9d4c1f98 (diff)
reset: Add reset controller API
This adds a simple API for devices to request being reset by separate reset controller hardware and implements the reset signal device tree binding. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Shawn Guo <shawn.guo@linaro.org> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'include/linux/reset-controller.h')
-rw-r--r--include/linux/reset-controller.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/include/linux/reset-controller.h b/include/linux/reset-controller.h
new file mode 100644
index 000000000000..2f61311ae3e0
--- /dev/null
+++ b/include/linux/reset-controller.h
@@ -0,0 +1,51 @@
1#ifndef _LINUX_RESET_CONTROLLER_H_
2#define _LINUX_RESET_CONTROLLER_H_
3
4#include <linux/list.h>
5
6struct reset_controller_dev;
7
8/**
9 * struct reset_control_ops
10 *
11 * @reset: for self-deasserting resets, does all necessary
12 * things to reset the device
13 * @assert: manually assert the reset line, if supported
14 * @deassert: manually deassert the reset line, if supported
15 */
16struct reset_control_ops {
17 int (*reset)(struct reset_controller_dev *rcdev, unsigned long id);
18 int (*assert)(struct reset_controller_dev *rcdev, unsigned long id);
19 int (*deassert)(struct reset_controller_dev *rcdev, unsigned long id);
20};
21
22struct module;
23struct device_node;
24
25/**
26 * struct reset_controller_dev - reset controller entity that might
27 * provide multiple reset controls
28 * @ops: a pointer to device specific struct reset_control_ops
29 * @owner: kernel module of the reset controller driver
30 * @list: internal list of reset controller devices
31 * @of_node: corresponding device tree node as phandle target
32 * @of_reset_n_cells: number of cells in reset line specifiers
33 * @of_xlate: translation function to translate from specifier as found in the
34 * device tree to id as given to the reset control ops
35 * @nr_resets: number of reset controls in this reset controller device
36 */
37struct reset_controller_dev {
38 struct reset_control_ops *ops;
39 struct module *owner;
40 struct list_head list;
41 struct device_node *of_node;
42 int of_reset_n_cells;
43 int (*of_xlate)(struct reset_controller_dev *rcdev,
44 const struct of_phandle_args *reset_spec);
45 unsigned int nr_resets;
46};
47
48int reset_controller_register(struct reset_controller_dev *rcdev);
49void reset_controller_unregister(struct reset_controller_dev *rcdev);
50
51#endif