Return:
Number of argument cells is this is a phandle, else None
"""
- if prop.name in ['clocks']:
+ if prop.name in ['clocks', 'cd-gpios']:
if not isinstance(prop.value, list):
prop.value = [prop.value]
val = prop.value
if not target:
raise ValueError("Cannot parse '%s' in node '%s'" %
(prop.name, node_name))
- prop_name = '#clock-cells'
- cells = target.props.get(prop_name)
+ cells = None
+ for prop_name in ['#clock-cells', '#gpio-cells']:
+ cells = target.props.get(prop_name)
+ if cells:
+ break
if not cells:
- raise ValueError("Node '%s' has no '%s' property" %
- (target.name, prop_name))
+ raise ValueError("Node '%s' has no cells property" %
+ (target.name))
num_args = fdt_util.fdt32_to_cpu(cells.value)
max_args = max(max_args, num_args)
args.append(num_args)
# dtv_dmc_at_xxx.clocks[0].node = DM_GET_DEVICE(clock_controller_at_xxx)
self.buf('void dm_populate_phandle_data(void) {\n')
for l in self._links:
- self.buf('\t%s = DM_GET_DEVICE(%s);\n' % (l['var_node'], l['dev_name']))
+ self.buf('\t%s = DM_GET_DEVICE(%s);\n' %
+ (l['var_node'], l['dev_name']))
self.buf('}\n')
self.out(''.join(self.get_buf()))
output = tools.GetOutputFilename('output')
with self.assertRaises(ValueError) as e:
self.run_test(['struct'], dtb_file, output)
- self.assertIn("Node 'phandle-target' has no '#clock-cells' property",
+ self.assertIn("Node 'phandle-target' has no cells property",
str(e.exception))
def test_aliases(self):