Loading Documentation/devicetree/bindings/hwrng/timeriomem_rng.txt 0 → 100644 +18 −0 Original line number Diff line number Diff line HWRNG support for the timeriomem_rng driver Required properties: - compatible : "timeriomem_rng" - reg : base address to sample from - period : wait time in microseconds to use between samples N.B. currently 'reg' must be four bytes wide and aligned Example: hwrng@44 { #address-cells = <1>; #size-cells = <1>; compatible = "timeriomem_rng"; reg = <0x44 0x04>; period = <1000000>; }; drivers/char/hw_random/timeriomem-rng.c +22 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <linux/module.h> #include <linux/kernel.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/hw_random.h> #include <linux/io.h> #include <linux/slab.h> Loading Loading @@ -101,7 +102,7 @@ static int timeriomem_rng_probe(struct platform_device *pdev) int err = 0; int period; if (!pdata) { if (!pdev->dev.of_node && !pdata) { dev_err(&pdev->dev, "timeriomem_rng_data is missing\n"); return -EINVAL; } Loading @@ -125,6 +126,18 @@ static int timeriomem_rng_probe(struct platform_device *pdev) platform_set_drvdata(pdev, priv); if (pdev->dev.of_node) { int i; if (!of_property_read_u32(pdev->dev.of_node, "period", &i)) period = i; else { dev_err(&pdev->dev, "missing period\n"); err = -EINVAL; goto out_free; } } else period = pdata->period; priv->period = usecs_to_jiffies(period); Loading Loading @@ -202,10 +215,17 @@ static int timeriomem_rng_remove(struct platform_device *pdev) return 0; } static const struct of_device_id timeriomem_rng_match[] = { { .compatible = "timeriomem_rng" }, {}, }; MODULE_DEVICE_TABLE(of, timeriomem_rng_match); static struct platform_driver timeriomem_rng_driver = { .driver = { .name = "timeriomem_rng", .owner = THIS_MODULE, .of_match_table = timeriomem_rng_match, }, .probe = timeriomem_rng_probe, .remove = timeriomem_rng_remove, Loading Loading
Documentation/devicetree/bindings/hwrng/timeriomem_rng.txt 0 → 100644 +18 −0 Original line number Diff line number Diff line HWRNG support for the timeriomem_rng driver Required properties: - compatible : "timeriomem_rng" - reg : base address to sample from - period : wait time in microseconds to use between samples N.B. currently 'reg' must be four bytes wide and aligned Example: hwrng@44 { #address-cells = <1>; #size-cells = <1>; compatible = "timeriomem_rng"; reg = <0x44 0x04>; period = <1000000>; };
drivers/char/hw_random/timeriomem-rng.c +22 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <linux/module.h> #include <linux/kernel.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/hw_random.h> #include <linux/io.h> #include <linux/slab.h> Loading Loading @@ -101,7 +102,7 @@ static int timeriomem_rng_probe(struct platform_device *pdev) int err = 0; int period; if (!pdata) { if (!pdev->dev.of_node && !pdata) { dev_err(&pdev->dev, "timeriomem_rng_data is missing\n"); return -EINVAL; } Loading @@ -125,6 +126,18 @@ static int timeriomem_rng_probe(struct platform_device *pdev) platform_set_drvdata(pdev, priv); if (pdev->dev.of_node) { int i; if (!of_property_read_u32(pdev->dev.of_node, "period", &i)) period = i; else { dev_err(&pdev->dev, "missing period\n"); err = -EINVAL; goto out_free; } } else period = pdata->period; priv->period = usecs_to_jiffies(period); Loading Loading @@ -202,10 +215,17 @@ static int timeriomem_rng_remove(struct platform_device *pdev) return 0; } static const struct of_device_id timeriomem_rng_match[] = { { .compatible = "timeriomem_rng" }, {}, }; MODULE_DEVICE_TABLE(of, timeriomem_rng_match); static struct platform_driver timeriomem_rng_driver = { .driver = { .name = "timeriomem_rng", .owner = THIS_MODULE, .of_match_table = timeriomem_rng_match, }, .probe = timeriomem_rng_probe, .remove = timeriomem_rng_remove, Loading