Lines Matching defs:cntlr

373 static int32_t spidrv_open(struct SpiCntlr *cntlr)

378 if (cntlr == NULL) {
379 PRINT_ERR("%s: cntlr is null\n", __func__);
382 if (cntlr->priv == NULL) {
383 PRINT_ERR("%s: cntlr->priv is null\n", __func__);
387 params = (struct spi_params *)cntlr->priv;
398 static int32_t spidrv_close(struct SpiCntlr *cntlr)
402 if (cntlr == NULL) {
403 PRINT_ERR("%s: cntlr is null\n", __func__);
406 if (cntlr->priv == NULL) {
407 PRINT_ERR("%s: cntlr->priv is null\n", __func__);
411 params = (struct spi_params *)cntlr->priv;
419 static int32_t spidrv_setcfg(struct SpiCntlr *cntlr, struct SpiCfg *cfg)
423 if (cntlr == NULL) {
424 PRINT_ERR("%s: cntlr is null\n", __func__);
427 if (cntlr->priv == NULL) {
428 PRINT_ERR("%s: cntlr->priv is null\n", __func__);
436 params = (struct spi_params *)cntlr->priv;
495 static int32_t spidrv_getcfg(struct SpiCntlr *cntlr, struct SpiCfg *cfg)
499 if (cntlr == NULL) {
500 PRINT_ERR("%s: cntlr is null\n", __func__);
503 if (cntlr->priv == NULL) {
504 PRINT_ERR("%s: cntlr->priv is null\n", __func__);
512 params = (struct spi_params *)cntlr->priv;
534 static int32_t spidrv_transfer(struct SpiCntlr *cntlr, struct SpiMsg *msgs, uint32_t count)
543 if (cntlr == NULL) {
544 PRINT_ERR("%s: cntlr is null\n", __func__);
547 if (cntlr->priv == NULL) {
548 PRINT_ERR("%s: cntlr->priv is null\n", __func__);
556 params = (struct spi_params *)cntlr->priv;
605 struct SpiCntlr *cntlr = NULL;
614 cntlr = (struct SpiCntlr *)OsalMemAlloc(sizeof(struct SpiCntlr));
617 if (cntlr == NULL) {
618 PRINT_ERR("%s: cntlr is null\n", __func__);
619 if (cntlr != NULL) {
620 OsalMemFree(cntlr);
621 cntlr = NULL;
631 if (cntlr != NULL) {
632 OsalMemFree(cntlr);
633 cntlr = NULL;
644 PRINT_ERR("%s: cntlr is null\n", __func__);
645 if (cntlr != NULL) {
646 OsalMemFree(cntlr);
647 cntlr = NULL;
657 cntlr->busNum = params->bus;
658 cntlr->numCs = 1;
659 cntlr->curCs = 0;
660 cntlr->priv = (void *)params;
662 cntlr->method = &m_spi_method;
663 device->service = &cntlr->service;
664 cntlr->device = device;
665 cntlr->priv = (void *)params;
673 struct SpiCntlr *cntlr = NULL;
682 cntlr = SpiCntlrFromDevice(device);
683 if (cntlr == NULL) {
684 PRINT_ERR("%s: cntlr is null\n", __func__);
688 params = (struct spi_params *)cntlr->priv;
697 cntlr->priv = NULL;
698 if (cntlr != NULL) {
699 OsalMemFree(cntlr);
700 cntlr = NULL;