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

TOMOYO Linux Cross Reference
Linux/include/linux/framer/framer.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/linux/framer/framer.h (Version linux-6.12-rc7) and /include/linux/framer/framer.h (Version linux-6.10.14)


  1 /* SPDX-License-Identifier: GPL-2.0-or-later *      1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*                                                  2 /*
  3  * Generic framer header file                       3  * Generic framer header file
  4  *                                                  4  *
  5  * Copyright 2023 CS GROUP France                   5  * Copyright 2023 CS GROUP France
  6  *                                                  6  *
  7  * Author: Herve Codina <herve.codina@bootlin.      7  * Author: Herve Codina <herve.codina@bootlin.com>
  8  */                                                 8  */
  9                                                     9 
 10 #ifndef __DRIVERS_FRAMER_H                         10 #ifndef __DRIVERS_FRAMER_H
 11 #define __DRIVERS_FRAMER_H                         11 #define __DRIVERS_FRAMER_H
 12                                                    12 
 13 #include <linux/err.h>                             13 #include <linux/err.h>
 14 #include <linux/mutex.h>                           14 #include <linux/mutex.h>
 15 #include <linux/notifier.h>                        15 #include <linux/notifier.h>
 16 #include <linux/of.h>                              16 #include <linux/of.h>
 17 #include <linux/device.h>                          17 #include <linux/device.h>
 18 #include <linux/workqueue.h>                       18 #include <linux/workqueue.h>
 19                                                    19 
 20 /**                                                20 /**
 21  * enum framer_iface - Framer interface            21  * enum framer_iface - Framer interface
 22  * @FRAMER_IFACE_E1: E1 interface                  22  * @FRAMER_IFACE_E1: E1 interface
 23  * @FRAMER_IFACE_T1: T1 interface                  23  * @FRAMER_IFACE_T1: T1 interface
 24  */                                                24  */
 25 enum framer_iface {                                25 enum framer_iface {
 26         FRAMER_IFACE_E1,                           26         FRAMER_IFACE_E1,
 27         FRAMER_IFACE_T1,                           27         FRAMER_IFACE_T1,
 28 };                                                 28 };
 29                                                    29 
 30 /**                                                30 /**
 31  * enum framer_clock_type - Framer clock type      31  * enum framer_clock_type - Framer clock type
 32  * @FRAMER_CLOCK_EXT: External clock               32  * @FRAMER_CLOCK_EXT: External clock
 33  * @FRAMER_CLOCK_INT: Internal clock               33  * @FRAMER_CLOCK_INT: Internal clock
 34  */                                                34  */
 35 enum framer_clock_type {                           35 enum framer_clock_type {
 36         FRAMER_CLOCK_EXT,                          36         FRAMER_CLOCK_EXT,
 37         FRAMER_CLOCK_INT,                          37         FRAMER_CLOCK_INT,
 38 };                                                 38 };
 39                                                    39 
 40 /**                                                40 /**
 41  * struct framer_config - Framer configuration     41  * struct framer_config - Framer configuration
 42  * @iface: Framer line interface                   42  * @iface: Framer line interface
 43  * @clock_type: Framer clock type                  43  * @clock_type: Framer clock type
 44  * @line_clock_rate: Framer line clock rate        44  * @line_clock_rate: Framer line clock rate
 45  */                                                45  */
 46 struct framer_config {                             46 struct framer_config {
 47         enum framer_iface iface;                   47         enum framer_iface iface;
 48         enum framer_clock_type clock_type;         48         enum framer_clock_type clock_type;
 49         unsigned long line_clock_rate;             49         unsigned long line_clock_rate;
 50 };                                                 50 };
 51                                                    51 
 52 /**                                                52 /**
 53  * struct framer_status - Framer status            53  * struct framer_status - Framer status
 54  * @link_is_on: Framer link state. true, the l     54  * @link_is_on: Framer link state. true, the link is on, false, the link is off.
 55  */                                                55  */
 56 struct framer_status {                             56 struct framer_status {
 57         bool link_is_on;                           57         bool link_is_on;
 58 };                                                 58 };
 59                                                    59 
 60 /**                                                60 /**
 61  * enum framer_event - Event available for not     61  * enum framer_event - Event available for notification
 62  * @FRAMER_EVENT_STATUS: Event notified on fra     62  * @FRAMER_EVENT_STATUS: Event notified on framer_status changes
 63  */                                                63  */
 64 enum framer_event {                                64 enum framer_event {
 65         FRAMER_EVENT_STATUS,                       65         FRAMER_EVENT_STATUS,
 66 };                                                 66 };
 67                                                    67 
 68 /**                                                68 /**
 69  * struct framer - represents the framer devic     69  * struct framer - represents the framer device
 70  * @dev: framer device                             70  * @dev: framer device
 71  * @id: id of the framer device                    71  * @id: id of the framer device
 72  * @ops: function pointers for performing fram     72  * @ops: function pointers for performing framer operations
 73  * @mutex: mutex to protect framer_ops             73  * @mutex: mutex to protect framer_ops
 74  * @init_count: used to protect when the frame     74  * @init_count: used to protect when the framer is used by multiple consumers
 75  * @power_count: used to protect when the fram     75  * @power_count: used to protect when the framer is used by multiple consumers
 76  * @pwr: power regulator associated with the f     76  * @pwr: power regulator associated with the framer
 77  * @notify_status_work: work structure used fo     77  * @notify_status_work: work structure used for status notifications
 78  * @notifier_list: notifier list used for noti     78  * @notifier_list: notifier list used for notifications
 79  * @polling_work: delayed work structure used      79  * @polling_work: delayed work structure used for the polling task
 80  * @prev_status: previous read status used by      80  * @prev_status: previous read status used by the polling task to detect changes
 81  */                                                81  */
 82 struct framer {                                    82 struct framer {
 83         struct device                   dev;       83         struct device                   dev;
 84         int                             id;        84         int                             id;
 85         const struct framer_ops         *ops;      85         const struct framer_ops         *ops;
 86         struct mutex                    mutex;     86         struct mutex                    mutex;  /* Protect framer */
 87         int                             init_c     87         int                             init_count;
 88         int                             power_     88         int                             power_count;
 89         struct regulator                *pwr;      89         struct regulator                *pwr;
 90         struct work_struct              notify     90         struct work_struct              notify_status_work;
 91         struct blocking_notifier_head   notifi     91         struct blocking_notifier_head   notifier_list;
 92         struct delayed_work             pollin     92         struct delayed_work             polling_work;
 93         struct framer_status            prev_s     93         struct framer_status            prev_status;
 94 };                                                 94 };
 95                                                    95 
 96 #if IS_ENABLED(CONFIG_GENERIC_FRAMER)              96 #if IS_ENABLED(CONFIG_GENERIC_FRAMER)
 97 int framer_pm_runtime_get(struct framer *frame     97 int framer_pm_runtime_get(struct framer *framer);
 98 int framer_pm_runtime_get_sync(struct framer *     98 int framer_pm_runtime_get_sync(struct framer *framer);
 99 int framer_pm_runtime_put(struct framer *frame     99 int framer_pm_runtime_put(struct framer *framer);
100 int framer_pm_runtime_put_sync(struct framer *    100 int framer_pm_runtime_put_sync(struct framer *framer);
101 int framer_init(struct framer *framer);           101 int framer_init(struct framer *framer);
102 int framer_exit(struct framer *framer);           102 int framer_exit(struct framer *framer);
103 int framer_power_on(struct framer *framer);       103 int framer_power_on(struct framer *framer);
104 int framer_power_off(struct framer *framer);      104 int framer_power_off(struct framer *framer);
105 int framer_get_status(struct framer *framer, s    105 int framer_get_status(struct framer *framer, struct framer_status *status);
106 int framer_get_config(struct framer *framer, s    106 int framer_get_config(struct framer *framer, struct framer_config *config);
107 int framer_set_config(struct framer *framer, c    107 int framer_set_config(struct framer *framer, const struct framer_config *config);
108 int framer_notifier_register(struct framer *fr    108 int framer_notifier_register(struct framer *framer, struct notifier_block *nb);
109 int framer_notifier_unregister(struct framer *    109 int framer_notifier_unregister(struct framer *framer, struct notifier_block *nb);
110                                                   110 
111 struct framer *framer_get(struct device *dev,     111 struct framer *framer_get(struct device *dev, const char *con_id);
112 void framer_put(struct device *dev, struct fra    112 void framer_put(struct device *dev, struct framer *framer);
113                                                   113 
114 struct framer *devm_framer_get(struct device *    114 struct framer *devm_framer_get(struct device *dev, const char *con_id);
115 struct framer *devm_framer_optional_get(struct    115 struct framer *devm_framer_optional_get(struct device *dev, const char *con_id);
116 #else                                             116 #else
117 static inline int framer_pm_runtime_get(struct    117 static inline int framer_pm_runtime_get(struct framer *framer)
118 {                                                 118 {
119         return -ENOSYS;                           119         return -ENOSYS;
120 }                                                 120 }
121                                                   121 
122 static inline int framer_pm_runtime_get_sync(s    122 static inline int framer_pm_runtime_get_sync(struct framer *framer)
123 {                                                 123 {
124         return -ENOSYS;                           124         return -ENOSYS;
125 }                                                 125 }
126                                                   126 
127 static inline int framer_pm_runtime_put(struct    127 static inline int framer_pm_runtime_put(struct framer *framer)
128 {                                                 128 {
129         return -ENOSYS;                           129         return -ENOSYS;
130 }                                                 130 }
131                                                   131 
132 static inline int framer_pm_runtime_put_sync(s    132 static inline int framer_pm_runtime_put_sync(struct framer *framer)
133 {                                                 133 {
134         return -ENOSYS;                           134         return -ENOSYS;
135 }                                                 135 }
136                                                   136 
137 static inline int framer_init(struct framer *f    137 static inline int framer_init(struct framer *framer)
138 {                                                 138 {
139         return -ENOSYS;                           139         return -ENOSYS;
140 }                                                 140 }
141                                                   141 
142 static inline int framer_exit(struct framer *f    142 static inline int framer_exit(struct framer *framer)
143 {                                                 143 {
144         return -ENOSYS;                           144         return -ENOSYS;
145 }                                                 145 }
146                                                   146 
147 static inline int framer_power_on(struct frame    147 static inline int framer_power_on(struct framer *framer)
148 {                                                 148 {
149         return -ENOSYS;                           149         return -ENOSYS;
150 }                                                 150 }
151                                                   151 
152 static inline int framer_power_off(struct fram    152 static inline int framer_power_off(struct framer *framer)
153 {                                                 153 {
154         return -ENOSYS;                           154         return -ENOSYS;
155 }                                                 155 }
156                                                   156 
157 static inline int framer_get_status(struct fra    157 static inline int framer_get_status(struct framer *framer, struct framer_status *status)
158 {                                                 158 {
159         return -ENOSYS;                           159         return -ENOSYS;
160 }                                                 160 }
161                                                   161 
162 static inline int framer_get_config(struct fra    162 static inline int framer_get_config(struct framer *framer, struct framer_config *config)
163 {                                                 163 {
164         return -ENOSYS;                           164         return -ENOSYS;
165 }                                                 165 }
166                                                   166 
167 static inline int framer_set_config(struct fra    167 static inline int framer_set_config(struct framer *framer, const struct framer_config *config)
168 {                                                 168 {
169         return -ENOSYS;                           169         return -ENOSYS;
170 }                                                 170 }
171                                                   171 
172 static inline int framer_notifier_register(str    172 static inline int framer_notifier_register(struct framer *framer,
173                                            str    173                                            struct notifier_block *nb)
174 {                                                 174 {
175         return -ENOSYS;                           175         return -ENOSYS;
176 }                                                 176 }
177                                                   177 
178 static inline int framer_notifier_unregister(s    178 static inline int framer_notifier_unregister(struct framer *framer,
179                                              s    179                                              struct notifier_block *nb)
180 {                                                 180 {
181         return -ENOSYS;                           181         return -ENOSYS;
182 }                                                 182 }
183                                                   183 
184 static inline struct framer *framer_get(struct    184 static inline struct framer *framer_get(struct device *dev, const char *con_id)
185 {                                                 185 {
186         return ERR_PTR(-ENOSYS);                  186         return ERR_PTR(-ENOSYS);
187 }                                                 187 }
188                                                   188 
189 static inline void framer_put(struct device *d    189 static inline void framer_put(struct device *dev, struct framer *framer)
190 {                                                 190 {
191 }                                                 191 }
192                                                   192 
193 static inline struct framer *devm_framer_get(s    193 static inline struct framer *devm_framer_get(struct device *dev, const char *con_id)
194 {                                                 194 {
195         return ERR_PTR(-ENOSYS);                  195         return ERR_PTR(-ENOSYS);
196 }                                                 196 }
197                                                   197 
198 static inline struct framer *devm_framer_optio    198 static inline struct framer *devm_framer_optional_get(struct device *dev, const char *con_id)
199 {                                                 199 {
200         return NULL;                              200         return NULL;
201 }                                                 201 }
202                                                   202 
203 #endif                                            203 #endif
204                                                   204 
205 #endif /* __DRIVERS_FRAMER_H */                   205 #endif /* __DRIVERS_FRAMER_H */
206                                                   206 

~ [ 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