@@ -27,7 +27,7 @@ def id(self): # pylint: disable=invalid-name,too-many-branches,too-many-return-
27
27
# look for it based on PID/VID
28
28
count = len (UsbTools .find_all ([(0x0403 , 0x6014 )]))
29
29
if count == 0 :
30
- raise RuntimeError ('BLINKA_FT232H environment variable ' + \
30
+ raise RuntimeError ('BLINKA_FT232H environment variable ' +
31
31
'set, but no FT232H device found' )
32
32
return chips .FT232H
33
33
if os .environ .get ('BLINKA_MCP2221' ):
@@ -36,7 +36,7 @@ def id(self): # pylint: disable=invalid-name,too-many-branches,too-many-return-
36
36
for dev in hid .enumerate ():
37
37
if dev ['vendor_id' ] == 0x04D8 and dev ['product_id' ] == 0x00DD :
38
38
return chips .MCP2221
39
- raise RuntimeError ('BLINKA_MCP2221 environment variable ' + \
39
+ raise RuntimeError ('BLINKA_MCP2221 environment variable ' +
40
40
'set, but no MCP2221 device found' )
41
41
if os .environ .get ('BLINKA_NOVA' ):
42
42
return chips .BINHO
@@ -55,7 +55,9 @@ def id(self): # pylint: disable=invalid-name,too-many-branches,too-many-return-
55
55
56
56
# pylint: enable=invalid-name
57
57
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
59
61
"""Attempt to detect the CPU on a computer running the Linux kernel."""
60
62
61
63
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
88
90
linux_id = chips .IMX8MX
89
91
if compatible and 'odroid-c2' in compatible :
90
92
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
95
103
if compatible and 'sun50i-a64' in compatible :
96
104
linux_id = chips .A64
97
105
0 commit comments