From 8b29f7aa52330411ee0b8127b32ac17d50b16f76 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Thu, 14 Feb 2019 15:52:09 +0100 Subject: irqchip: davinci-aintc: add a new config structure Add a config structure that will be used by aintc-based platforms. It contains the register range resource, number of interrupts and a list of priorities. Acked-by: Marc Zyngier Reviewed-by: David Lechner Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori --- include/linux/irqchip/irq-davinci-aintc.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 include/linux/irqchip/irq-davinci-aintc.h (limited to 'include/linux/irqchip') diff --git a/include/linux/irqchip/irq-davinci-aintc.h b/include/linux/irqchip/irq-davinci-aintc.h new file mode 100644 index 000000000000..2b2ace3c1b22 --- /dev/null +++ b/include/linux/irqchip/irq-davinci-aintc.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (C) 2019 Texas Instruments + */ + +#ifndef _LINUX_IRQ_DAVINCI_AINTC_ +#define _LINUX_IRQ_DAVINCI_AINTC_ + +#include + +/** + * struct davinci_aintc_config - configuration data for davinci-aintc driver. + * + * @reg: register range to map + * @num_irqs: number of HW interrupts supported by the controller + * @prios: an array of size num_irqs containing priority settings for + * each interrupt + */ +struct davinci_aintc_config { + struct resource reg; + unsigned int num_irqs; + u8 *prios; +}; + +#endif /* _LINUX_IRQ_DAVINCI_AINTC_ */ -- cgit From 06a2871614295eb3c504821adc4dee15748890ac Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Thu, 14 Feb 2019 15:52:11 +0100 Subject: ARM: davinci: aintc: use the new config structure Modify the aintc driver to take all its configuration from the new config structure. Stop referencing davinci_soc_info in any way. Move the declaration for davinci_aintc_init() to irq-davinci-aintc.h and make it take the new config structure as parameter. Convert all users to the new version. Signed-off-by: Bartosz Golaszewski Reviewed-by: David Lechner Signed-off-by: Sekhar Nori --- include/linux/irqchip/irq-davinci-aintc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux/irqchip') diff --git a/include/linux/irqchip/irq-davinci-aintc.h b/include/linux/irqchip/irq-davinci-aintc.h index 2b2ace3c1b22..ea4e087fac98 100644 --- a/include/linux/irqchip/irq-davinci-aintc.h +++ b/include/linux/irqchip/irq-davinci-aintc.h @@ -22,4 +22,6 @@ struct davinci_aintc_config { u8 *prios; }; +void davinci_aintc_init(const struct davinci_aintc_config *config); + #endif /* _LINUX_IRQ_DAVINCI_AINTC_ */ -- cgit From 94af2c4d14d09c2c2d07b4ea2778668890241ea8 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Thu, 14 Feb 2019 15:52:19 +0100 Subject: irqchip: davinci-cp-intc: add a new config structure Add a config structure that will be used by cp-intc-based platforms. It contains the register range resource and the number of interrupts. Acked-by: Marc Zyngier Reviewed-by: David Lechner Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori --- include/linux/irqchip/irq-davinci-cp-intc.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 include/linux/irqchip/irq-davinci-cp-intc.h (limited to 'include/linux/irqchip') diff --git a/include/linux/irqchip/irq-davinci-cp-intc.h b/include/linux/irqchip/irq-davinci-cp-intc.h new file mode 100644 index 000000000000..2270a6167b98 --- /dev/null +++ b/include/linux/irqchip/irq-davinci-cp-intc.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (C) 2019 Texas Instruments + */ + +#ifndef _LINUX_IRQ_DAVINCI_CP_INTC_ +#define _LINUX_IRQ_DAVINCI_CP_INTC_ + +#include + +/** + * struct davinci_cp_intc_config - configuration data for davinci-cp-intc + * driver. + * + * @reg: register range to map + * @num_irqs: number of HW interrupts supported by the controller + */ +struct davinci_cp_intc_config { + struct resource reg; + unsigned int num_irqs; +}; + +#endif /* _LINUX_IRQ_DAVINCI_CP_INTC_ */ -- cgit From 6567954b8e8e7cbb74b1340038dcac7ecc9e2e1b Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Thu, 14 Feb 2019 15:52:23 +0100 Subject: ARM: davinci: cp-intc: use the new-style config structure Modify the cp-intc driver to take all its configuration from the new config structure. Stop referencing davinci_soc_info in any way. Move the declaration for davinci_cp_intc_init() to irq-davinci-cp-intc.h and make it take the new config structure as parameter. Convert all users to the new version. Also: since the two da8xx SoCs default all irq priorities to 7, just drop the priority configuration at all and hardcode the channels to 7. It will simplify the driver code and make our lives easier when it comes to device-tree support. Reviewed-by: David Lechner Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori --- include/linux/irqchip/irq-davinci-cp-intc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux/irqchip') diff --git a/include/linux/irqchip/irq-davinci-cp-intc.h b/include/linux/irqchip/irq-davinci-cp-intc.h index 2270a6167b98..8d71ed5b5a61 100644 --- a/include/linux/irqchip/irq-davinci-cp-intc.h +++ b/include/linux/irqchip/irq-davinci-cp-intc.h @@ -20,4 +20,6 @@ struct davinci_cp_intc_config { unsigned int num_irqs; }; +int davinci_cp_intc_init(const struct davinci_cp_intc_config *config); + #endif /* _LINUX_IRQ_DAVINCI_CP_INTC_ */ -- cgit