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<timur@xxxxxxxxxxxxxx>
[port to crypto API]
Signed-off-by: Vinod Koul<vkoul@xxxxxxxxxx>
+ /*
+ * ACPI systems have v2 hardware. The clocks are always enabled,
+ * the PRNG register space is read-only and the PRNG should
+ * already be enabled.
+ */
+ if (has_acpi_companion(&pdev->dev)) {
+ val = readl(rng->base + PRNG_CONFIG);
+ if (!(val & PRNG_CONFIG_HW_ENABLE)) {
+ dev_err(&pdev->dev, "device is not enabled\n");
+ return -ENODEV;
+ }