.. | .. |
---|
666 | 666 | struct device *dev = ctrl->dev; |
---|
667 | 667 | int ret, size; |
---|
668 | 668 | |
---|
669 | | - ctrl->dma_rx_channel = dma_request_slave_channel(dev, "rx"); |
---|
670 | | - if (!ctrl->dma_rx_channel) { |
---|
671 | | - dev_err(dev, "Failed to request dma channels"); |
---|
672 | | - return -EINVAL; |
---|
| 669 | + ctrl->dma_rx_channel = dma_request_chan(dev, "rx"); |
---|
| 670 | + if (IS_ERR(ctrl->dma_rx_channel)) { |
---|
| 671 | + dev_err(dev, "Failed to request RX dma channel"); |
---|
| 672 | + ret = PTR_ERR(ctrl->dma_rx_channel); |
---|
| 673 | + ctrl->dma_rx_channel = NULL; |
---|
| 674 | + return ret; |
---|
673 | 675 | } |
---|
674 | 676 | |
---|
675 | 677 | size = QCOM_SLIM_NGD_DESC_NUM * SLIM_MSGQ_BUF_LEN; |
---|
.. | .. |
---|
703 | 705 | int ret = 0; |
---|
704 | 706 | int size; |
---|
705 | 707 | |
---|
706 | | - ctrl->dma_tx_channel = dma_request_slave_channel(dev, "tx"); |
---|
707 | | - if (!ctrl->dma_tx_channel) { |
---|
708 | | - dev_err(dev, "Failed to request dma channels"); |
---|
709 | | - return -EINVAL; |
---|
| 708 | + ctrl->dma_tx_channel = dma_request_chan(dev, "tx"); |
---|
| 709 | + if (IS_ERR(ctrl->dma_tx_channel)) { |
---|
| 710 | + dev_err(dev, "Failed to request TX dma channel"); |
---|
| 711 | + ret = PTR_ERR(ctrl->dma_tx_channel); |
---|
| 712 | + ctrl->dma_tx_channel = NULL; |
---|
| 713 | + return ret; |
---|
710 | 714 | } |
---|
711 | 715 | |
---|
712 | 716 | size = ((QCOM_SLIM_NGD_DESC_NUM + 1) * SLIM_MSGQ_BUF_LEN); |
---|
.. | .. |
---|
777 | 781 | u8 la = txn->la; |
---|
778 | 782 | bool usr_msg = false; |
---|
779 | 783 | |
---|
780 | | - if (txn->mc & SLIM_MSG_CLK_PAUSE_SEQ_FLG) |
---|
781 | | - return -EPROTONOSUPPORT; |
---|
782 | | - |
---|
783 | 784 | if (txn->mt == SLIM_MSG_MT_CORE && |
---|
784 | 785 | (txn->mc >= SLIM_MSG_MC_BEGIN_RECONFIGURATION && |
---|
785 | 786 | txn->mc <= SLIM_MSG_MC_RECONFIGURE_NOW)) |
---|
.. | .. |
---|
790 | 791 | |
---|
791 | 792 | if (txn->msg->num_bytes > SLIM_MSGQ_BUF_LEN || |
---|
792 | 793 | txn->rl > SLIM_MSGQ_BUF_LEN) { |
---|
793 | | - dev_err(ctrl->dev, "msg exeeds HW limit\n"); |
---|
| 794 | + dev_err(ctrl->dev, "msg exceeds HW limit\n"); |
---|
794 | 795 | return -EINVAL; |
---|
795 | 796 | } |
---|
796 | 797 | |
---|
.. | .. |
---|
1004 | 1005 | struct slim_eaddr *ea, u8 *laddr) |
---|
1005 | 1006 | { |
---|
1006 | 1007 | struct slim_val_inf msg = {0}; |
---|
| 1008 | + u8 failed_ea[6] = {0, 0, 0, 0, 0, 0}; |
---|
1007 | 1009 | struct slim_msg_txn txn; |
---|
1008 | 1010 | u8 wbuf[10] = {0}; |
---|
1009 | 1011 | u8 rbuf[10] = {0}; |
---|
.. | .. |
---|
1033 | 1035 | slim_free_txn_tid(ctrl, &txn); |
---|
1034 | 1036 | return ret; |
---|
1035 | 1037 | } |
---|
| 1038 | + |
---|
| 1039 | + if (!memcmp(rbuf, failed_ea, 6)) |
---|
| 1040 | + return -ENXIO; |
---|
1036 | 1041 | |
---|
1037 | 1042 | *laddr = rbuf[6]; |
---|
1038 | 1043 | |
---|
.. | .. |
---|
1324 | 1329 | { |
---|
1325 | 1330 | .compatible = "qcom,slim-ngd-v1.5.0", |
---|
1326 | 1331 | .data = &ngd_v1_5_offset_info, |
---|
| 1332 | + },{ |
---|
| 1333 | + .compatible = "qcom,slim-ngd-v2.1.0", |
---|
| 1334 | + .data = &ngd_v1_5_offset_info, |
---|
1327 | 1335 | }, |
---|
1328 | 1336 | {} |
---|
1329 | 1337 | }; |
---|
.. | .. |
---|
1346 | 1354 | continue; |
---|
1347 | 1355 | |
---|
1348 | 1356 | ngd = kzalloc(sizeof(*ngd), GFP_KERNEL); |
---|
1349 | | - if (!ngd) |
---|
| 1357 | + if (!ngd) { |
---|
| 1358 | + of_node_put(node); |
---|
1350 | 1359 | return -ENOMEM; |
---|
| 1360 | + } |
---|
1351 | 1361 | |
---|
1352 | 1362 | ngd->pdev = platform_device_alloc(QCOM_SLIM_NGD_DRV_NAME, id); |
---|
1353 | 1363 | if (!ngd->pdev) { |
---|
1354 | 1364 | kfree(ngd); |
---|
| 1365 | + of_node_put(node); |
---|
1355 | 1366 | return -ENOMEM; |
---|
1356 | 1367 | } |
---|
1357 | 1368 | ngd->id = id; |
---|
.. | .. |
---|
1363 | 1374 | platform_device_add(ngd->pdev); |
---|
1364 | 1375 | ngd->base = ctrl->base + ngd->id * data->offset + |
---|
1365 | 1376 | (ngd->id - 1) * data->size; |
---|
1366 | | - ctrl->ngd = ngd; |
---|
1367 | 1377 | |
---|
1368 | 1378 | return 0; |
---|
1369 | 1379 | } |
---|