Lines Matching full:io
61 struct si_sm_io *io = context; in ipmi_acpi_gpe() local
63 ipmi_si_irq_handler(io->irq, io->irq_handler_data); in ipmi_acpi_gpe()
67 static void acpi_gpe_irq_cleanup(struct si_sm_io *io) in acpi_gpe_irq_cleanup() argument
69 if (!io->irq) in acpi_gpe_irq_cleanup()
72 ipmi_irq_start_cleanup(io); in acpi_gpe_irq_cleanup()
73 acpi_remove_gpe_handler(NULL, io->irq, &ipmi_acpi_gpe); in acpi_gpe_irq_cleanup()
76 static int acpi_gpe_irq_setup(struct si_sm_io *io) in acpi_gpe_irq_setup() argument
80 if (!io->irq) in acpi_gpe_irq_setup()
84 io->irq, in acpi_gpe_irq_setup()
87 io); in acpi_gpe_irq_setup()
89 dev_warn(io->dev, in acpi_gpe_irq_setup()
91 io->irq); in acpi_gpe_irq_setup()
92 io->irq = 0; in acpi_gpe_irq_setup()
96 io->irq_cleanup = acpi_gpe_irq_cleanup; in acpi_gpe_irq_setup()
97 ipmi_irq_finish_setup(io); in acpi_gpe_irq_setup()
98 dev_info(io->dev, "Using ACPI GPE %d\n", io->irq); in acpi_gpe_irq_setup()
103 static void ipmi_set_addr_data_and_space(struct resource *r, struct si_sm_io *io) in ipmi_set_addr_data_and_space() argument
106 io->addr_space = IPMI_IO_ADDR_SPACE; in ipmi_set_addr_data_and_space()
108 io->addr_space = IPMI_MEM_ADDR_SPACE; in ipmi_set_addr_data_and_space()
109 io->addr_data = r->start; in ipmi_set_addr_data_and_space()
114 struct si_sm_io *io) in ipmi_get_info_from_resources() argument
123 ipmi_set_addr_data_and_space(res, io); in ipmi_get_info_from_resources()
125 io->regspacing = DEFAULT_REGSPACING; in ipmi_get_info_from_resources()
128 if (res_second->start > io->addr_data) in ipmi_get_info_from_resources()
129 io->regspacing = res_second->start - io->addr_data; in ipmi_get_info_from_resources()
137 struct si_sm_io io; in platform_ipmi_probe() local
159 memset(&io, 0, sizeof(io)); in platform_ipmi_probe()
160 io.addr_source = addr_source; in platform_ipmi_probe()
168 io.si_type = type; in platform_ipmi_probe()
177 io.regsize = DEFAULT_REGSIZE; in platform_ipmi_probe()
180 io.regsize = regsize; in platform_ipmi_probe()
182 io.regshift = 0; in platform_ipmi_probe()
185 io.regshift = regshift; in platform_ipmi_probe()
187 if (!ipmi_get_info_from_resources(pdev, &io)) in platform_ipmi_probe()
192 io.slave_addr = 0x20; in platform_ipmi_probe()
194 io.slave_addr = slave_addr; in platform_ipmi_probe()
196 io.irq = platform_get_irq_optional(pdev, 0); in platform_ipmi_probe()
197 if (io.irq > 0) in platform_ipmi_probe()
198 io.irq_setup = ipmi_std_irq_setup; in platform_ipmi_probe()
200 io.irq = 0; in platform_ipmi_probe()
202 io.dev = &pdev->dev; in platform_ipmi_probe()
206 (io.addr_space == IPMI_IO_ADDR_SPACE) ? "io" : "mem", in platform_ipmi_probe()
207 io.addr_data, io.regsize, io.regspacing, io.irq); in platform_ipmi_probe()
209 ipmi_si_add_smi(&io); in platform_ipmi_probe()
228 struct si_sm_io io; in of_ipmi_probe() local
267 memset(&io, 0, sizeof(io)); in of_ipmi_probe()
268 io.si_type = (enum si_type)device_get_match_data(&pdev->dev); in of_ipmi_probe()
269 io.addr_source = SI_DEVICETREE; in of_ipmi_probe()
270 io.irq_setup = ipmi_std_irq_setup; in of_ipmi_probe()
272 ipmi_set_addr_data_and_space(&resource, &io); in of_ipmi_probe()
274 io.regsize = regsize ? be32_to_cpup(regsize) : DEFAULT_REGSIZE; in of_ipmi_probe()
275 io.regspacing = regspacing ? be32_to_cpup(regspacing) : DEFAULT_REGSPACING; in of_ipmi_probe()
276 io.regshift = regshift ? be32_to_cpup(regshift) : 0; in of_ipmi_probe()
278 io.irq = irq_of_parse_and_map(pdev->dev.of_node, 0); in of_ipmi_probe()
279 io.dev = &pdev->dev; in of_ipmi_probe()
282 io.addr_data, io.regsize, io.regspacing, io.irq); in of_ipmi_probe()
284 return ipmi_si_add_smi(&io); in of_ipmi_probe()
295 static int find_slave_address(struct si_sm_io *io, int slave_addr) in find_slave_address() argument
299 slave_addr = ipmi_dmi_get_slave_addr(io->si_type, in find_slave_address()
300 io->addr_space, in find_slave_address()
301 io->addr_data); in find_slave_address()
310 struct si_sm_io io; in acpi_ipmi_probe() local
323 memset(&io, 0, sizeof(io)); in acpi_ipmi_probe()
324 io.addr_source = SI_ACPI; in acpi_ipmi_probe()
327 io.addr_info.acpi_info.acpi_handle = handle; in acpi_ipmi_probe()
338 io.si_type = SI_KCS; in acpi_ipmi_probe()
341 io.si_type = SI_SMIC; in acpi_ipmi_probe()
344 io.si_type = SI_BT; in acpi_ipmi_probe()
353 io.dev = dev; in acpi_ipmi_probe()
354 io.regsize = DEFAULT_REGSIZE; in acpi_ipmi_probe()
355 io.regshift = 0; in acpi_ipmi_probe()
357 res = ipmi_get_info_from_resources(pdev, &io); in acpi_ipmi_probe()
364 io.irq = tmp; in acpi_ipmi_probe()
365 io.irq_setup = acpi_gpe_irq_setup; in acpi_ipmi_probe()
370 io.irq = irq; in acpi_ipmi_probe()
371 io.irq_setup = ipmi_std_irq_setup; in acpi_ipmi_probe()
375 io.slave_addr = find_slave_address(&io, io.slave_addr); in acpi_ipmi_probe()
378 res, io.regsize, io.regspacing, io.irq); in acpi_ipmi_probe()
382 return ipmi_si_add_smi(&io); in acpi_ipmi_probe()