1
- //! Communicate with CCGX (CCG5, CCG6) PD controllers
1
+ //! Communicate with CCGX (CCG5, CCG6, CCG8 ) PD controllers
2
2
//!
3
3
//! The current implementation talks to them by tunneling I2C through EC host commands.
4
4
@@ -41,9 +41,12 @@ impl PdPort {
41
41
let platform = & ( * config) . as_ref ( ) . unwrap ( ) . platform ;
42
42
43
43
match ( platform, self ) {
44
+ ( Platform :: GenericFramework ( ( left, _) , _, _) , PdPort :: Left01 ) => * left,
45
+ ( Platform :: GenericFramework ( ( _, right) , _, _) , PdPort :: Right23 ) => * right,
46
+ // Framework AMD Platforms (CCG8)
44
47
( Platform :: Framework13Amd | Platform :: Framework16 , PdPort :: Left01 ) => 0x42 ,
45
48
( Platform :: Framework13Amd | Platform :: Framework16 , PdPort :: Right23 ) => 0x40 ,
46
- // Intel Platforms
49
+ // Framework Intel Platforms (CCG5 and CCG6)
47
50
( _, PdPort :: Left01 ) => 0x08 ,
48
51
( _, PdPort :: Right23 ) => 0x40 ,
49
52
}
@@ -55,11 +58,11 @@ impl PdPort {
55
58
let platform = & ( * config) . as_ref ( ) . unwrap ( ) . platform ;
56
59
57
60
Ok ( match ( platform, self ) {
61
+ ( Platform :: GenericFramework ( _, ( left, _) , _) , PdPort :: Left01 ) => * left,
62
+ ( Platform :: GenericFramework ( _, ( _, right) , _) , PdPort :: Right23 ) => * right,
58
63
( Platform :: IntelGen11 , _) => 6 ,
59
- ( Platform :: IntelGen12 , PdPort :: Left01 ) => 6 ,
60
- ( Platform :: IntelGen12 , PdPort :: Right23 ) => 7 ,
61
- ( Platform :: IntelGen13 , PdPort :: Left01 ) => 6 ,
62
- ( Platform :: IntelGen13 , PdPort :: Right23 ) => 7 ,
64
+ ( Platform :: IntelGen12 | Platform :: IntelGen13 , PdPort :: Left01 ) => 6 ,
65
+ ( Platform :: IntelGen12 | Platform :: IntelGen13 , PdPort :: Right23 ) => 7 ,
63
66
( Platform :: Framework13Amd | Platform :: Framework16 , PdPort :: Left01 ) => 1 ,
64
67
( Platform :: Framework13Amd | Platform :: Framework16 , PdPort :: Right23 ) => 2 ,
65
68
// (_, _) => Err(EcError::DeviceError(format!(
0 commit comments