def fill_pinctrl_hFile(self): gen_str = '''#include <linux/pinctrl/pinctrl.h>\n''' gen_str += '''#include <pinctrl-mtk-common.h>\n\n''' gen_str += '''static const struct mtk_desc_pin mtk_pins_%s[] = {\n''' % ( ModuleObj.get_chipId().lower()) #sorted_list = sorted(ModuleObj.get_data(self).keys(), key = compare) for key in sorted_key(list(ModuleObj.get_data(self).keys())): #for key in sorted_list: value = ModuleObj.get_data(self)[key] gen_str += '''\tMTK_PIN(\n''' gen_str += '''\t\tPINCTRL_PIN(%s, \"%s\"),\n''' % (key[4:], key.upper()) gen_str += '''\t\tNULL, \"%s\",\n''' % ( ModuleObj.get_chipId().lower()) gen_str += '''\t\tMTK_EINT_FUNCTION(NO_EINT_SUPPORT, NO_EINT_SUPPORT)''' for i in range(0, GpioData._modNum): mode_name = GpioData.get_modeName(key, i) if mode_name != '': lst = [] if mode_name.find('//') != -1: lst = mode_name.split('//') else: lst.append(mode_name) for j in range(0, len(lst)): gen_str += ''',\n\t\tMTK_FUNCTION(%d, "%s")''' % ( i + j * 8, lst[j]) gen_str += '''\n\t),\n''' gen_str += '''};\n''' return gen_str
def __init__(self): ModuleObj.__init__(self, 'cust_gpio_boot.h', 'cust_gpio.dtsi') self.__fileName = 'cust_gpio_usage.h' self.__filePinfunc = '%s-pinfunc.h' % (ModuleObj.get_chipId().lower()) self.__filePinCtrl = 'pinctrl-mtk-%s.h' % ( ModuleObj.get_chipId().lower()) self.__fileScp = 'cust_scp_gpio_usage.h' self.__fileMap = 'cust_gpio_usage_mapping.dtsi' self.__drvCur = False
def get_cfgInfo(self): cp = configparser.ConfigParser(allow_no_value=True) cp.read(ModuleObj.get_cmpPath()) PmicData._var_list = cp.options('APPLICATION') if self.__chipName == '': return #parse the pmic config file cmpPath = os.path.join(sys.path[0], 'config', self.__chipName + '.cmp') if not os.path.exists(cmpPath) or not os.path.isfile(cmpPath): log(LogLevel.error, 'Can not find %s pmic config file!' % (self.__chipName)) sys.exit(-1) cp.read(cmpPath) self.__defLdo = cp.get('PMIC_TABLE', 'LDO_APPNAME_DEFAULT') self.__headerList = cp.get('PMIC_TABLE', 'INCLUDE_HEADER').split(':') self.__func = cp.get('PMIC_TABLE', 'FUNCTION') for i in range(1, cp.getint('PMIC_TABLE', 'NUM_LDO') + 1): key = 'LDO_NAME%d' % (i) self.__paraList.append(cp.get(key, 'PARAMETER_NAME')) #parse app count in fig file cp.read(ModuleObj.get_chipId() + '.fig') cp.read(ModuleObj.get_figPath()) self.__appCount = cp.getint('Chip Type', 'PMIC_APP_COUNT')