xref: /linux/Documentation/netlink/specs/dpll.yaml (revision 04317b129e4eb5c6f4a58bb899b2019c1545320b)
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      -
282        name: direction
283      -
284        name: prio
285      -
286        name: state
287  -
288    name: pin-parent-pin
289    subset-of: pin
290    attributes:
291      -
292        name: parent-id
293      -
294        name: state
295  -
296    name: frequency-range
297    subset-of: pin
298    attributes:
299      -
300        name: frequency-min
301      -
302        name: frequency-max
303
304operations:
305  enum-name: dpll_cmd
306  list:
307    -
308      name: device-id-get
309      doc: |
310        Get id of dpll device that matches given attributes
311      attribute-set: dpll
312      flags: [ admin-perm ]
313
314      do:
315        pre: dpll-lock-doit
316        post: dpll-unlock-doit
317        request:
318          attributes:
319            - module-name
320            - clock-id
321            - type
322        reply:
323          attributes:
324            - id
325
326    -
327      name: device-get
328      doc: |
329        Get list of DPLL devices (dump) or attributes of a single dpll device
330      attribute-set: dpll
331      flags: [ admin-perm ]
332
333      do:
334        pre: dpll-pre-doit
335        post: dpll-post-doit
336        request:
337          attributes:
338            - id
339        reply: &dev-attrs
340          attributes:
341            - id
342            - module-name
343            - mode
344            - mode-supported
345            - lock-status
346            - temp
347            - clock-id
348            - type
349
350      dump:
351        pre: dpll-lock-dumpit
352        post: dpll-unlock-dumpit
353        reply: *dev-attrs
354
355    -
356      name: device-set
357      doc: Set attributes for a DPLL device
358      attribute-set: dpll
359      flags: [ admin-perm ]
360
361      do:
362        pre: dpll-pre-doit
363        post: dpll-post-doit
364        request:
365          attributes:
366            - id
367    -
368      name: device-create-ntf
369      doc: Notification about device appearing
370      notify: device-get
371      mcgrp: monitor
372    -
373      name: device-delete-ntf
374      doc: Notification about device disappearing
375      notify: device-get
376      mcgrp: monitor
377    -
378      name: device-change-ntf
379      doc: Notification about device configuration being changed
380      notify: device-get
381      mcgrp: monitor
382    -
383      name: pin-id-get
384      doc: |
385        Get id of a pin that matches given attributes
386      attribute-set: pin
387      flags: [ admin-perm ]
388
389      do:
390        pre: dpll-lock-doit
391        post: dpll-unlock-doit
392        request:
393          attributes:
394            - module-name
395            - clock-id
396            - board-label
397            - panel-label
398            - package-label
399            - type
400        reply:
401          attributes:
402            - id
403
404    -
405      name: pin-get
406      doc: |
407        Get list of pins and its attributes.
408        - dump request without any attributes given - list all the pins in the
409          system
410        - dump request with target dpll - list all the pins registered with
411          a given dpll device
412        - do request with target dpll and target pin - single pin attributes
413      attribute-set: pin
414      flags: [ admin-perm ]
415
416      do:
417        pre: dpll-pin-pre-doit
418        post: dpll-pin-post-doit
419        request:
420          attributes:
421            - id
422        reply: &pin-attrs
423          attributes:
424            - id
425            - board-label
426            - panel-label
427            - package-label
428            - type
429            - frequency
430            - frequency-supported
431            - capabilities
432            - parent-device
433            - parent-pin
434
435      dump:
436        pre: dpll-lock-dumpit
437        post: dpll-unlock-dumpit
438        request:
439          attributes:
440            - id
441        reply: *pin-attrs
442
443    -
444      name: pin-set
445      doc: Set attributes of a target pin
446      attribute-set: pin
447      flags: [ admin-perm ]
448
449      do:
450        pre: dpll-pin-pre-doit
451        post: dpll-pin-post-doit
452        request:
453          attributes:
454            - id
455            - frequency
456            - direction
457            - prio
458            - state
459            - parent-device
460            - parent-pin
461    -
462      name: pin-create-ntf
463      doc: Notification about pin appearing
464      notify: pin-get
465      mcgrp: monitor
466    -
467      name: pin-delete-ntf
468      doc: Notification about pin disappearing
469      notify: pin-get
470      mcgrp: monitor
471    -
472      name: pin-change-ntf
473      doc: Notification about pin configuration being changed
474      notify: pin-get
475      mcgrp: monitor
476
477mcast-groups:
478  list:
479    -
480      name: monitor
481