From: Luke Kenneth Casson Leighton Date: Sat, 21 Jul 2018 02:58:41 +0000 (+0100) Subject: add horrible hack for turning single-interface PWM into multi-single pin X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3bdfbda39085773d1c3f0bb7672c370927d54709;p=pinmux.git add horrible hack for turning single-interface PWM into multi-single pin --- diff --git a/src/ifacebase.py b/src/ifacebase.py index 72dbcc9..3a3bf1d 100644 --- a/src/ifacebase.py +++ b/src/ifacebase.py @@ -32,13 +32,23 @@ class InterfacesBase(UserDict): ] """ spec, ganged = self.read_spec(pth, name) - iface = ifacekls(name, spec, ganged, count == 1) - self.ifaceadd(name, count, iface) + # XXX HORRIBLE hack!!! + if name == 'pwm' and count == 1 and len(spec) != 1: + #print "read", name, count, spec, ganged + #print "multi pwm", spec[:1], len(spec) + spec[0]['name'] = 'out' + iface = ifacekls(name, spec[:1], ganged, False) + self.ifaceadd(name, len(spec), iface) + else: + iface = ifacekls(name, spec, ganged, count == 1) + self.ifaceadd(name, count, iface) def getifacetype(self, fname): # finds the interface type, e.g sd_d0 returns "inout" for iface in self.values(): typ = iface.getifacetype(fname) + #if fname.startswith('pwm'): + # print fname, iface.ifacename, typ if typ: return typ return None diff --git a/src/parse.py b/src/parse.py index b8efe82..a233334 100644 --- a/src/parse.py +++ b/src/parse.py @@ -52,6 +52,10 @@ class Parse(object): if len(line1) == 2: # dedicated self.dedicated_cells.append(line1) else: + for i in range(1, len(line1)): + # XXX HORRIBLE HACK!! + if line1[i].startswith('pwm'): + line1[i] = 'pwm%s_out' % line1[i][4:] self.muxed_cells.append(line1) self.pinnumbers = sorted(self.pinnumbers)