Lines Matching +full:reg +full:- +full:spacing
1 // SPDX-License-Identifier: GPL-2.0+
56 /* For GPE-type interrupts. */
62 ipmi_si_irq_handler(io->irq, io->irq_handler_data); in ipmi_acpi_gpe()
68 if (!io->irq) in acpi_gpe_irq_cleanup()
72 acpi_remove_gpe_handler(NULL, io->irq, &ipmi_acpi_gpe); in acpi_gpe_irq_cleanup()
79 if (!io->irq) in acpi_gpe_irq_setup()
83 io->irq, in acpi_gpe_irq_setup()
88 dev_warn(io->dev, in acpi_gpe_irq_setup()
90 io->irq); in acpi_gpe_irq_setup()
91 io->irq = 0; in acpi_gpe_irq_setup()
92 return -EINVAL; in acpi_gpe_irq_setup()
95 io->irq_cleanup = acpi_gpe_irq_cleanup; in acpi_gpe_irq_setup()
97 dev_info(io->dev, "Using ACPI GPE %d\n", io->irq); in acpi_gpe_irq_setup()
105 io->addr_space = IPMI_IO_ADDR_SPACE; in ipmi_set_addr_data_and_space()
107 io->addr_space = IPMI_MEM_ADDR_SPACE; in ipmi_set_addr_data_and_space()
108 io->addr_data = r->start; in ipmi_set_addr_data_and_space()
119 dev_err(&pdev->dev, "no I/O or memory address\n"); in ipmi_get_info_from_resources()
124 io->regspacing = DEFAULT_REGSPACING; in ipmi_get_info_from_resources()
127 if (res_second->start > io->addr_data) in ipmi_get_info_from_resources()
128 io->regspacing = res_second->start - io->addr_data; in ipmi_get_info_from_resources()
140 rv = device_property_read_u8(&pdev->dev, "addr-source", &addr_source); in platform_ipmi_probe()
144 return -EINVAL; in platform_ipmi_probe()
148 return -ENODEV; in platform_ipmi_probe()
151 return -ENODEV; in platform_ipmi_probe()
154 rv = device_property_read_u8(&pdev->dev, "ipmi-type", &type); in platform_ipmi_probe()
156 return -ENODEV; in platform_ipmi_probe()
160 dev_info(&pdev->dev, "probing via %s\n", in platform_ipmi_probe()
170 return -ENODEV; in platform_ipmi_probe()
172 dev_err(&pdev->dev, "ipmi-type property is invalid\n"); in platform_ipmi_probe()
173 return -EINVAL; in platform_ipmi_probe()
177 rv = device_property_read_u8(&pdev->dev, "reg-size", ®size); in platform_ipmi_probe()
182 rv = device_property_read_u8(&pdev->dev, "reg-shift", ®shift); in platform_ipmi_probe()
187 return -EINVAL; in platform_ipmi_probe()
189 rv = device_property_read_u8(&pdev->dev, "slave-addr", &slave_addr); in platform_ipmi_probe()
201 io.dev = &pdev->dev; in platform_ipmi_probe()
203 pr_info("ipmi_si: %s: %s %#lx regsize %d spacing %d irq %d\n", in platform_ipmi_probe()
215 { .type = "ipmi", .compatible = "ipmi-kcs",
217 { .type = "ipmi", .compatible = "ipmi-smic",
219 { .type = "ipmi", .compatible = "ipmi-bt",
231 struct device_node *np = pdev->dev.of_node; in of_ipmi_probe()
236 return -ENODEV; in of_ipmi_probe()
238 dev_info(&pdev->dev, "probing via device tree\n"); in of_ipmi_probe()
240 match = of_match_device(of_ipmi_match, &pdev->dev); in of_ipmi_probe()
242 return -ENODEV; in of_ipmi_probe()
245 return -EINVAL; in of_ipmi_probe()
249 dev_warn(&pdev->dev, "invalid address from OF\n"); in of_ipmi_probe()
253 regsize = of_get_property(np, "reg-size", &proplen); in of_ipmi_probe()
255 dev_warn(&pdev->dev, "invalid regsize from OF\n"); in of_ipmi_probe()
256 return -EINVAL; in of_ipmi_probe()
259 regspacing = of_get_property(np, "reg-spacing", &proplen); in of_ipmi_probe()
261 dev_warn(&pdev->dev, "invalid regspacing from OF\n"); in of_ipmi_probe()
262 return -EINVAL; in of_ipmi_probe()
265 regshift = of_get_property(np, "reg-shift", &proplen); in of_ipmi_probe()
267 dev_warn(&pdev->dev, "invalid regshift from OF\n"); in of_ipmi_probe()
268 return -EINVAL; in of_ipmi_probe()
272 io.si_type = (enum si_type) match->data; in of_ipmi_probe()
282 io.irq = irq_of_parse_and_map(pdev->dev.of_node, 0); in of_ipmi_probe()
283 io.dev = &pdev->dev; in of_ipmi_probe()
285 dev_dbg(&pdev->dev, "addr 0x%lx regsize %d spacing %d irq %d\n", in of_ipmi_probe()
294 return -ENODEV; in of_ipmi_probe()
303 slave_addr = ipmi_dmi_get_slave_addr(io->si_type, in find_slave_address()
304 io->addr_space, in find_slave_address()
305 io->addr_data); in find_slave_address()
313 struct device *dev = &pdev->dev; in acpi_ipmi_probe()
321 return -ENODEV; in acpi_ipmi_probe()
325 return -ENODEV; in acpi_ipmi_probe()
337 return -EINVAL; in acpi_ipmi_probe()
351 return -ENODEV; in acpi_ipmi_probe()
354 return -EINVAL; in acpi_ipmi_probe()
363 return -EINVAL; in acpi_ipmi_probe()
381 dev_info(dev, "%pR regsize %d spacing %d irq %d\n", in acpi_ipmi_probe()
397 return -ENODEV; in acpi_ipmi_probe()
403 if (pdev->dev.of_node && of_ipmi_probe(pdev) == 0) in ipmi_probe()
414 ipmi_si_remove_by_dev(&pdev->dev); in ipmi_remove()
424 return strcmp(pdev->name, name) == 0; in pdev_match_name()
441 { "dmi-ipmi-si", 0 },
442 { "hardcode-ipmi-si", 0 },
443 { "hotmod-ipmi-si", 0 },