|
@@ -28,12 +28,27 @@
|
28
|
28
|
* PD Buddy Sink configuration structure
|
29
|
29
|
*/
|
30
|
30
|
struct pdbs_config {
|
|
31
|
+ /* Status halfword, used to indicate which config objects can be written to
|
|
32
|
+ * and which one is valid. */
|
31
|
33
|
uint16_t status;
|
|
34
|
+ /* Flags halfword for miscellaneous small fields. */
|
32
|
35
|
uint16_t flags;
|
|
36
|
+ /* Preferred voltage. */
|
33
|
37
|
uint16_t v;
|
34
|
|
- uint16_t i;
|
|
38
|
+ /* Union for specifying how much current to request. */
|
|
39
|
+ union {
|
|
40
|
+ /* Required current. */
|
|
41
|
+ uint16_t i;
|
|
42
|
+ /* Required power. */
|
|
43
|
+ uint16_t p;
|
|
44
|
+ /* Value of resistive load. */
|
|
45
|
+ uint16_t r;
|
|
46
|
+ };
|
|
47
|
+ /* Lower end of voltage range. */
|
35
|
48
|
uint16_t vmin;
|
|
49
|
+ /* Upper end of voltage range. */
|
36
|
50
|
uint16_t vmax;
|
|
51
|
+ /* Extra bytes reserved for future use. */
|
37
|
52
|
uint16_t _reserved[2];
|
38
|
53
|
} __attribute__((packed));
|
39
|
54
|
|
|
@@ -47,9 +62,17 @@ struct pdbs_config {
|
47
|
62
|
|
48
|
63
|
/* Flags for configuration structures. */
|
49
|
64
|
/* GiveBack supported */
|
50
|
|
-#define PDBS_CONFIG_FLAGS_GIVEBACK 0x0001
|
|
65
|
+#define PDBS_CONFIG_FLAGS_GIVEBACK (1 << 0)
|
51
|
66
|
/* Variable and battery PDOs preferred (FIXME: not implemented) */
|
52
|
|
-#define PDBS_CONFIG_FLAGS_VAR_BAT 0x0002
|
|
67
|
+#define PDBS_CONFIG_FLAGS_VAR_BAT (1 << 1)
|
|
68
|
+/* High voltages preferred */
|
|
69
|
+#define PDBS_CONFIG_FLAGS_HV_PREFERRED (1 << 2)
|
|
70
|
+/* Current definition type */
|
|
71
|
+#define PDBS_CONFIG_FLAGS_CURRENT_DEFN_SHIFT 3
|
|
72
|
+#define PDBS_CONFIG_FLAGS_CURRENT_DEFN (0x3 << PDBS_CONFIG_FLAGS_CURRENT_DEFN_SHIFT)
|
|
73
|
+#define PDBS_CONFIG_FLAGS_CURRENT_DEFN_I (0 << PDBS_CONFIG_FLAGS_CURRENT_DEFN_SHIFT)
|
|
74
|
+#define PDBS_CONFIG_FLAGS_CURRENT_DEFN_P (1 << PDBS_CONFIG_FLAGS_CURRENT_DEFN_SHIFT)
|
|
75
|
+#define PDBS_CONFIG_FLAGS_CURRENT_DEFN_R (2 << PDBS_CONFIG_FLAGS_CURRENT_DEFN_SHIFT)
|
53
|
76
|
|
54
|
77
|
|
55
|
78
|
/* Flash configuration array */
|