Lines Matching defs:hi35xx

50 static int32_t PinDumperCreate(struct Hi35xxPinCntlr *hi35xx)
62 PIN_DUMPER_NAME_PREFIX, hi35xx->number) < 0) {
73 hi35xx->dumper = dumper;
74 hi35xx->dumperName = name;
79 static void PinDumperDump(struct Hi35xxPinCntlr *hi35xx, uint32_t index)
83 {"PIN_REGISTER", PLATFORM_DUMPER_REGISTERL, (void *)(hi35xx->regBase + index * HI35XX_PIN_REG_SIZE)},
86 if (hi35xx->dumper == NULL) {
90 ret = PlatformDumperAddDatas(hi35xx->dumper, data, sizeof(data) / sizeof(struct PlatformDumperData));
94 (void)PlatformDumperDump(hi35xx->dumper);
95 (void)PlatformDumperClearDatas(hi35xx->dumper);
98 static inline void PinDumperDestroy(struct Hi35xxPinCntlr *hi35xx)
100 PlatformDumperDestroy(hi35xx->dumper);
101 OsalMemFree(hi35xx->dumperName);
107 struct Hi35xxPinCntlr *hi35xx = NULL;
109 hi35xx = (struct Hi35xxPinCntlr *)cntlr;
110 value = OSAL_READL(hi35xx->regBase + index * HI35XX_PIN_REG_SIZE);
112 OSAL_WRITEL(value, hi35xx->regBase + index * HI35XX_PIN_REG_SIZE);
120 struct Hi35xxPinCntlr *hi35xx = NULL;
121 hi35xx = (struct Hi35xxPinCntlr *)cntlr;
123 value = OSAL_READL(hi35xx->regBase + index * HI35XX_PIN_REG_SIZE);
132 struct Hi35xxPinCntlr *hi35xx = NULL;
134 hi35xx = (struct Hi35xxPinCntlr *)cntlr;
135 value = OSAL_READL(hi35xx->regBase + index * HI35XX_PIN_REG_SIZE);
137 OSAL_WRITEL(value, hi35xx->regBase + index * HI35XX_PIN_REG_SIZE);
145 struct Hi35xxPinCntlr *hi35xx = NULL;
146 hi35xx = (struct Hi35xxPinCntlr *)cntlr;
148 value = OSAL_READL(hi35xx->regBase + index * HI35XX_PIN_REG_SIZE);
159 struct Hi35xxPinCntlr *hi35xx = NULL;
161 hi35xx = (struct Hi35xxPinCntlr *)cntlr;
164 ret = strcmp(funcName, hi35xx->desc[index].func[funcNum]);
166 value = OSAL_READL(hi35xx->regBase + index * HI35XX_PIN_REG_SIZE);
168 OSAL_WRITEL(value, hi35xx->regBase + index * HI35XX_PIN_REG_SIZE);
174 PinDumperDump(hi35xx, index);
182 struct Hi35xxPinCntlr *hi35xx = NULL;
184 hi35xx = (struct Hi35xxPinCntlr *)cntlr;
186 value = OSAL_READL(hi35xx->regBase + index * HI35XX_PIN_REG_SIZE);
188 *funcName = hi35xx->desc[index].func[funcNum];
252 struct Hi35xxPinCntlr *hi35xx, int32_t index)
262 ret = drsOps->GetString(node, "pinName", &hi35xx->desc[index].pinName, "NULL");
268 ret = drsOps->GetUint32(node, "init", &hi35xx->desc[index].init, 0);
274 ret = Hi35xxPinReadFunc(&hi35xx->desc[index], node, drsOps);
279 hi35xx->cntlr.pins[index].pinName = hi35xx->desc[index].pinName;
280 hi35xx->cntlr.pins[index].priv = (void *)node;
285 static int32_t Hi35xxPinCntlrInit(struct HdfDeviceObject *device, struct Hi35xxPinCntlr *hi35xx)
295 ret = drsOps->GetUint16(device->property, "number", &hi35xx->number, 0);
300 ret = drsOps->GetUint32(device->property, "regStartBasePhy", &hi35xx->regStartBasePhy, 0);
305 ret = drsOps->GetUint32(device->property, "regSize", &hi35xx->regSize, 0);
310 ret = drsOps->GetUint32(device->property, "pinCount", &hi35xx->pinCount, 0);
315 hi35xx->cntlr.pinCount = hi35xx->pinCount;
316 hi35xx->cntlr.number = hi35xx->number;
317 hi35xx->regBase = OsalIoRemap(hi35xx->regStartBasePhy, hi35xx->regSize);
318 if (hi35xx->regBase == NULL) {
322 hi35xx->desc = (struct Hi35xxPinDesc *)OsalMemCalloc(sizeof(struct Hi35xxPinDesc) * hi35xx->pinCount);
323 if (hi35xx->desc == NULL) {
327 hi35xx->cntlr.pins = (struct PinDesc *)OsalMemCalloc(sizeof(struct PinDesc) * hi35xx->pinCount);
328 if (hi35xx->cntlr.pins == NULL) {
332 ret = PinDumperCreate(hi35xx);
351 struct Hi35xxPinCntlr *hi35xx = NULL;
353 hi35xx = (struct Hi35xxPinCntlr *)OsalMemCalloc(sizeof(*hi35xx));
354 if (hi35xx == NULL) {
355 HDF_LOGE("%s: alloc hi35xx failed", __func__);
359 ret = Hi35xxPinCntlrInit(device, hi35xx);
367 ret = Hi35xxPinParsePinNode(childNode, hi35xx, index);
369 PinDumperDestroy(hi35xx);
375 hi35xx->cntlr.method = &g_method;
376 ret = PinCntlrAdd(&hi35xx->cntlr);
379 PinDumperDestroy(hi35xx);
391 struct Hi35xxPinCntlr *hi35xx = NULL;
413 hi35xx = (struct Hi35xxPinCntlr *)cntlr;
414 if (hi35xx != NULL) {
415 if (hi35xx->regBase != NULL) {
416 OsalIoUnmap((void *)hi35xx->regBase);
418 PinDumperDestroy(hi35xx);
419 OsalMemFree(hi35xx);