Lines Matching +full:multi +full:- +full:subsystems
1 // SPDX-License-Identifier: GPL-2.0
9 #include <linux/nvmem-provider.h>
79 * On Spreadtrum platform, we have multi-subsystems will access the unique
81 * the multiple subsystems.
87 mutex_lock(&efuse->mutex); in sc27xx_efuse_lock()
89 ret = hwspin_lock_timeout_raw(efuse->hwlock, in sc27xx_efuse_lock()
92 dev_err(efuse->dev, "timeout to get the hwspinlock\n"); in sc27xx_efuse_lock()
93 mutex_unlock(&efuse->mutex); in sc27xx_efuse_lock()
102 hwspin_unlock_raw(efuse->hwlock); in sc27xx_efuse_unlock()
103 mutex_unlock(&efuse->mutex); in sc27xx_efuse_unlock()
111 ret = regmap_read_poll_timeout(efuse->regmap, in sc27xx_efuse_poll_status()
112 efuse->base + SC27XX_EFUSE_STATUS, in sc27xx_efuse_poll_status()
117 dev_err(efuse->dev, "timeout to update the efuse status\n"); in sc27xx_efuse_poll_status()
133 return -EINVAL; in sc27xx_efuse_read()
140 ret = regmap_update_bits(efuse->regmap, efuse->var_data->module_en, in sc27xx_efuse_read()
154 ret = regmap_write(efuse->regmap, in sc27xx_efuse_read()
155 efuse->base + SC27XX_EFUSE_BLOCK_INDEX, in sc27xx_efuse_read()
161 ret = regmap_update_bits(efuse->regmap, in sc27xx_efuse_read()
162 efuse->base + SC27XX_EFUSE_MODE_CTRL, in sc27xx_efuse_read()
177 ret = regmap_read(efuse->regmap, efuse->base + SC27XX_EFUSE_DATA_RD, in sc27xx_efuse_read()
183 ret = regmap_update_bits(efuse->regmap, in sc27xx_efuse_read()
184 efuse->base + SC27XX_EFUSE_MODE_CTRL, in sc27xx_efuse_read()
190 regmap_update_bits(efuse->regmap, efuse->var_data->module_en, SC27XX_EFUSE_EN, 0); in sc27xx_efuse_read()
204 struct device_node *np = pdev->dev.of_node; in sc27xx_efuse_probe()
210 efuse = devm_kzalloc(&pdev->dev, sizeof(*efuse), GFP_KERNEL); in sc27xx_efuse_probe()
212 return -ENOMEM; in sc27xx_efuse_probe()
214 efuse->regmap = dev_get_regmap(pdev->dev.parent, NULL); in sc27xx_efuse_probe()
215 if (!efuse->regmap) { in sc27xx_efuse_probe()
216 dev_err(&pdev->dev, "failed to get efuse regmap\n"); in sc27xx_efuse_probe()
217 return -ENODEV; in sc27xx_efuse_probe()
220 ret = of_property_read_u32(np, "reg", &efuse->base); in sc27xx_efuse_probe()
222 dev_err(&pdev->dev, "failed to get efuse base address\n"); in sc27xx_efuse_probe()
228 dev_err(&pdev->dev, "failed to get hwspinlock id\n"); in sc27xx_efuse_probe()
232 efuse->hwlock = devm_hwspin_lock_request_specific(&pdev->dev, ret); in sc27xx_efuse_probe()
233 if (!efuse->hwlock) { in sc27xx_efuse_probe()
234 dev_err(&pdev->dev, "failed to request hwspinlock\n"); in sc27xx_efuse_probe()
235 return -ENXIO; in sc27xx_efuse_probe()
238 mutex_init(&efuse->mutex); in sc27xx_efuse_probe()
239 efuse->dev = &pdev->dev; in sc27xx_efuse_probe()
240 efuse->var_data = of_device_get_match_data(&pdev->dev); in sc27xx_efuse_probe()
245 econfig.name = "sc27xx-efuse"; in sc27xx_efuse_probe()
249 econfig.dev = &pdev->dev; in sc27xx_efuse_probe()
251 nvmem = devm_nvmem_register(&pdev->dev, &econfig); in sc27xx_efuse_probe()
253 dev_err(&pdev->dev, "failed to register nvmem config\n"); in sc27xx_efuse_probe()
261 { .compatible = "sprd,sc2731-efuse", .data = &sc2731_edata},
262 { .compatible = "sprd,sc2730-efuse", .data = &sc2730_edata},
270 .name = "sc27xx-efuse",