@@ -27,7 +27,7 @@ def id(self): # pylint: disable=invalid-name,too-many-branches,too-many-return-
2727 # look for it based on PID/VID
2828 count = len (UsbTools .find_all ([(0x0403 , 0x6014 )]))
2929 if count == 0 :
30- raise RuntimeError ('BLINKA_FT232H environment variable ' + \
30+ raise RuntimeError ('BLINKA_FT232H environment variable ' +
3131 'set, but no FT232H device found' )
3232 return chips .FT232H
3333 if os .environ .get ('BLINKA_MCP2221' ):
@@ -36,7 +36,7 @@ def id(self): # pylint: disable=invalid-name,too-many-branches,too-many-return-
3636 for dev in hid .enumerate ():
3737 if dev ['vendor_id' ] == 0x04D8 and dev ['product_id' ] == 0x00DD :
3838 return chips .MCP2221
39- raise RuntimeError ('BLINKA_MCP2221 environment variable ' + \
39+ raise RuntimeError ('BLINKA_MCP2221 environment variable ' +
4040 'set, but no MCP2221 device found' )
4141 if os .environ .get ('BLINKA_NOVA' ):
4242 return chips .BINHO
@@ -55,7 +55,9 @@ def id(self): # pylint: disable=invalid-name,too-many-branches,too-many-return-
5555
5656 # pylint: enable=invalid-name
5757
58- def _linux_id (self ): # pylint: disable=too-many-branches,too-many-statements
58+ def _linux_id (self ):
59+ # pylint: disable=too-many-branches,too-many-statements
60+ # pylint: disable=too-many-return-statements
5961 """Attempt to detect the CPU on a computer running the Linux kernel."""
6062
6163 if self .detector .check_dt_compatible_value ('qcom,apq8016' ):
@@ -88,10 +90,16 @@ def _linux_id(self): # pylint: disable=too-many-branches,too-many-statements
8890 linux_id = chips .IMX8MX
8991 if compatible and 'odroid-c2' in compatible :
9092 linux_id = chips .S905
91- if compatible and 'amlogic, g12a' in compatible :
92- linux_id = chips .S905X3
93- if compatible and 'amlogic, g12b' in compatible :
94- linux_id = chips .S922X
93+ if compatible and 'amlogic' in compatible :
94+ compatible_list = compatible .replace ('\x00 ' , ',' ) \
95+ .replace (' ' , '' ).split (',' )
96+ if 'g12a' in compatible_list :
97+ # 'sm1' is correct for S905X3, but some kernels use 'g12a'
98+ return chips .S905X3
99+ if 'g12b' in compatible_list :
100+ return chips .S922X
101+ if 'sm1' in compatible_list :
102+ return chips .S905X3
95103 if compatible and 'sun50i-a64' in compatible :
96104 linux_id = chips .A64
97105
0 commit comments