~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/reset-controller.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _LINUX_RESET_CONTROLLER_H_
  3 #define _LINUX_RESET_CONTROLLER_H_
  4 
  5 #include <linux/list.h>
  6 
  7 struct reset_controller_dev;
  8 
  9 /**
 10  * struct reset_control_ops - reset controller driver callbacks
 11  *
 12  * @reset: for self-deasserting resets, does all necessary
 13  *         things to reset the device
 14  * @assert: manually assert the reset line, if supported
 15  * @deassert: manually deassert the reset line, if supported
 16  * @status: return the status of the reset line, if supported
 17  */
 18 struct reset_control_ops {
 19         int (*reset)(struct reset_controller_dev *rcdev, unsigned long id);
 20         int (*assert)(struct reset_controller_dev *rcdev, unsigned long id);
 21         int (*deassert)(struct reset_controller_dev *rcdev, unsigned long id);
 22         int (*status)(struct reset_controller_dev *rcdev, unsigned long id);
 23 };
 24 
 25 struct module;
 26 struct device_node;
 27 struct of_phandle_args;
 28 
 29 /**
 30  * struct reset_control_lookup - represents a single lookup entry
 31  *
 32  * @list: internal list of all reset lookup entries
 33  * @provider: name of the reset controller device controlling this reset line
 34  * @index: ID of the reset controller in the reset controller device
 35  * @dev_id: name of the device associated with this reset line
 36  * @con_id: name of the reset line (can be NULL)
 37  */
 38 struct reset_control_lookup {
 39         struct list_head list;
 40         const char *provider;
 41         unsigned int index;
 42         const char *dev_id;
 43         const char *con_id;
 44 };
 45 
 46 #define RESET_LOOKUP(_provider, _index, _dev_id, _con_id)               \
 47         {                                                               \
 48                 .provider = _provider,                                  \
 49                 .index = _index,                                        \
 50                 .dev_id = _dev_id,                                      \
 51                 .con_id = _con_id,                                      \
 52         }
 53 
 54 /**
 55  * struct reset_controller_dev - reset controller entity that might
 56  *                               provide multiple reset controls
 57  * @ops: a pointer to device specific struct reset_control_ops
 58  * @owner: kernel module of the reset controller driver
 59  * @list: internal list of reset controller devices
 60  * @reset_control_head: head of internal list of requested reset controls
 61  * @dev: corresponding driver model device struct
 62  * @of_node: corresponding device tree node as phandle target
 63  * @of_args: for reset-gpios controllers: corresponding phandle args with
 64  *           of_node and GPIO number complementing of_node; either this or
 65  *           of_node should be present
 66  * @of_reset_n_cells: number of cells in reset line specifiers
 67  * @of_xlate: translation function to translate from specifier as found in the
 68  *            device tree to id as given to the reset control ops, defaults
 69  *            to :c:func:`of_reset_simple_xlate`.
 70  * @nr_resets: number of reset controls in this reset controller device
 71  */
 72 struct reset_controller_dev {
 73         const struct reset_control_ops *ops;
 74         struct module *owner;
 75         struct list_head list;
 76         struct list_head reset_control_head;
 77         struct device *dev;
 78         struct device_node *of_node;
 79         const struct of_phandle_args *of_args;
 80         int of_reset_n_cells;
 81         int (*of_xlate)(struct reset_controller_dev *rcdev,
 82                         const struct of_phandle_args *reset_spec);
 83         unsigned int nr_resets;
 84 };
 85 
 86 #if IS_ENABLED(CONFIG_RESET_CONTROLLER)
 87 int reset_controller_register(struct reset_controller_dev *rcdev);
 88 void reset_controller_unregister(struct reset_controller_dev *rcdev);
 89 
 90 struct device;
 91 int devm_reset_controller_register(struct device *dev,
 92                                    struct reset_controller_dev *rcdev);
 93 
 94 void reset_controller_add_lookup(struct reset_control_lookup *lookup,
 95                                  unsigned int num_entries);
 96 #else
 97 static inline int reset_controller_register(struct reset_controller_dev *rcdev)
 98 {
 99         return 0;
100 }
101 
102 static inline void reset_controller_unregister(struct reset_controller_dev *rcdev)
103 {
104 }
105 
106 static inline int devm_reset_controller_register(struct device *dev,
107                                                  struct reset_controller_dev *rcdev)
108 {
109         return 0;
110 }
111 
112 static inline void reset_controller_add_lookup(struct reset_control_lookup *lookup,
113                                                unsigned int num_entries)
114 {
115 }
116 #endif
117 
118 #endif
119 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php