Procházet zdrojové kódy

Improve documentation slightly

All those comments in pdb_dpm.h aren't needed anymore.  They were just
to help me organize my thoughts on how the DPM should work.
Clara Hobbs před 7 roky
rodič
revize
fe107db849
2 změnil soubory, kde provedl 4 přidání a 26 odebrání
  1. 3
    0
      lib/include/pdb.h
  2. 1
    26
      lib/include/pdb_dpm.h

+ 3
- 0
lib/include/pdb.h Zobrazit soubor

34
  * be statically allocated!
34
  * be statically allocated!
35
  */
35
  */
36
 struct pdb_config {
36
 struct pdb_config {
37
+    /* User-initialized fields */
37
     /* Configuration information for the FUSB302B* chip */
38
     /* Configuration information for the FUSB302B* chip */
38
     struct pdb_fusb_config fusb;
39
     struct pdb_fusb_config fusb;
39
     /* DPM callbacks */
40
     /* DPM callbacks */
40
     struct pdb_dpm_callbacks dpm;
41
     struct pdb_dpm_callbacks dpm;
41
     /* Pointer to port-specific DPM data */
42
     /* Pointer to port-specific DPM data */
42
     void *dpm_data;
43
     void *dpm_data;
44
+
45
+    /* Automatically initialized fields */
43
     /* Policy Engine thread and related variables */
46
     /* Policy Engine thread and related variables */
44
     struct pdb_pe pe;
47
     struct pdb_pe pe;
45
     /* Protocol layer threads and related variables */
48
     /* Protocol layer threads and related variables */

+ 1
- 26
lib/include/pdb_dpm.h Zobrazit soubor

40
  * PD Buddy firmware library device policy manager callback structure
40
  * PD Buddy firmware library device policy manager callback structure
41
  *
41
  *
42
  * Optional functions may be set to NULL if the associated functionality is not
42
  * Optional functions may be set to NULL if the associated functionality is not
43
- * required.
43
+ * required. (TODO)
44
  */
44
  */
45
 struct pdb_dpm_callbacks {
45
 struct pdb_dpm_callbacks {
46
     pdb_dpm_eval_cap_func evaluate_capability;
46
     pdb_dpm_eval_cap_func evaluate_capability;
48
     pdb_dpm_giveback_func giveback_enabled;
48
     pdb_dpm_giveback_func giveback_enabled;
49
     pdb_dpm_tcc_func evaluate_typec_current; /* Optional */
49
     pdb_dpm_tcc_func evaluate_typec_current; /* Optional */
50
     pdb_dpm_func pd_start; /* Optional */
50
     pdb_dpm_func pd_start; /* Optional */
51
-    /* dpm_sink_standby is called in PE_SNK_Select_Capability to ensure power
52
-     * consumption is less than 2.5 W.
53
-     *   - dpm_transition_standby()
54
-     */
55
-    /* dpm_output_set is called in five places:
56
-     *   - PS_RDY received → transition sink power supply to our request
57
-     *     - This could mean what we wanted, or what we had to settle for, so
58
-     *       we have to remember.
59
-     *     - dpm_transition_requested()
60
-     *   - Protocol error in PE_SNK_Transition_Sink
61
-     *     - Unnecessary?  If we really want to be defensive here, just go to
62
-     *       default output, right?  That's what we'll do shortly afterwards
63
-     *       anyway.
64
-     *     - dpm_transition_default()
65
-     *   - GotoMin received and giveback → transition sink to min power
66
-     *     - dpm_transition_min()
67
-     *   - Transition sink power supply to match Type-C Current advertisement
68
-     *     - dpm_transition_typec() (if I don't like it I can change it)
69
-     *   - Part of dpm_output_default
70
-     *     - Obsolete (see below)
71
-     */
72
-    /* dpm_output_default is only called in PE_SNK_Transition_to_Default.
73
-     * Should probably be part of new improved replacement for dpm_output_set.
74
-     *   - dpm_transition_default()
75
-     */
76
     pdb_dpm_func transition_default;
51
     pdb_dpm_func transition_default;
77
     pdb_dpm_func transition_min; /* Optional if no GiveBack */
52
     pdb_dpm_func transition_min; /* Optional if no GiveBack */
78
     pdb_dpm_func transition_standby;
53
     pdb_dpm_func transition_standby;

Loading…
Zrušit
Uložit