Lines Matching +full:silex +full:- +full:insight
1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright (c) 2020 Silex Insight
49 return ioread32(ba431->base + reg); in ba431_trng_read_reg()
55 iowrite32(val, ba431->base + reg); in ba431_trng_write_reg()
89 dev_err(ba431->dev, "reset failed (state: %d)\n", in ba431_trng_reset()
91 return -ETIMEDOUT; in ba431_trng_reset()
94 dev_info(ba431->dev, "reset done\n"); in ba431_trng_reset()
104 atomic_set(&ba431->reset_pending, 0); in ba431_trng_reset_work()
109 if (atomic_cmpxchg(&ba431->reset_pending, 0, 1)) in ba431_trng_schedule_reset()
112 schedule_work(&ba431->reset_work); in ba431_trng_schedule_reset()
141 max -= sizeof(*data); in ba431_trng_read()
142 } while (--i && (max > 0)); in ba431_trng_read()
145 n -= (level - i); in ba431_trng_read()
152 return (n || !wait) ? n : -EIO; in ba431_trng_read()
160 cancel_work_sync(&ba431->reset_work); in ba431_trng_cleanup()
175 ba431 = devm_kzalloc(&pdev->dev, sizeof(*ba431), GFP_KERNEL); in ba431_trng_probe()
177 return -ENOMEM; in ba431_trng_probe()
179 ba431->dev = &pdev->dev; in ba431_trng_probe()
181 ba431->base = devm_platform_ioremap_resource(pdev, 0); in ba431_trng_probe()
182 if (IS_ERR(ba431->base)) in ba431_trng_probe()
183 return PTR_ERR(ba431->base); in ba431_trng_probe()
185 atomic_set(&ba431->reset_pending, 0); in ba431_trng_probe()
186 INIT_WORK(&ba431->reset_work, ba431_trng_reset_work); in ba431_trng_probe()
187 ba431->rng.name = pdev->name; in ba431_trng_probe()
188 ba431->rng.init = ba431_trng_init; in ba431_trng_probe()
189 ba431->rng.cleanup = ba431_trng_cleanup; in ba431_trng_probe()
190 ba431->rng.read = ba431_trng_read; in ba431_trng_probe()
192 ret = devm_hwrng_register(&pdev->dev, &ba431->rng); in ba431_trng_probe()
194 return dev_err_probe(&pdev->dev, ret, "BA431 registration failed\n"); in ba431_trng_probe()
196 dev_info(&pdev->dev, "BA431 TRNG registered\n"); in ba431_trng_probe()
202 { .compatible = "silex-insight,ba431-rng" },
209 .name = "ba431-rng",
218 MODULE_DESCRIPTION("TRNG driver for Silex Insight BA431");