Lines Matching refs:ks_sa_rng
82 struct ks_sa_rng { struct
94 struct ks_sa_rng *ks_sa_rng = dev_get_drvdata(dev); in ks_sa_rng_init() argument
97 regmap_write_bits(ks_sa_rng->regmap_cfg, SA_CMD_STATUS_OFS, in ks_sa_rng_init()
102 writel(0, &ks_sa_rng->reg_rng->control); in ks_sa_rng_init()
104 writel(value, &ks_sa_rng->reg_rng->control); in ks_sa_rng_init()
113 writel(value, &ks_sa_rng->reg_rng->config); in ks_sa_rng_init()
116 writel(0, &ks_sa_rng->reg_rng->intmask); in ks_sa_rng_init()
119 value = readl(&ks_sa_rng->reg_rng->control); in ks_sa_rng_init()
121 writel(value, &ks_sa_rng->reg_rng->control); in ks_sa_rng_init()
129 struct ks_sa_rng *ks_sa_rng = dev_get_drvdata(dev); in ks_sa_rng_cleanup() local
132 writel(0, &ks_sa_rng->reg_rng->control); in ks_sa_rng_cleanup()
133 regmap_write_bits(ks_sa_rng->regmap_cfg, SA_CMD_STATUS_OFS, in ks_sa_rng_cleanup()
140 struct ks_sa_rng *ks_sa_rng = dev_get_drvdata(dev); in ks_sa_rng_data_read() local
143 data[0] = readl(&ks_sa_rng->reg_rng->output_l); in ks_sa_rng_data_read()
144 data[1] = readl(&ks_sa_rng->reg_rng->output_h); in ks_sa_rng_data_read()
146 writel(TRNG_INTACK_REG_READY, &ks_sa_rng->reg_rng->intack); in ks_sa_rng_data_read()
154 struct ks_sa_rng *ks_sa_rng = dev_get_drvdata(dev); in ks_sa_rng_data_present() local
160 ready = readl(&ks_sa_rng->reg_rng->status); in ks_sa_rng_data_present()
174 struct ks_sa_rng *ks_sa_rng; in ks_sa_rng_probe() local
179 ks_sa_rng = devm_kzalloc(dev, sizeof(*ks_sa_rng), GFP_KERNEL); in ks_sa_rng_probe()
180 if (!ks_sa_rng) in ks_sa_rng_probe()
183 ks_sa_rng->dev = dev; in ks_sa_rng_probe()
184 ks_sa_rng->rng = (struct hwrng) { in ks_sa_rng_probe()
191 ks_sa_rng->rng.priv = (unsigned long)dev; in ks_sa_rng_probe()
194 ks_sa_rng->reg_rng = devm_ioremap_resource(dev, mem); in ks_sa_rng_probe()
195 if (IS_ERR(ks_sa_rng->reg_rng)) in ks_sa_rng_probe()
196 return PTR_ERR(ks_sa_rng->reg_rng); in ks_sa_rng_probe()
198 ks_sa_rng->regmap_cfg = in ks_sa_rng_probe()
202 if (IS_ERR(ks_sa_rng->regmap_cfg)) { in ks_sa_rng_probe()
215 platform_set_drvdata(pdev, ks_sa_rng); in ks_sa_rng_probe()
217 return devm_hwrng_register(&pdev->dev, &ks_sa_rng->rng); in ks_sa_rng_probe()