Lines Matching +full:tcsr +full:- +full:reg
1 // SPDX-License-Identifier: GPL-2.0
30 struct regmap_field *field = lock->priv; in qcom_hwspinlock_trylock()
47 struct regmap_field *field = lock->priv; in qcom_hwspinlock_unlock()
69 struct regmap_field *field = lock->priv; in qcom_hwspinlock_bust()
75 dev_err(lock->bank->dev, "unable to query spinlock owner\n"); in qcom_hwspinlock_bust()
84 dev_err(lock->bank->dev, "failed to bust spinlock\n"); in qcom_hwspinlock_bust()
140 { .compatible = "qcom,sfpb-mutex", .data = &of_sfpb_mutex },
141 { .compatible = "qcom,tcsr-mutex", .data = &of_tcsr_mutex },
142 { .compatible = "qcom,apq8084-tcsr-mutex", .data = &of_msm8226_tcsr_mutex },
143 { .compatible = "qcom,msm8226-tcsr-mutex", .data = &of_msm8226_tcsr_mutex },
144 { .compatible = "qcom,msm8974-tcsr-mutex", .data = &of_msm8226_tcsr_mutex },
145 { .compatible = "qcom,msm8994-tcsr-mutex", .data = &of_msm8226_tcsr_mutex },
157 syscon = of_parse_phandle(pdev->dev.of_node, "syscon", 0); in qcom_hwspinlock_probe_syscon()
159 return ERR_PTR(-ENODEV); in qcom_hwspinlock_probe_syscon()
166 ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 1, base); in qcom_hwspinlock_probe_syscon()
168 dev_err(&pdev->dev, "no offset in syscon\n"); in qcom_hwspinlock_probe_syscon()
169 return ERR_PTR(-EINVAL); in qcom_hwspinlock_probe_syscon()
172 ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 2, stride); in qcom_hwspinlock_probe_syscon()
174 dev_err(&pdev->dev, "no stride syscon\n"); in qcom_hwspinlock_probe_syscon()
175 return ERR_PTR(-EINVAL); in qcom_hwspinlock_probe_syscon()
185 struct device *dev = &pdev->dev; in qcom_hwspinlock_probe_mmio()
189 if (!data->regmap_config) in qcom_hwspinlock_probe_mmio()
190 return ERR_PTR(-EINVAL); in qcom_hwspinlock_probe_mmio()
192 *offset = data->offset; in qcom_hwspinlock_probe_mmio()
193 *stride = data->stride; in qcom_hwspinlock_probe_mmio()
199 return devm_regmap_init_mmio(dev, base, data->regmap_config); in qcom_hwspinlock_probe_mmio()
213 if (IS_ERR(regmap) && PTR_ERR(regmap) == -ENODEV) in qcom_hwspinlock_probe()
220 bank = devm_kzalloc(&pdev->dev, sizeof(*bank) + array_size, GFP_KERNEL); in qcom_hwspinlock_probe()
222 return -ENOMEM; in qcom_hwspinlock_probe()
227 field.reg = base + i * stride; in qcom_hwspinlock_probe()
231 bank->lock[i].priv = devm_regmap_field_alloc(&pdev->dev, in qcom_hwspinlock_probe()
233 if (IS_ERR(bank->lock[i].priv)) in qcom_hwspinlock_probe()
234 return PTR_ERR(bank->lock[i].priv); in qcom_hwspinlock_probe()
237 return devm_hwspin_lock_register(&pdev->dev, bank, &qcom_hwspinlock_ops, in qcom_hwspinlock_probe()