Lines Matching +full:syscon +full:- +full:sfpb
1 // SPDX-License-Identifier: GPL-2.0
10 #include <linux/mfd/syscon.h>
30 struct regmap_field *field = lock->priv; in qcom_hwspinlock_trylock()
47 struct regmap_field *field = lock->priv; in qcom_hwspinlock_unlock()
115 { .compatible = "qcom,sfpb-mutex", .data = &of_sfpb_mutex },
116 { .compatible = "qcom,tcsr-mutex", .data = &of_tcsr_mutex },
117 { .compatible = "qcom,apq8084-tcsr-mutex", .data = &of_msm8226_tcsr_mutex },
118 { .compatible = "qcom,ipq6018-tcsr-mutex", .data = &of_msm8226_tcsr_mutex },
119 { .compatible = "qcom,msm8226-tcsr-mutex", .data = &of_msm8226_tcsr_mutex },
120 { .compatible = "qcom,msm8974-tcsr-mutex", .data = &of_msm8226_tcsr_mutex },
121 { .compatible = "qcom,msm8994-tcsr-mutex", .data = &of_msm8226_tcsr_mutex },
129 struct device_node *syscon; in qcom_hwspinlock_probe_syscon() local
133 syscon = of_parse_phandle(pdev->dev.of_node, "syscon", 0); in qcom_hwspinlock_probe_syscon()
134 if (!syscon) in qcom_hwspinlock_probe_syscon()
135 return ERR_PTR(-ENODEV); in qcom_hwspinlock_probe_syscon()
137 regmap = syscon_node_to_regmap(syscon); in qcom_hwspinlock_probe_syscon()
138 of_node_put(syscon); in qcom_hwspinlock_probe_syscon()
142 ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 1, base); in qcom_hwspinlock_probe_syscon()
144 dev_err(&pdev->dev, "no offset in syscon\n"); in qcom_hwspinlock_probe_syscon()
145 return ERR_PTR(-EINVAL); in qcom_hwspinlock_probe_syscon()
148 ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 2, stride); in qcom_hwspinlock_probe_syscon()
150 dev_err(&pdev->dev, "no stride syscon\n"); in qcom_hwspinlock_probe_syscon()
151 return ERR_PTR(-EINVAL); in qcom_hwspinlock_probe_syscon()
161 struct device *dev = &pdev->dev; in qcom_hwspinlock_probe_mmio()
165 if (!data->regmap_config) in qcom_hwspinlock_probe_mmio()
166 return ERR_PTR(-EINVAL); in qcom_hwspinlock_probe_mmio()
168 *offset = data->offset; in qcom_hwspinlock_probe_mmio()
169 *stride = data->stride; in qcom_hwspinlock_probe_mmio()
175 return devm_regmap_init_mmio(dev, base, data->regmap_config); in qcom_hwspinlock_probe_mmio()
189 if (IS_ERR(regmap) && PTR_ERR(regmap) == -ENODEV) in qcom_hwspinlock_probe()
196 bank = devm_kzalloc(&pdev->dev, sizeof(*bank) + array_size, GFP_KERNEL); in qcom_hwspinlock_probe()
198 return -ENOMEM; in qcom_hwspinlock_probe()
207 bank->lock[i].priv = devm_regmap_field_alloc(&pdev->dev, in qcom_hwspinlock_probe()
209 if (IS_ERR(bank->lock[i].priv)) in qcom_hwspinlock_probe()
210 return PTR_ERR(bank->lock[i].priv); in qcom_hwspinlock_probe()
213 return devm_hwspin_lock_register(&pdev->dev, bank, &qcom_hwspinlock_ops, in qcom_hwspinlock_probe()