Lines Matching +full:sdm845 +full:- +full:cpufreq +full:- +full:hw
1 // SPDX-License-Identifier: GPL-2.0-only
42 int irq = irq_find_mapping(lmh_data->domain, 0); in lmh_handle_irq()
44 /* Call the cpufreq driver to handle the interrupt */ 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()
73 static int lmh_irq_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw) in lmh_irq_map() argument
75 struct lmh_hw_data *lmh_data = d->host_data; in lmh_irq_map()
90 struct device *dev = &pdev->dev; in lmh_probe()
91 struct device_node *np = dev->of_node; in lmh_probe()
100 return -ENOMEM; in lmh_probe()
102 lmh_data->base = devm_platform_ioremap_resource(pdev, 0); in lmh_probe()
103 if (IS_ERR(lmh_data->base)) in lmh_probe()
104 return PTR_ERR(lmh_data->base); in lmh_probe()
108 return -EINVAL; in lmh_probe()
112 ret = of_property_read_u32(np, "qcom,lmh-temp-high-millicelsius", &temp_high); in lmh_probe()
114 dev_err(dev, "missing qcom,lmh-temp-high-millicelsius property\n"); in lmh_probe()
118 ret = of_property_read_u32(np, "qcom,lmh-temp-low-millicelsius", &temp_low); in lmh_probe()
120 dev_err(dev, "missing qcom,lmh-temp-low-millicelsius property\n"); in lmh_probe()
124 ret = of_property_read_u32(np, "qcom,lmh-temp-arm-millicelsius", &temp_arm); in lmh_probe()
126 dev_err(dev, "missing qcom,lmh-temp-arm-millicelsius property\n"); in lmh_probe()
131 * Only sdm845 has lmh hardware currently enabled from hlos. If this is needed in lmh_probe()
132 * for other platforms, revisit this to check if the <cpu-id, node-id> should be part in lmh_probe()
141 return -EINVAL; in lmh_probe()
145 return -EINVAL; in lmh_probe()
201 lmh_data->irq = platform_get_irq(pdev, 0); in lmh_probe()
202 lmh_data->domain = irq_domain_add_linear(np, 1, &lmh_irq_ops, lmh_data); in lmh_probe()
203 if (!lmh_data->domain) { in lmh_probe()
205 return -EINVAL; in lmh_probe()
208 /* Disable the irq and let cpufreq enable it when ready to handle the interrupt */ in lmh_probe()
209 irq_set_status_flags(lmh_data->irq, IRQ_NOAUTOEN); in lmh_probe()
210 ret = devm_request_irq(dev, lmh_data->irq, lmh_handle_irq, in lmh_probe()
212 "lmh-irq", lmh_data); in lmh_probe()
214 dev_err(dev, "Error %d registering irq %x\n", ret, lmh_data->irq); in lmh_probe()
215 irq_domain_remove(lmh_data->domain); in lmh_probe()
223 { .compatible = "qcom,sc8180x-lmh", },
224 { .compatible = "qcom,sdm845-lmh", .data = (void *)LMH_ENABLE_ALGOS},
225 { .compatible = "qcom,sm8150-lmh", },
233 .name = "qcom-lmh",