Lines Matching refs:ddata

40 	struct omap_rom_rng *ddata;  in omap3_rom_rng_read()  local
44 ddata = (struct omap_rom_rng *)rng->priv; in omap3_rom_rng_read()
46 r = pm_runtime_get_sync(ddata->dev); in omap3_rom_rng_read()
48 pm_runtime_put_noidle(ddata->dev); in omap3_rom_rng_read()
54 r = ddata->rom_rng_call(ptr, 4, RNG_GEN_HW); in omap3_rom_rng_read()
60 pm_runtime_mark_last_busy(ddata->dev); in omap3_rom_rng_read()
61 pm_runtime_put_autosuspend(ddata->dev); in omap3_rom_rng_read()
68 struct omap_rom_rng *ddata; in omap_rom_rng_runtime_suspend() local
71 ddata = dev_get_drvdata(dev); in omap_rom_rng_runtime_suspend()
73 r = ddata->rom_rng_call(0, 0, RNG_RESET); in omap_rom_rng_runtime_suspend()
77 clk_disable_unprepare(ddata->clk); in omap_rom_rng_runtime_suspend()
84 struct omap_rom_rng *ddata; in omap_rom_rng_runtime_resume() local
87 ddata = dev_get_drvdata(dev); in omap_rom_rng_runtime_resume()
89 r = clk_prepare_enable(ddata->clk); in omap_rom_rng_runtime_resume()
93 r = ddata->rom_rng_call(0, 0, RNG_GEN_PRNG_HW_INIT); in omap_rom_rng_runtime_resume()
95 clk_disable_unprepare(ddata->clk); in omap_rom_rng_runtime_resume()
106 struct omap_rom_rng *ddata = data; in omap_rom_rng_finish() local
108 pm_runtime_dont_use_autosuspend(ddata->dev); in omap_rom_rng_finish()
109 pm_runtime_disable(ddata->dev); in omap_rom_rng_finish()
114 struct omap_rom_rng *ddata; in omap3_rom_rng_probe() local
117 ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL); in omap3_rom_rng_probe()
118 if (!ddata) in omap3_rom_rng_probe()
121 ddata->dev = &pdev->dev; in omap3_rom_rng_probe()
122 ddata->ops.priv = (unsigned long)ddata; in omap3_rom_rng_probe()
123 ddata->ops.name = "omap3-rom"; in omap3_rom_rng_probe()
124 ddata->ops.read = of_device_get_match_data(&pdev->dev); in omap3_rom_rng_probe()
125 ddata->ops.quality = 900; in omap3_rom_rng_probe()
126 if (!ddata->ops.read) { in omap3_rom_rng_probe()
131 dev_set_drvdata(ddata->dev, ddata); in omap3_rom_rng_probe()
133 ddata->rom_rng_call = pdev->dev.platform_data; in omap3_rom_rng_probe()
134 if (!ddata->rom_rng_call) { in omap3_rom_rng_probe()
135 dev_err(ddata->dev, "rom_rng_call is NULL\n"); in omap3_rom_rng_probe()
139 ddata->clk = devm_clk_get(ddata->dev, "ick"); in omap3_rom_rng_probe()
140 if (IS_ERR(ddata->clk)) { in omap3_rom_rng_probe()
141 dev_err(ddata->dev, "unable to get RNG clock\n"); in omap3_rom_rng_probe()
142 return PTR_ERR(ddata->clk); in omap3_rom_rng_probe()
149 ret = devm_add_action_or_reset(ddata->dev, omap_rom_rng_finish, in omap3_rom_rng_probe()
150 ddata); in omap3_rom_rng_probe()
154 return devm_hwrng_register(ddata->dev, &ddata->ops); in omap3_rom_rng_probe()