Lines Matching refs:crypto_info
259 static int rk_crypto_register(struct rk_crypto_info *crypto_info) in rk_crypto_register() argument
265 rk_cipher_algs[i]->dev = crypto_info; in rk_crypto_register()
301 struct rk_crypto_info *crypto_info = data; in rk_crypto_action() local
303 reset_control_assert(crypto_info->rst); in rk_crypto_action()
315 struct rk_crypto_info *crypto_info; in rk_crypto_probe() local
318 crypto_info = devm_kzalloc(&pdev->dev, in rk_crypto_probe()
319 sizeof(*crypto_info), GFP_KERNEL); in rk_crypto_probe()
320 if (!crypto_info) { in rk_crypto_probe()
325 crypto_info->rst = devm_reset_control_get(dev, "crypto-rst"); in rk_crypto_probe()
326 if (IS_ERR(crypto_info->rst)) { in rk_crypto_probe()
327 err = PTR_ERR(crypto_info->rst); in rk_crypto_probe()
331 reset_control_assert(crypto_info->rst); in rk_crypto_probe()
333 reset_control_deassert(crypto_info->rst); in rk_crypto_probe()
335 err = devm_add_action_or_reset(dev, rk_crypto_action, crypto_info); in rk_crypto_probe()
339 spin_lock_init(&crypto_info->lock); in rk_crypto_probe()
341 crypto_info->reg = devm_platform_ioremap_resource(pdev, 0); in rk_crypto_probe()
342 if (IS_ERR(crypto_info->reg)) { in rk_crypto_probe()
343 err = PTR_ERR(crypto_info->reg); in rk_crypto_probe()
347 crypto_info->aclk = devm_clk_get(&pdev->dev, "aclk"); in rk_crypto_probe()
348 if (IS_ERR(crypto_info->aclk)) { in rk_crypto_probe()
349 err = PTR_ERR(crypto_info->aclk); in rk_crypto_probe()
353 crypto_info->hclk = devm_clk_get(&pdev->dev, "hclk"); in rk_crypto_probe()
354 if (IS_ERR(crypto_info->hclk)) { in rk_crypto_probe()
355 err = PTR_ERR(crypto_info->hclk); in rk_crypto_probe()
359 crypto_info->sclk = devm_clk_get(&pdev->dev, "sclk"); in rk_crypto_probe()
360 if (IS_ERR(crypto_info->sclk)) { in rk_crypto_probe()
361 err = PTR_ERR(crypto_info->sclk); in rk_crypto_probe()
365 crypto_info->dmaclk = devm_clk_get(&pdev->dev, "apb_pclk"); in rk_crypto_probe()
366 if (IS_ERR(crypto_info->dmaclk)) { in rk_crypto_probe()
367 err = PTR_ERR(crypto_info->dmaclk); in rk_crypto_probe()
371 crypto_info->irq = platform_get_irq(pdev, 0); in rk_crypto_probe()
372 if (crypto_info->irq < 0) { in rk_crypto_probe()
373 dev_warn(crypto_info->dev, in rk_crypto_probe()
375 err = crypto_info->irq; in rk_crypto_probe()
379 err = devm_request_irq(&pdev->dev, crypto_info->irq, in rk_crypto_probe()
384 dev_err(crypto_info->dev, "irq request failed.\n"); in rk_crypto_probe()
388 crypto_info->dev = &pdev->dev; in rk_crypto_probe()
389 platform_set_drvdata(pdev, crypto_info); in rk_crypto_probe()
391 tasklet_init(&crypto_info->queue_task, in rk_crypto_probe()
392 rk_crypto_queue_task_cb, (unsigned long)crypto_info); in rk_crypto_probe()
393 tasklet_init(&crypto_info->done_task, in rk_crypto_probe()
394 rk_crypto_done_task_cb, (unsigned long)crypto_info); in rk_crypto_probe()
395 crypto_init_queue(&crypto_info->queue, 50); in rk_crypto_probe()
397 crypto_info->enable_clk = rk_crypto_enable_clk; in rk_crypto_probe()
398 crypto_info->disable_clk = rk_crypto_disable_clk; in rk_crypto_probe()
399 crypto_info->load_data = rk_load_data; in rk_crypto_probe()
400 crypto_info->unload_data = rk_unload_data; in rk_crypto_probe()
401 crypto_info->enqueue = rk_crypto_enqueue; in rk_crypto_probe()
402 crypto_info->busy = false; in rk_crypto_probe()
404 err = rk_crypto_register(crypto_info); in rk_crypto_probe()
414 tasklet_kill(&crypto_info->queue_task); in rk_crypto_probe()
415 tasklet_kill(&crypto_info->done_task); in rk_crypto_probe()