Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2023048imm; Tue, 10 Jul 2018 11:47:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf1fnmJSpUWfzg8N2geJ5bA30OVtNIVbsKzyHiWQac9hqNIlT/R5WGS4sLlIWECsKopoyNw X-Received: by 2002:a17:902:1127:: with SMTP id d36-v6mr26088281pla.267.1531248454521; Tue, 10 Jul 2018 11:47:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531248454; cv=none; d=google.com; s=arc-20160816; b=Vy6siXcpjm7P0aTsmHiZLsNNoj0Dzv9GhD4OSsOoJ2vvg0mpoiIJK6HwmQNvsM4U4d 0oy4TJoTNluRhjkfKSqr0++VttJEjse0asHuPhgzimDgbVgYD3zS9muUa1J3KBibEa9H uu99xyc657zuH9/nkIzlJV0IVOq5UfGifEYizbjmYv4GxFEYt10kp6dVOHDp9aJKtcpP 7EeLFUqhf6n8udGxNzxZt4trMJ7QrqqG1iG+bosI+Rxikf2KltZfYEejeCCAz1NXhBY8 cD+b3PvMByv3hamj4V8sh1ZAfY9TlzZ3c1OVBhkfieCTXQnFiI7tdOAXwSsOcizuOJY/ qERA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=Vdg94NvB91xi0JYQH7NjOfFcdjtsZ9n7r+hY3m/XY34=; b=0G0gS6RRW7CGpsqVZnkfaUaydHDAlLdsnZP0FT1q4Sh+JNfNKMszXmoTlFXoYa4vAC MJaOw/sPJ5zMn9SyCGvCuiajTjdUSbIBFx1HfNapcrzx3U8dGE2RLLi7fW9T7MWq4Uve WDxuADTjSeHwfmiH0ipBCjGiO7909twYs+iWURW4vnzGoZdzPrBsT4M4JRrJd8M8iXqW K6oOkIP2glst/rFZ1tHdJTPtt694K474vEMAZrCrLu8zSE9aL4WSEBo8/2oXeW80sD3G hur1h4Y39/sgoemM1yHV+mjwaptjmNsVv3AO/fcZ7pFUO7eQGeUYnie2NZkoTitZCDZ8 7kjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=pGMn10+h; dkim=pass header.i=@codeaurora.org header.s=default header.b=CRdIOZOj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7-v6si16326483pgf.231.2018.07.10.11.47.19; Tue, 10 Jul 2018 11:47:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=pGMn10+h; dkim=pass header.i=@codeaurora.org header.s=default header.b=CRdIOZOj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389205AbeGJSp3 (ORCPT + 99 others); Tue, 10 Jul 2018 14:45:29 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:36666 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732443AbeGJSp3 (ORCPT ); Tue, 10 Jul 2018 14:45:29 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5360B60B26; Tue, 10 Jul 2018 17:27:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1531243628; bh=M5IFkUPlOhbJ7uNEKajrwoZY2izVPWF9L2p6i0my0a4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=pGMn10+hVxQYJy6I4z0lkn4ulU5JEQb6tzxgXb1rwLydxoU6KpS0JXEGXgg2oPZSr 7cDvUFjCGx0MWEvP0oSuYNvtg0c4jjnHADCYzCqS/op4shtEcrL5kYriZ81mEKyZBH 5bu14YI2X3rrLfB073R1wIjxqRlBLuJMVL0In0qg= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.226.60.81] (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jhugo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id A93BB607EB; Tue, 10 Jul 2018 17:27:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1531243627; bh=M5IFkUPlOhbJ7uNEKajrwoZY2izVPWF9L2p6i0my0a4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=CRdIOZOjXvBIojugC2jknEdEI+MS0IANBf+aOQWjuW5PnegTsE3bAkldMzklaHJi7 u/SB49sOYQmExsgzZs/XlCspmIcGzgtL2qQ16FJxbZDeT6svpt1ax34B3g6H3Nf0L6 +ekiuXEUJYpCWyZymLeB7345znS1HOQ5N5ZeonXU= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A93BB607EB Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jhugo@codeaurora.org Subject: Re: [PATCH v5 6/6] crypto: qcom: Add ACPI support To: Vinod Koul , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bjorn Andersson , Matt Mackall , Herbert Xu , Arnd Bergmann , linux-arm-msm@vger.kernel.org, Stephen Boyd , Timur Tabi References: <20180709061925.20276-1-vkoul@kernel.org> <20180709061925.20276-7-vkoul@kernel.org> From: Jeffrey Hugo Message-ID: <2a678412-26d4-769e-ff6f-ace5d53e70b5@codeaurora.org> Date: Tue, 10 Jul 2018 11:27:05 -0600 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180709061925.20276-7-vkoul@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/9/2018 12:19 AM, Vinod Koul wrote: > From: Timur Tabi > > Add support for probing on ACPI systems, with ACPI HID QCOM8160. > > On ACPI systems, clocks are always enabled, the PRNG should > already be enabled, and the register region is read-only. > The driver only verifies that the hardware is already > enabled never tries to disable or configure it. > > Signed-off-by: Timur Tabi > [port to crypto API] > Signed-off-by: Vinod Koul Tested-by: Jeffrey Hugo > --- > drivers/crypto/qcom-rng.c | 22 ++++++++++++++++++---- > 1 file changed, 18 insertions(+), 4 deletions(-) > > diff --git a/drivers/crypto/qcom-rng.c b/drivers/crypto/qcom-rng.c > index f1bd86acaf9d..8118d4cd93b2 100644 > --- a/drivers/crypto/qcom-rng.c > +++ b/drivers/crypto/qcom-rng.c > @@ -4,6 +4,7 @@ > // Based on msm-rng.c and downstream driver > > #include > +#include > #include > #include > #include > @@ -168,13 +169,17 @@ static int qcom_rng_probe(struct platform_device *pdev) > if (IS_ERR(rng->base)) > return PTR_ERR(rng->base); > > - rng->clk = devm_clk_get(&pdev->dev, "core"); > - if (IS_ERR(rng->clk)) > - return PTR_ERR(rng->clk); > > - rng->skip_init = (unsigned long)of_device_get_match_data(&pdev->dev); > + /* ACPI systems have clk already on, so skip clk_get */ > + if (!has_acpi_companion(&pdev->dev)) { > + rng->clk = devm_clk_get(&pdev->dev, "core"); > + if (IS_ERR(rng->clk)) > + return PTR_ERR(rng->clk); > + } > > + rng->skip_init = (unsigned long)device_get_match_data(&pdev->dev); > qcom_rng_dev = rng; > + > ret = crypto_register_rng(&qcom_rng_alg); > if (ret) { > dev_err(&pdev->dev, "Register crypto rng failed: %d\n", ret); > @@ -193,6 +198,14 @@ static int qcom_rng_remove(struct platform_device *pdev) > return 0; > } > > +#if IS_ENABLED(CONFIG_ACPI) > +static const struct acpi_device_id qcom_rng_acpi_match[] = { > + { .id = "QCOM8160", .driver_data = 1 }, > + {} > +}; > +MODULE_DEVICE_TABLE(acpi, qcom_rng_acpi_match); > +#endif > + > static const struct of_device_id qcom_rng_of_match[] = { > { .compatible = "qcom,prng", .data = (void *)0}, > { .compatible = "qcom,prng-ee", .data = (void *)1}, > @@ -206,6 +219,7 @@ static struct platform_driver qcom_rng_driver = { > .driver = { > .name = KBUILD_MODNAME, > .of_match_table = of_match_ptr(qcom_rng_of_match), > + .acpi_match_table = ACPI_PTR(qcom_rng_acpi_match), > } > }; > module_platform_driver(qcom_rng_driver); > -- Jeffrey Hugo Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.