Lines Matching refs:i2c_ic
34 struct aspeed_i2c_ic *i2c_ic = irq_desc_get_handler_data(desc); in aspeed_i2c_ic_irq_handler() local
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()
68 struct aspeed_i2c_ic *i2c_ic; in aspeed_i2c_ic_of_init() local
71 i2c_ic = kzalloc(sizeof(*i2c_ic), GFP_KERNEL); in aspeed_i2c_ic_of_init()
72 if (!i2c_ic) 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()
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()
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()
98 aspeed_i2c_ic_irq_handler, i2c_ic); 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()
107 kfree(i2c_ic); in aspeed_i2c_ic_of_init()