Lines Matching +full:single +full:- +full:chip

1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright (C) 2012-2017 ASPEED Technology Inc.
28 * The aspeed chip provides a single hardware interrupt for all of the I2C
29 * busses, so we use a dummy interrupt chip to translate this single interrupt
30 * into multiple interrupts, each associated with a single I2C bus.
35 struct irq_chip *chip = irq_desc_get_chip(desc); in aspeed_i2c_ic_irq_handler() local
39 chained_irq_enter(chip, desc); in aspeed_i2c_ic_irq_handler()
40 status = readl(i2c_ic->base); in aspeed_i2c_ic_irq_handler()
42 bus_irq = irq_find_mapping(i2c_ic->irq_domain, bit); in aspeed_i2c_ic_irq_handler()
45 chained_irq_exit(chip, desc); in aspeed_i2c_ic_irq_handler()
50 * since we are using a dummy interrupt chip.
56 irq_set_chip_data(irq, domain->host_data); in aspeed_i2c_ic_map_irq_domain()
73 return -ENOMEM; in aspeed_i2c_ic_of_init()
75 i2c_ic->base = of_iomap(node, 0); in aspeed_i2c_ic_of_init()
76 if (!i2c_ic->base) { in aspeed_i2c_ic_of_init()
77 ret = -ENOMEM; in aspeed_i2c_ic_of_init()
81 i2c_ic->parent_irq = irq_of_parse_and_map(node, 0); in aspeed_i2c_ic_of_init()
82 if (i2c_ic->parent_irq < 0) { in aspeed_i2c_ic_of_init()
83 ret = i2c_ic->parent_irq; in aspeed_i2c_ic_of_init()
87 i2c_ic->irq_domain = irq_domain_add_linear(node, ASPEED_I2C_IC_NUM_BUS, in aspeed_i2c_ic_of_init()
90 if (!i2c_ic->irq_domain) { in aspeed_i2c_ic_of_init()
91 ret = -ENOMEM; in aspeed_i2c_ic_of_init()
95 i2c_ic->irq_domain->name = "aspeed-i2c-domain"; in aspeed_i2c_ic_of_init()
97 irq_set_chained_handler_and_data(i2c_ic->parent_irq, in aspeed_i2c_ic_of_init()
100 pr_info("i2c controller registered, irq %d\n", i2c_ic->parent_irq); in aspeed_i2c_ic_of_init()
105 iounmap(i2c_ic->base); in aspeed_i2c_ic_of_init()
111 IRQCHIP_DECLARE(ast2400_i2c_ic, "aspeed,ast2400-i2c-ic", aspeed_i2c_ic_of_init);
112 IRQCHIP_DECLARE(ast2500_i2c_ic, "aspeed,ast2500-i2c-ic", aspeed_i2c_ic_of_init);