Lines Matching +full:lmh +full:- +full:temp +full:- +full:high +full:- +full:millicelsius

1 // SPDX-License-Identifier: GPL-2.0-only
42 int irq = irq_find_mapping(lmh_data->domain, 0); in lmh_handle_irq()
56 writel(0xff, lmh_data->base + LMH_REG_DCVS_INTR_CLR); in lmh_enable_interrupt()
57 enable_irq(lmh_data->irq); in lmh_enable_interrupt()
64 disable_irq_nosync(lmh_data->irq); in lmh_disable_interrupt()
68 .name = "lmh",
75 struct lmh_hw_data *lmh_data = d->host_data; in lmh_irq_map()
97 struct device *dev = &pdev->dev; in lmh_probe()
98 struct device_node *np = dev->of_node; in lmh_probe()
106 return -EPROBE_DEFER; in lmh_probe()
110 return -ENOMEM; in lmh_probe()
112 lmh_data->base = devm_platform_ioremap_resource(pdev, 0); in lmh_probe()
113 if (IS_ERR(lmh_data->base)) in lmh_probe()
114 return PTR_ERR(lmh_data->base); in lmh_probe()
118 return -EINVAL; in lmh_probe()
122 ret = of_property_read_u32(np, "qcom,lmh-temp-high-millicelsius", &temp_high); in lmh_probe()
124 dev_err(dev, "missing qcom,lmh-temp-high-millicelsius property\n"); in lmh_probe()
128 ret = of_property_read_u32(np, "qcom,lmh-temp-low-millicelsius", &temp_low); in lmh_probe()
130 dev_err(dev, "missing qcom,lmh-temp-low-millicelsius property\n"); in lmh_probe()
134 ret = of_property_read_u32(np, "qcom,lmh-temp-arm-millicelsius", &temp_arm); in lmh_probe()
136 dev_err(dev, "missing qcom,lmh-temp-arm-millicelsius property\n"); in lmh_probe()
141 * Only sdm845 has lmh hardware currently enabled from hlos. If this is needed in lmh_probe()
142 * for other platforms, revisit this to check if the <cpu-id, node-id> should be part in lmh_probe()
150 dev_err(dev, "Wrong CPU id associated with LMh node\n"); in lmh_probe()
151 return -EINVAL; in lmh_probe()
155 return -EINVAL; in lmh_probe()
211 lmh_data->irq = platform_get_irq(pdev, 0); in lmh_probe()
212 lmh_data->domain = irq_domain_add_linear(np, 1, &lmh_irq_ops, lmh_data); in lmh_probe()
213 if (!lmh_data->domain) { in lmh_probe()
215 return -EINVAL; in lmh_probe()
219 irq_set_status_flags(lmh_data->irq, IRQ_NOAUTOEN); in lmh_probe()
220 ret = devm_request_irq(dev, lmh_data->irq, lmh_handle_irq, in lmh_probe()
222 "lmh-irq", lmh_data); in lmh_probe()
224 dev_err(dev, "Error %d registering irq %x\n", ret, lmh_data->irq); in lmh_probe()
225 irq_domain_remove(lmh_data->domain); in lmh_probe()
233 { .compatible = "qcom,sc8180x-lmh", },
234 { .compatible = "qcom,sdm845-lmh", .data = (void *)LMH_ENABLE_ALGOS},
235 { .compatible = "qcom,sm8150-lmh", },
243 .name = "qcom-lmh",
251 MODULE_DESCRIPTION("QCOM LMh driver");