2 * Copyright (c) 2016, NVIDIA CORPORATION.
4 * SPDX-License-Identifier: GPL-2.0
7 #ifndef _RESET_UCLASS_H
8 #define _RESET_UCLASS_H
10 /* See reset.h for background documentation. */
14 struct fdtdec_phandle_args;
18 * struct reset_ops - The functions that a reset controller driver must
23 * of_xlate - Translate a client's device-tree (OF) reset specifier.
25 * The reset core calls this function as the first step in implementing
26 * a client's reset_get_by_*() call.
28 * If this function pointer is set to NULL, the reset core will use a
29 * default implementation, which assumes #reset-cells = <1>, and that
30 * the DT cell contains a simple integer reset signal ID.
32 * At present, the reset API solely supports device-tree. If this
33 * changes, other xxx_xlate() functions may be added to support those
36 * @reset_ctl: The reset control struct to hold the translation result.
37 * @args: The reset specifier values from device tree.
38 * @return 0 if OK, or a negative error code.
40 int (*of_xlate)(struct reset_ctl *reset_ctl,
41 struct fdtdec_phandle_args *args);
43 * request - Request a translated reset control.
45 * The reset core calls this function as the second step in
46 * implementing a client's reset_get_by_*() call, following a
47 * successful xxx_xlate() call.
49 * @reset_ctl: The reset control struct to request; this has been
50 * filled in by a previoux xxx_xlate() function call.
51 * @return 0 if OK, or a negative error code.
53 int (*request)(struct reset_ctl *reset_ctl);
55 * free - Free a previously requested reset control.
57 * This is the implementation of the client reset_free() API.
59 * @reset_ctl: The reset control to free.
60 * @return 0 if OK, or a negative error code.
62 int (*free)(struct reset_ctl *reset_ctl);
64 * rst_assert - Assert a reset signal.
66 * Note: This function is named rst_assert not assert to avoid
67 * conflicting with global macro assert().
69 * @reset_ctl: The reset signal to assert.
70 * @return 0 if OK, or a negative error code.
72 int (*rst_assert)(struct reset_ctl *reset_ctl);
74 * rst_deassert - Deassert a reset signal.
76 * @reset_ctl: The reset signal to deassert.
77 * @return 0 if OK, or a negative error code.
79 int (*rst_deassert)(struct reset_ctl *reset_ctl);