Re: [PATCH v2 2/2] hwrng: msm: Add PRNG support for MSM SoC's

From: Stephen Boyd
Date: Fri Oct 11 2013 - 16:37:13 EST


On 10/11, Stanimir Varbanov wrote:
> This adds a driver for hardware random number generator present
> on Qualcomm MSM SoC's.
>
> Signed-off-by: Stanimir Varbanov <svarbanov@xxxxxxxxxx>
> ---

Just nitpicks.

> diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
> index 0aa9d91daef5..d902330cef43 100644
> --- a/drivers/char/hw_random/Kconfig
> +++ b/drivers/char/hw_random/Kconfig
> @@ -314,3 +314,15 @@ config HW_RANDOM_TPM
> module will be called tpm-rng.
>
> If unsure, say Y.
> +
> +config HW_RANDOM_MSM
> + tristate "Qualcomm MSM Random Number Generator support"
> + depends on HW_RANDOM && ARCH_MSM && HAVE_CLK

It should be fine to drop HAVE_CLK here because ARCH_MSM always
selects COMMON_CLK which indirectly selects HAVE_CLK.

> + ---help---
> + This driver provides kernel-side support for the Random Number
> + Generator hardware found on Qualcomm MSM SoCs.
> +
> + To compile this driver as a module, choose M here. the
> + module will be called msm-rng.
> +
> + If unsure, say Y.
> diff --git a/drivers/char/hw_random/msm-rng.c b/drivers/char/hw_random/msm-rng.c
> new file mode 100644
> index 000000000000..e219e94d02c1
> --- /dev/null
> +++ b/drivers/char/hw_random/msm-rng.c
> @@ -0,0 +1,195 @@
> +#include <linux/clk.h>
> +#include <linux/hw_random.h>
> +#include <linux/io.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>

+#include <linux/err.h> for -ENOMEM usage.

> +
> +/* Device specific register offsets */
> +#define PRNG_DATA_OUT 0x0000
> +#define PRNG_STATUS 0x0004
> +#define PRNG_LFSR_CFG 0x0100
> +#define PRNG_CONFIG 0x0104
> +
[snip]
> +
> +MODULE_AUTHOR("The Linux Foundation");
> +MODULE_DESCRIPTION("Qualcomm MSM random number generator driver");
> +MODULE_LICENSE("GPL v2");

MODULE_ALIAS perhaps?

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/