xref: /linux/Documentation/netlink/specs/dpll.yaml (revision fefe5dc4afeafe896c90d5b20b605f2759343c3b)
1# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
3name: dpll
4
5doc: DPLL subsystem.
6
7definitions:
8  -
9    type: enum
10    name: mode
11    doc: |
12      working modes a dpll can support, differentiates if and how dpll selects
13      one of its inputs to syntonize with it, valid values for DPLL_A_MODE
14      attribute
15    entries:
16      -
17        name: manual
18        doc: input can be only selected by sending a request to dpll
19        value: 1
20      -
21        name: automatic
22        doc: highest prio input pin auto selected by dpll
23    render-max: true
24  -
25    type: enum
26    name: lock-status
27    doc: |
28      provides information of dpll device lock status, valid values for
29      DPLL_A_LOCK_STATUS attribute
30    entries:
31      -
32        name: unlocked
33        doc: |
34          dpll was not yet locked to any valid input (or forced by setting
35          DPLL_A_MODE to DPLL_MODE_DETACHED)
36        value: 1
37      -
38        name: locked
39        doc: |
40          dpll is locked to a valid signal, but no holdover available
41      -
42        name: locked-ho-acq
43        doc: |
44          dpll is locked and holdover acquired
45      -
46        name: holdover
47        doc: |
48          dpll is in holdover state - lost a valid lock or was forced
49          by disconnecting all the pins (latter possible only
50          when dpll lock-state was already DPLL_LOCK_STATUS_LOCKED_HO_ACQ,
51          if dpll lock-state was not DPLL_LOCK_STATUS_LOCKED_HO_ACQ, the
52          dpll's lock-state shall remain DPLL_LOCK_STATUS_UNLOCKED)
53    render-max: true
54  -
55    type: const
56    name: temp-divider
57    value: 1000
58    doc: |
59      temperature divider allowing userspace to calculate the
60      temperature as float with three digit decimal precision.
61      Value of (DPLL_A_TEMP / DPLL_TEMP_DIVIDER) is integer part of
62      temperature value.
63      Value of (DPLL_A_TEMP % DPLL_TEMP_DIVIDER) is fractional part of
64      temperature value.
65  -
66    type: enum
67    name: type
68    doc: type of dpll, valid values for DPLL_A_TYPE attribute
69    entries:
70      -
71        name: pps
72        doc: dpll produces Pulse-Per-Second signal
73        value: 1
74      -
75        name: eec
76        doc: dpll drives the Ethernet Equipment Clock
77    render-max: true
78  -
79    type: enum
80    name: pin-type
81    doc: |
82      defines possible types of a pin, valid values for DPLL_A_PIN_TYPE
83      attribute
84    entries:
85      -
86        name: mux
87        doc: aggregates another layer of selectable pins
88        value: 1
89      -
90        name: ext
91        doc: external input
92      -
93        name: synce-eth-port
94        doc: ethernet port PHY's recovered clock
95      -
96        name: int-oscillator
97        doc: device internal oscillator
98      -
99        name: gnss
100        doc: GNSS recovered clock
101    render-max: true
102  -
103    type: enum
104    name: pin-direction
105    doc: |
106      defines possible direction of a pin, valid values for
107      DPLL_A_PIN_DIRECTION attribute
108    entries:
109      -
110        name: input
111        doc: pin used as a input of a signal
112        value: 1
113      -
114        name: output
115        doc: pin used to output the signal
116    render-max: true
117  -
118    type: const
119    name: pin-frequency-1-hz
120    value: 1
121  -
122    type: const
123    name: pin-frequency-10-khz
124    value: 10000
125  -
126    type: const
127    name: pin-frequency-77_5-khz
128    value: 77500
129  -
130    type: const
131    name: pin-frequency-10-mhz
132    value: 10000000
133  -
134    type: enum
135    name: pin-state
136    doc: |
137      defines possible states of a pin, valid values for
138      DPLL_A_PIN_STATE attribute
139    entries:
140      -
141        name: connected
142        doc: pin connected, active input of phase locked loop
143        value: 1
144      -
145        name: disconnected
146        doc: pin disconnected, not considered as a valid input
147      -
148        name: selectable
149        doc: pin enabled for automatic input selection
150    render-max: true
151  -
152    type: flags
153    name: pin-capabilities
154    doc: |
155      defines possible capabilities of a pin, valid flags on
156      DPLL_A_PIN_CAPABILITIES attribute
157    entries:
158      -
159        name: direction-can-change
160        doc: pin direction can be changed
161      -
162        name: priority-can-change
163        doc: pin priority can be changed
164      -
165        name: state-can-change
166        doc: pin state can be changed
167
168attribute-sets:
169  -
170    name: dpll
171    enum-name: dpll_a
172    attributes:
173      -
174        name: id
175        type: u32
176      -
177        name: module-name
178        type: string
179      -
180        name: pad
181        type: pad
182      -
183        name: clock-id
184        type: u64
185      -
186        name: mode
187        type: u32
188        enum: mode
189      -
190        name: mode-supported
191        type: u32
192        enum: mode
193        multi-attr: true
194      -
195        name: lock-status
196        type: u32
197        enum: lock-status
198      -
199        name: temp
200        type: s32
201      -
202        name: type
203        type: u32
204        enum: type
205  -
206    name: pin
207    enum-name: dpll_a_pin
208    attributes:
209      -
210        name: id
211        type: u32
212      -
213        name: parent-id
214        type: u32
215      -
216        name: module-name
217        type: string
218      -
219        name: pad
220        type: pad
221      -
222        name: clock-id
223        type: u64
224      -
225        name: board-label
226        type: string
227      -
228        name: panel-label
229        type: string
230      -
231        name: package-label
232        type: string
233      -
234        name: type
235        type: u32
236        enum: pin-type
237      -
238        name: direction
239        type: u32
240        enum: pin-direction
241      -
242        name: frequency
243        type: u64
244      -
245        name: frequency-supported
246        type: nest
247        multi-attr: true
248        nested-attributes: frequency-range
249      -
250        name: frequency-min
251        type: u64
252      -
253        name: frequency-max
254        type: u64
255      -
256        name: prio
257        type: u32
258      -
259        name: state
260        type: u32
261        enum: pin-state
262      -
263        name: capabilities
264        type: u32
265      -
266        name: parent-device
267        type: nest
268        multi-attr: true
269        nested-attributes: pin-parent-device
270      -
271        name: parent-pin
272        type: nest
273        multi-attr: true
274        nested-attributes: pin-parent-pin
275  -
276    name: pin-parent-device
277    subset-of: pin
278    attributes:
279      -
280        name: parent-id
281        type: u32
282      -
283        name: direction
284        type: u32
285      -
286        name: prio
287        type: u32
288      -
289        name: state
290        type: u32
291  -
292    name: pin-parent-pin
293    subset-of: pin
294    attributes:
295      -
296        name: parent-id
297        type: u32
298      -
299        name: state
300        type: u32
301  -
302    name: frequency-range
303    subset-of: pin
304    attributes:
305      -
306        name: frequency-min
307        type: u64
308      -
309        name: frequency-max
310        type: u64
311
312operations:
313  enum-name: dpll_cmd
314  list:
315    -
316      name: device-id-get
317      doc: |
318        Get id of dpll device that matches given attributes
319      attribute-set: dpll
320      flags: [ admin-perm ]
321
322      do:
323        pre: dpll-lock-doit
324        post: dpll-unlock-doit
325        request:
326          attributes:
327            - module-name
328            - clock-id
329            - type
330        reply:
331          attributes:
332            - id
333
334    -
335      name: device-get
336      doc: |
337        Get list of DPLL devices (dump) or attributes of a single dpll device
338      attribute-set: dpll
339      flags: [ admin-perm ]
340
341      do:
342        pre: dpll-pre-doit
343        post: dpll-post-doit
344        request:
345          attributes:
346            - id
347        reply: &dev-attrs
348          attributes:
349            - id
350            - module-name
351            - mode
352            - mode-supported
353            - lock-status
354            - temp
355            - clock-id
356            - type
357
358      dump:
359        pre: dpll-lock-dumpit
360        post: dpll-unlock-dumpit
361        reply: *dev-attrs
362
363    -
364      name: device-set
365      doc: Set attributes for a DPLL device
366      attribute-set: dpll
367      flags: [ admin-perm ]
368
369      do:
370        pre: dpll-pre-doit
371        post: dpll-post-doit
372        request:
373          attributes:
374            - id
375    -
376      name: device-create-ntf
377      doc: Notification about device appearing
378      notify: device-get
379      mcgrp: monitor
380    -
381      name: device-delete-ntf
382      doc: Notification about device disappearing
383      notify: device-get
384      mcgrp: monitor
385    -
386      name: device-change-ntf
387      doc: Notification about device configuration being changed
388      notify: device-get
389      mcgrp: monitor
390    -
391      name: pin-id-get
392      doc: |
393        Get id of a pin that matches given attributes
394      attribute-set: pin
395      flags: [ admin-perm ]
396
397      do:
398        pre: dpll-lock-doit
399        post: dpll-unlock-doit
400        request:
401          attributes:
402            - module-name
403            - clock-id
404            - board-label
405            - panel-label
406            - package-label
407            - type
408        reply:
409          attributes:
410            - id
411
412    -
413      name: pin-get
414      doc: |
415        Get list of pins and its attributes.
416        - dump request without any attributes given - list all the pins in the
417          system
418        - dump request with target dpll - list all the pins registered with
419          a given dpll device
420        - do request with target dpll and target pin - single pin attributes
421      attribute-set: pin
422      flags: [ admin-perm ]
423
424      do:
425        pre: dpll-pin-pre-doit
426        post: dpll-pin-post-doit
427        request:
428          attributes:
429            - id
430        reply: &pin-attrs
431          attributes:
432            - id
433            - board-label
434            - panel-label
435            - package-label
436            - type
437            - frequency
438            - frequency-supported
439            - capabilities
440            - parent-device
441            - parent-pin
442
443      dump:
444        pre: dpll-lock-dumpit
445        post: dpll-unlock-dumpit
446        request:
447          attributes:
448            - id
449        reply: *pin-attrs
450
451    -
452      name: pin-set
453      doc: Set attributes of a target pin
454      attribute-set: pin
455      flags: [ admin-perm ]
456
457      do:
458        pre: dpll-pin-pre-doit
459        post: dpll-pin-post-doit
460        request:
461          attributes:
462            - id
463            - frequency
464            - direction
465            - prio
466            - state
467            - parent-device
468            - parent-pin
469    -
470      name: pin-create-ntf
471      doc: Notification about pin appearing
472      notify: pin-get
473      mcgrp: monitor
474    -
475      name: pin-delete-ntf
476      doc: Notification about pin disappearing
477      notify: pin-get
478      mcgrp: monitor
479    -
480      name: pin-change-ntf
481      doc: Notification about pin configuration being changed
482      notify: pin-get
483      mcgrp: monitor
484
485mcast-groups:
486  list:
487    -
488      name: monitor
489