Lines Matching defs:cntlr
145 static int32_t Hi35xxI2sEnable(struct I2sCntlr *cntlr)
147 if (cntlr == NULL || cntlr->priv == NULL) {
148 I2S_PRINT_LOG_ERR("%s: cntlr priv or cfg is NULL", __func__);
154 static int32_t Hi35xxI2sDisable(struct I2sCntlr *cntlr)
156 if (cntlr == NULL || cntlr->priv == NULL) {
157 I2S_PRINT_LOG_ERR("%s: cntlr priv or cfg is NULL", __func__);
161 struct I2sConfigInfo *i2sCfg = (struct I2sConfigInfo *)cntlr->priv;
171 static int32_t Hi35xxI2sOpen(struct I2sCntlr *cntlr)
173 (void)cntlr;
177 static int32_t Hi35xxI2sClose(struct I2sCntlr *cntlr)
179 (void)cntlr;
183 static int32_t Hi35xxI2sGetCfg(struct I2sCntlr *cntlr, struct I2sCfg *cfg)
185 if (cntlr == NULL || cntlr->priv == NULL || cfg == NULL) {
186 I2S_PRINT_LOG_ERR("%s: cntlr priv or cfg is NULL", __func__);
190 struct I2sConfigInfo *i2sCfg = (struct I2sConfigInfo *)cntlr->priv;
211 static int32_t Hi35xxI2sSetCfg(struct I2sCntlr *cntlr, struct I2sCfg *cfg)
215 if (cntlr == NULL || cntlr->priv == NULL || cfg == NULL) {
216 I2S_PRINT_LOG_ERR("%s: cntlr priv or cfg is NULL", __func__);
220 i2sCfg = (struct I2sConfigInfo *)cntlr->priv;
274 static int32_t Hi35xxI2sStartWrite(struct I2sCntlr *cntlr)
276 if (cntlr == NULL || cntlr->priv == NULL) {
277 I2S_PRINT_LOG_ERR("%s: cntlr priv or cfg is NULL", __func__);
280 struct I2sConfigInfo *i2sCfg = (struct I2sConfigInfo *)cntlr->priv;
299 static int32_t Hi35xxI2sStopWrite(struct I2sCntlr *cntlr)
303 if (cntlr == NULL || cntlr->priv == NULL) {
304 I2S_PRINT_LOG_ERR("%s: cntlr priv or cfg is NULL", __func__);
307 i2sCfg = (struct I2sConfigInfo *)cntlr->priv;
343 static int32_t Hi35xxI2sStartRead(struct I2sCntlr *cntlr)
346 if (cntlr == NULL || cntlr->priv == NULL) {
347 I2S_PRINT_LOG_ERR("%s: cntlr priv or cfg is NULL", __func__);
350 i2sCfg = (struct I2sConfigInfo *)cntlr->priv;
369 static int32_t Hi35xxI2sStopRead(struct I2sCntlr *cntlr)
373 if (cntlr == NULL || cntlr->priv == NULL) {
374 I2S_PRINT_LOG_ERR("%s: cntlr priv or cfg is NULL", __func__);
377 i2sCfg = (struct I2sConfigInfo *)cntlr->priv;
419 static int32_t Hi35xxI2sRead(struct I2sCntlr *cntlr, struct I2sMsg *msgs)
421 if (cntlr == NULL || cntlr->priv == NULL || msgs == NULL || msgs->rbuf == NULL || msgs->pRlen == NULL) {
427 i2sCfg = (struct I2sConfigInfo *)cntlr->priv;
448 static int32_t Hi35xxI2sWrite(struct I2sCntlr *cntlr, struct I2sMsg *msgs)
450 if (cntlr == NULL || cntlr->priv == NULL || msgs == NULL) {
456 i2sCfg = (struct I2sConfigInfo *)cntlr->priv;
498 static int32_t Hi35xxI2sTransfer(struct I2sCntlr *cntlr, struct I2sMsg *msgs)
500 if (cntlr == NULL || cntlr->priv == NULL || msgs == NULL) {
506 i2sCfg = (struct I2sConfigInfo *)cntlr->priv;
509 Hi35xxI2sRead(cntlr, msgs);
511 Hi35xxI2sWrite(cntlr, msgs);
534 static int32_t I2sGetConfigInfoFromHcs(struct I2sCntlr *cntlr, const struct DeviceResourceNode *node)
538 if (cntlr == NULL || node == NULL || iface == NULL || iface->GetUint32 == NULL) {
542 if (iface->GetUint32(node, "busNum", &cntlr->busNum, 0) != HDF_SUCCESS) {
546 if (iface->GetUint32(node, "irqNum", &cntlr->irqNum, 0) != HDF_SUCCESS) {
607 static int32_t I2sInit(struct I2sCntlr *cntlr, const struct HdfDeviceObject *device)
612 if (device->property == NULL || cntlr == NULL) {
623 ret = I2sGetConfigInfoFromHcs(cntlr, device->property);
636 configInfo->busNum = cntlr->busNum;
646 cntlr->priv = configInfo;
647 cntlr->method = &g_i2sCntlrMethod;
670 struct I2sCntlr *cntlr = NULL;
677 cntlr = I2sCntlrFromDevice(device);
678 if (cntlr == NULL) {
679 I2S_PRINT_LOG_ERR("%s: cntlr is null", __func__);
683 int32_t ret = I2sInit(cntlr, device);
693 struct I2sCntlr *cntlr = NULL;
699 cntlr = I2sCntlrFromDevice(device);
700 if (cntlr == NULL) {
701 I2S_PRINT_LOG_ERR("%s: cntlr is NULL", __func__);
705 if (cntlr->priv != NULL) {
706 struct I2sConfigInfo *configInfo = cntlr->priv;
717 OsalMemFree(cntlr->priv);
720 I2sCntlrDestroy(cntlr);