Lines Matching refs:rkc
94 struct rk_crypto_info *rkc; in rk_cipher_handle_req() local
100 rkc = get_rk_crypto(); in rk_cipher_handle_req()
102 engine = rkc->engine; in rk_cipher_handle_req()
103 rctx->dev = rkc; in rk_cipher_handle_req()
315 struct rk_crypto_info *rkc = rctx->dev; in rk_cipher_run() local
317 err = pm_runtime_resume_and_get(rkc->dev); in rk_cipher_run()
322 rkc->nreq++; in rk_cipher_run()
348 err = dma_map_sg(rkc->dev, sgs, 1, DMA_BIDIRECTIONAL); in rk_cipher_run()
354 err = dma_map_sg(rkc->dev, sgs, 1, DMA_TO_DEVICE); in rk_cipher_run()
359 err = dma_map_sg(rkc->dev, sgd, 1, DMA_FROM_DEVICE); in rk_cipher_run()
366 rk_cipher_hw_init(rkc, areq); in rk_cipher_run()
369 memcpy_toio(rkc->reg + RK_CRYPTO_TDES_IV_0, ivtouse, ivsize); in rk_cipher_run()
371 memcpy_toio(rkc->reg + RK_CRYPTO_AES_IV_0, ivtouse, ivsize); in rk_cipher_run()
373 reinit_completion(&rkc->complete); in rk_cipher_run()
374 rkc->status = 0; in rk_cipher_run()
378 crypto_dma_start(rkc, sgs, sgd, todo / 4); in rk_cipher_run()
379 wait_for_completion_interruptible_timeout(&rkc->complete, in rk_cipher_run()
381 if (!rkc->status) { in rk_cipher_run()
382 dev_err(rkc->dev, "DMA timeout\n"); in rk_cipher_run()
387 dma_unmap_sg(rkc->dev, sgs, 1, DMA_BIDIRECTIONAL); in rk_cipher_run()
389 dma_unmap_sg(rkc->dev, sgs, 1, DMA_TO_DEVICE); in rk_cipher_run()
390 dma_unmap_sg(rkc->dev, sgd, 1, DMA_FROM_DEVICE); in rk_cipher_run()
416 pm_runtime_put_autosuspend(rkc->dev); in rk_cipher_run()
425 dma_unmap_sg(rkc->dev, sgs, 1, DMA_BIDIRECTIONAL); in rk_cipher_run()
427 dma_unmap_sg(rkc->dev, sgs, 1, DMA_TO_DEVICE); in rk_cipher_run()
428 dma_unmap_sg(rkc->dev, sgd, 1, DMA_FROM_DEVICE); in rk_cipher_run()