Loading drivers/base/regmap/regmap-irq.c +29 −24 Original line number Diff line number Diff line Loading @@ -541,9 +541,9 @@ static const struct irq_domain_ops regmap_domain_ops = { }; /** * regmap_add_irq_chip_np() - Use standard regmap IRQ controller handling * regmap_add_irq_chip_fwnode() - Use standard regmap IRQ controller handling * * @np: The device_node where the IRQ domain should be added to. * @fwnode: The firmware node where the IRQ domain should be added to. * @map: The regmap for the device. * @irq: The IRQ the device uses to signal interrupts. * @irq_flags: The IRQF_ flags to use for the primary interrupt. Loading @@ -557,7 +557,8 @@ static const struct irq_domain_ops regmap_domain_ops = { * register cache. The chip driver is responsible for restoring the * register values used by the IRQ controller over suspend and resume. */ int regmap_add_irq_chip_np(struct device_node *np, struct regmap *map, int irq, int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode, struct regmap *map, int irq, int irq_flags, int irq_base, const struct regmap_irq_chip *chip, struct regmap_irq_chip_data **data) Loading Loading @@ -771,10 +772,12 @@ int regmap_add_irq_chip_np(struct device_node *np, struct regmap *map, int irq, } if (irq_base) d->domain = irq_domain_add_legacy(np, chip->num_irqs, irq_base, d->domain = irq_domain_add_legacy(to_of_node(fwnode), chip->num_irqs, irq_base, 0, ®map_domain_ops, d); else d->domain = irq_domain_add_linear(np, chip->num_irqs, d->domain = irq_domain_add_linear(to_of_node(fwnode), chip->num_irqs, ®map_domain_ops, d); if (!d->domain) { dev_err(map->dev, "Failed to create IRQ domain\n"); Loading Loading @@ -808,7 +811,7 @@ int regmap_add_irq_chip_np(struct device_node *np, struct regmap *map, int irq, kfree(d); return ret; } EXPORT_SYMBOL_GPL(regmap_add_irq_chip_np); EXPORT_SYMBOL_GPL(regmap_add_irq_chip_fwnode); /** * regmap_add_irq_chip() - Use standard regmap IRQ controller handling Loading @@ -822,15 +825,15 @@ EXPORT_SYMBOL_GPL(regmap_add_irq_chip_np); * * Returns 0 on success or an errno on failure. * * This is the same as regmap_add_irq_chip_np, except that the device * This is the same as regmap_add_irq_chip_fwnode, except that the firmware * node of the regmap is used. */ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags, int irq_base, const struct regmap_irq_chip *chip, struct regmap_irq_chip_data **data) { return regmap_add_irq_chip_np(map->dev->of_node, map, irq, irq_flags, irq_base, chip, data); return regmap_add_irq_chip_fwnode(dev_fwnode(map->dev), map, irq, irq_flags, irq_base, chip, data); } EXPORT_SYMBOL_GPL(regmap_add_irq_chip); Loading Loading @@ -899,10 +902,10 @@ static int devm_regmap_irq_chip_match(struct device *dev, void *res, void *data) } /** * devm_regmap_add_irq_chip_np() - Resource manager regmap_add_irq_chip_np() * devm_regmap_add_irq_chip_fwnode() - Resource managed regmap_add_irq_chip_fwnode() * * @dev: The device pointer on which irq_chip belongs to. * @np: The device_node where the IRQ domain should be added to. * @fwnode: The firmware node where the IRQ domain should be added to. * @map: The regmap for the device. * @irq: The IRQ the device uses to signal interrupts * @irq_flags: The IRQF_ flags to use for the primary interrupt. Loading @@ -915,9 +918,10 @@ static int devm_regmap_irq_chip_match(struct device *dev, void *res, void *data) * The ®map_irq_chip_data will be automatically released when the device is * unbound. */ int devm_regmap_add_irq_chip_np(struct device *dev, struct device_node *np, struct regmap *map, int irq, int irq_flags, int irq_base, int devm_regmap_add_irq_chip_fwnode(struct device *dev, struct fwnode_handle *fwnode, struct regmap *map, int irq, int irq_flags, int irq_base, const struct regmap_irq_chip *chip, struct regmap_irq_chip_data **data) { Loading @@ -929,7 +933,7 @@ int devm_regmap_add_irq_chip_np(struct device *dev, struct device_node *np, if (!ptr) return -ENOMEM; ret = regmap_add_irq_chip_np(np, map, irq, irq_flags, irq_base, ret = regmap_add_irq_chip_fwnode(fwnode, map, irq, irq_flags, irq_base, chip, &d); if (ret < 0) { devres_free(ptr); Loading @@ -941,7 +945,7 @@ int devm_regmap_add_irq_chip_np(struct device *dev, struct device_node *np, *data = d; return 0; } EXPORT_SYMBOL_GPL(devm_regmap_add_irq_chip_np); EXPORT_SYMBOL_GPL(devm_regmap_add_irq_chip_fwnode); /** * devm_regmap_add_irq_chip() - Resource manager regmap_add_irq_chip() Loading @@ -964,8 +968,9 @@ int devm_regmap_add_irq_chip(struct device *dev, struct regmap *map, int irq, const struct regmap_irq_chip *chip, struct regmap_irq_chip_data **data) { return devm_regmap_add_irq_chip_np(dev, map->dev->of_node, map, irq, irq_flags, irq_base, chip, data); return devm_regmap_add_irq_chip_fwnode(dev, dev_fwnode(map->dev), map, irq, irq_flags, irq_base, chip, data); } EXPORT_SYMBOL_GPL(devm_regmap_add_irq_chip); Loading include/linux/regmap.h +12 −9 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include <linux/bug.h> #include <linux/lockdep.h> #include <linux/iopoll.h> #include <linux/fwnode.h> struct module; struct clk; Loading Loading @@ -1376,7 +1377,8 @@ struct regmap_irq_chip_data; int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags, int irq_base, const struct regmap_irq_chip *chip, struct regmap_irq_chip_data **data); int regmap_add_irq_chip_np(struct device_node *np, struct regmap *map, int irq, int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode, struct regmap *map, int irq, int irq_flags, int irq_base, const struct regmap_irq_chip *chip, struct regmap_irq_chip_data **data); Loading @@ -1386,9 +1388,10 @@ int devm_regmap_add_irq_chip(struct device *dev, struct regmap *map, int irq, int irq_flags, int irq_base, const struct regmap_irq_chip *chip, struct regmap_irq_chip_data **data); int devm_regmap_add_irq_chip_np(struct device *dev, struct device_node *np, struct regmap *map, int irq, int irq_flags, int irq_base, int devm_regmap_add_irq_chip_fwnode(struct device *dev, struct fwnode_handle *fwnode, struct regmap *map, int irq, int irq_flags, int irq_base, const struct regmap_irq_chip *chip, struct regmap_irq_chip_data **data); void devm_regmap_del_irq_chip(struct device *dev, int irq, Loading Loading
drivers/base/regmap/regmap-irq.c +29 −24 Original line number Diff line number Diff line Loading @@ -541,9 +541,9 @@ static const struct irq_domain_ops regmap_domain_ops = { }; /** * regmap_add_irq_chip_np() - Use standard regmap IRQ controller handling * regmap_add_irq_chip_fwnode() - Use standard regmap IRQ controller handling * * @np: The device_node where the IRQ domain should be added to. * @fwnode: The firmware node where the IRQ domain should be added to. * @map: The regmap for the device. * @irq: The IRQ the device uses to signal interrupts. * @irq_flags: The IRQF_ flags to use for the primary interrupt. Loading @@ -557,7 +557,8 @@ static const struct irq_domain_ops regmap_domain_ops = { * register cache. The chip driver is responsible for restoring the * register values used by the IRQ controller over suspend and resume. */ int regmap_add_irq_chip_np(struct device_node *np, struct regmap *map, int irq, int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode, struct regmap *map, int irq, int irq_flags, int irq_base, const struct regmap_irq_chip *chip, struct regmap_irq_chip_data **data) Loading Loading @@ -771,10 +772,12 @@ int regmap_add_irq_chip_np(struct device_node *np, struct regmap *map, int irq, } if (irq_base) d->domain = irq_domain_add_legacy(np, chip->num_irqs, irq_base, d->domain = irq_domain_add_legacy(to_of_node(fwnode), chip->num_irqs, irq_base, 0, ®map_domain_ops, d); else d->domain = irq_domain_add_linear(np, chip->num_irqs, d->domain = irq_domain_add_linear(to_of_node(fwnode), chip->num_irqs, ®map_domain_ops, d); if (!d->domain) { dev_err(map->dev, "Failed to create IRQ domain\n"); Loading Loading @@ -808,7 +811,7 @@ int regmap_add_irq_chip_np(struct device_node *np, struct regmap *map, int irq, kfree(d); return ret; } EXPORT_SYMBOL_GPL(regmap_add_irq_chip_np); EXPORT_SYMBOL_GPL(regmap_add_irq_chip_fwnode); /** * regmap_add_irq_chip() - Use standard regmap IRQ controller handling Loading @@ -822,15 +825,15 @@ EXPORT_SYMBOL_GPL(regmap_add_irq_chip_np); * * Returns 0 on success or an errno on failure. * * This is the same as regmap_add_irq_chip_np, except that the device * This is the same as regmap_add_irq_chip_fwnode, except that the firmware * node of the regmap is used. */ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags, int irq_base, const struct regmap_irq_chip *chip, struct regmap_irq_chip_data **data) { return regmap_add_irq_chip_np(map->dev->of_node, map, irq, irq_flags, irq_base, chip, data); return regmap_add_irq_chip_fwnode(dev_fwnode(map->dev), map, irq, irq_flags, irq_base, chip, data); } EXPORT_SYMBOL_GPL(regmap_add_irq_chip); Loading Loading @@ -899,10 +902,10 @@ static int devm_regmap_irq_chip_match(struct device *dev, void *res, void *data) } /** * devm_regmap_add_irq_chip_np() - Resource manager regmap_add_irq_chip_np() * devm_regmap_add_irq_chip_fwnode() - Resource managed regmap_add_irq_chip_fwnode() * * @dev: The device pointer on which irq_chip belongs to. * @np: The device_node where the IRQ domain should be added to. * @fwnode: The firmware node where the IRQ domain should be added to. * @map: The regmap for the device. * @irq: The IRQ the device uses to signal interrupts * @irq_flags: The IRQF_ flags to use for the primary interrupt. Loading @@ -915,9 +918,10 @@ static int devm_regmap_irq_chip_match(struct device *dev, void *res, void *data) * The ®map_irq_chip_data will be automatically released when the device is * unbound. */ int devm_regmap_add_irq_chip_np(struct device *dev, struct device_node *np, struct regmap *map, int irq, int irq_flags, int irq_base, int devm_regmap_add_irq_chip_fwnode(struct device *dev, struct fwnode_handle *fwnode, struct regmap *map, int irq, int irq_flags, int irq_base, const struct regmap_irq_chip *chip, struct regmap_irq_chip_data **data) { Loading @@ -929,7 +933,7 @@ int devm_regmap_add_irq_chip_np(struct device *dev, struct device_node *np, if (!ptr) return -ENOMEM; ret = regmap_add_irq_chip_np(np, map, irq, irq_flags, irq_base, ret = regmap_add_irq_chip_fwnode(fwnode, map, irq, irq_flags, irq_base, chip, &d); if (ret < 0) { devres_free(ptr); Loading @@ -941,7 +945,7 @@ int devm_regmap_add_irq_chip_np(struct device *dev, struct device_node *np, *data = d; return 0; } EXPORT_SYMBOL_GPL(devm_regmap_add_irq_chip_np); EXPORT_SYMBOL_GPL(devm_regmap_add_irq_chip_fwnode); /** * devm_regmap_add_irq_chip() - Resource manager regmap_add_irq_chip() Loading @@ -964,8 +968,9 @@ int devm_regmap_add_irq_chip(struct device *dev, struct regmap *map, int irq, const struct regmap_irq_chip *chip, struct regmap_irq_chip_data **data) { return devm_regmap_add_irq_chip_np(dev, map->dev->of_node, map, irq, irq_flags, irq_base, chip, data); return devm_regmap_add_irq_chip_fwnode(dev, dev_fwnode(map->dev), map, irq, irq_flags, irq_base, chip, data); } EXPORT_SYMBOL_GPL(devm_regmap_add_irq_chip); Loading
include/linux/regmap.h +12 −9 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include <linux/bug.h> #include <linux/lockdep.h> #include <linux/iopoll.h> #include <linux/fwnode.h> struct module; struct clk; Loading Loading @@ -1376,7 +1377,8 @@ struct regmap_irq_chip_data; int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags, int irq_base, const struct regmap_irq_chip *chip, struct regmap_irq_chip_data **data); int regmap_add_irq_chip_np(struct device_node *np, struct regmap *map, int irq, int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode, struct regmap *map, int irq, int irq_flags, int irq_base, const struct regmap_irq_chip *chip, struct regmap_irq_chip_data **data); Loading @@ -1386,9 +1388,10 @@ int devm_regmap_add_irq_chip(struct device *dev, struct regmap *map, int irq, int irq_flags, int irq_base, const struct regmap_irq_chip *chip, struct regmap_irq_chip_data **data); int devm_regmap_add_irq_chip_np(struct device *dev, struct device_node *np, struct regmap *map, int irq, int irq_flags, int irq_base, int devm_regmap_add_irq_chip_fwnode(struct device *dev, struct fwnode_handle *fwnode, struct regmap *map, int irq, int irq_flags, int irq_base, const struct regmap_irq_chip *chip, struct regmap_irq_chip_data **data); void devm_regmap_del_irq_chip(struct device *dev, int irq, Loading