ARM: davinci_all_defconfig: enable iio
Subsystems (3)
v2 cover ARM: davinci_all_defconfig: enable iio
Following up on another conversation [1], this series includes a fixed up patch to enable the iio subsystem in davinci_all_defconfig. I have also included another patch to allocate extra interrupts that are needed for iio triggers (this patch was previously submitted, but received no comments).
[1]: https://patchwork.kernel.org/patch/9500063/
David Lechner (2):
ARM: davinci: Allocate extra interrupts
ARM: davinci_all_defconfig: enable iio
arch/arm/configs/davinci_all_defconfig | 9 +++++++++ arch/arm/mach-davinci/include/mach/irqs.h | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-)
Signature · 1 line
2.7.4
PATCH v2 1/2 ARM: davinci: Allocate extra interrupts
This allocates extra interrupts for mach-davinci. These extra interrupts are need for things like IIO triggers.
--- arch/arm/mach-davinci/include/mach/irqs.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach-davinci/include/mach/irqs.h +3 -1
@@ -403,7 +403,9 @@/* da850 currently has the most gpio pins (144) */ #define DAVINCI_N_GPIO 144 +/* Extra IRQs for things like IIO triggers */ +#define DAVINCI_N_SPARE_IRQ 16/* da850 currently has the most irqs so use DA850_N_CP_INTC_IRQ */ -#define NR_IRQS (DA850_N_CP_INTC_IRQ + DAVINCI_N_GPIO) +#define NR_IRQS (DA850_N_CP_INTC_IRQ + DAVINCI_N_GPIO + DAVINCI_N_SPARE_IRQ)#endif /* __ASM_ARCH_IRQS_H */
Signature · 1 line
2.7.4
PATCH v2 2/2 ARM: davinci_all_defconfig: enable iio
In reply to David LechnerThis enables the iio subsystem. This will be used by LEGO MINDSTORMS EV3, which has an ADS7957 chip.
--- arch/arm/configs/davinci_all_defconfig | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm/configs/davinci_all_defconfig +9 -0
@@ -201,6 +201,15 @@ CONFIG_TI_EDMA=y CONFIG_MEMORY=y CONFIG_TI_AEMIF=m CONFIG_DA8XX_DDRCTL=y +CONFIG_IIO=m +CONFIG_IIO_BUFFER=y +CONFIG_IIO_BUFFER_CB=m +CONFIG_IIO_KFIFO_BUF=m +CONFIG_IIO_TRIGGER=y +CONFIG_IIO_SW_DEVICE=m +CONFIG_IIO_SW_TRIGGER=m +CONFIG_IIO_HRTIMER_TRIGGER=m +CONFIG_IIO_SYSFS_TRIGGER=m CONFIG_PWM=y CONFIG_PWM_TIECAP=m CONFIG_PWM_TIEHRPWM=m
Signature · 1 line
2.7.4
Re: [PATCH v2 1/2] ARM: davinci: Allocate extra interrupts
In reply to David LechnerQuoted 2 lines · David Lechner
This allocates extra interrupts for mach-davinci. These extra interrupts are need for things like IIO triggers.
I am not really familiar with IIO triggers. Can you give some more detail on what fails without this patch?
Thanks,
Sekhar
Re: [PATCH v2 1/2] ARM: davinci: Allocate extra interrupts
Quoted 6 lines · Sekhar Nori
Quoted 2 lines · David Lechner
This allocates extra interrupts for mach-davinci. These extra interrupts are need for things like IIO triggers.
I am not really familiar with IIO triggers. Can you give some more detail on what fails without this patch?
A trigger is used to initiate the reading of an iio device. For example, there is a mechanism for a sysfs trigger. When you write 1 to the sysfs attribute, it triggers an interrupt that is handled by the iio device.
Since these triggers use interrupts, you need to allocate spare interrupts in order to set up the trigger. Otherwise, setting up the trigger will fail with an error code (I forgot which one exactly) because all of the allocated irqs have already been assigned to hardware irqs and are not available.
Here is where the iio subsytem actually allocates the irq:
http://lxr.free-electrons.com/source/drivers/iio/industrialio-trigger.c#L525
Re: [PATCH v2 1/2] ARM: davinci: Allocate extra interrupts
Quoted 12 lines · David Lechner
Quoted 6 lines · Sekhar Nori
Quoted 2 lines · David Lechner
This allocates extra interrupts for mach-davinci. These extra interrupts are need for things like IIO triggers.
I am not really familiar with IIO triggers. Can you give some more detail on what fails without this patch?
A trigger is used to initiate the reading of an iio device. For example, there is a mechanism for a sysfs trigger. When you write 1 to the sysfs attribute, it triggers an interrupt that is handled by the iio device.
Quoted 8 lines
Since these triggers use interrupts, you need to allocate spare interrupts in order to set up the trigger. Otherwise, setting up the trigger will fail with an error code (I forgot which one exactly) because all of the allocated irqs have already been assigned to hardware irqs and are not available.
Here is where the iio subsytem actually allocates the irq:
http://lxr.free-electrons.com/source/drivers/iio/industrialio-trigger.c#L525
Alright, I will take a look. Do note that this may not get included in the first batch of v4.11 changes I queue. But I promise to come back to it soon afterwards.
Thanks,
Sekhar
Sekhar Nori
AppliedQuoted 4 lines · David Lechner
This enables the iio subsystem. This will be used by LEGO MINDSTORMS EV3, which has an ADS7957 chip.
Signed-off-by David Lechner <[email protected]>
Applied.
Thanks,
Sekhar
Re: [PATCH v2 1/2] ARM: davinci: Allocate extra interrupts
In reply to Sekhar NoriQuoted 19 lines · Sekhar Nori
Quoted 18 lines · David Lechner
Quoted 6 lines · Sekhar Nori
Quoted 2 lines · David Lechner
This allocates extra interrupts for mach-davinci. These extra interrupts are need for things like IIO triggers.
I am not really familiar with IIO triggers. Can you give some more detail on what fails without this patch?
A trigger is used to initiate the reading of an iio device. For example, there is a mechanism for a sysfs trigger. When you write 1 to the sysfs attribute, it triggers an interrupt that is handled by the iio device.
Since these triggers use interrupts, you need to allocate spare interrupts in order to set up the trigger. Otherwise, setting up the trigger will fail with an error code (I forgot which one exactly) because all of the allocated irqs have already been assigned to hardware irqs and are not available.
Quoted 7 lines
Quoted 2 lines
Here is where the iio subsytem actually allocates the irq:
http://lxr.free-electrons.com/source/drivers/iio/industrialio-trigger.c#L525Alright, I will take a look. Do note that this may not get included in the first batch of v4.11 changes I queue. But I promise to come back to it soon afterwards.
It is not critical at this point, so it is fine to wait a bit.
Re: [PATCH v2 1/2] ARM: davinci: Allocate extra interrupts
Quoted 25 lines · David Lechner
Quoted 24 lines · Sekhar Nori
Quoted 22 lines · David Lechner
Quoted 7 lines · Sekhar Nori
Quoted 3 lines · David Lechner
This allocates extra interrupts for mach-davinci. These extra interrupts
are need for things like IIO triggers.I am not really familiar with IIO triggers. Can you give some more detail on what fails without this patch?
A trigger is used to initiate the reading of an iio device. For example, there is a mechanism for a sysfs trigger. When you write 1 to the sysfs attribute, it triggers an interrupt that is handled by the iio device.
Since these triggers use interrupts, you need to allocate spare interrupts in order to set up the trigger. Otherwise, setting up the trigger will fail with an error code (I forgot which one exactly) because all of the allocated irqs have already been assigned to hardware irqs and are not available.
Here is where the iio subsytem actually allocates the irq:
http://lxr.free-electrons.com/source/drivers/iio/industrialio-trigger.c#L525
Quoted 6 lines
Quoted 4 lines
Alright, I will take a look. Do note that this may not get included in the first batch of v4.11 changes I queue. But I promise to come back to it soon afterwards.
It is not critical at this point, so it is fine to wait a bit.
So, I think instead of increasing NR_IRQS by a small number, we should instead shift to use SPARSE_IRQ. I looked at some patches from Tony Lindgren converting OMAP1 to use SPARSE_IRQ. There is some work involved, but it does not look to be too huge a change to me.
685e2d08c54b ARM: OMAP1: Change interrupt numbering for sparse IRQ b694331cfb2e ARM: omap1: Switch to use MULTI_IRQ55b447744389 ARM: OMAP1: Switch to use generic irqchip in preparation for sparse IRQ 928f81aa619d ARM: OMAP1: Move UART defines to prepare for sparse IRQ
Thanks,
Sekhar
Re: [PATCH v2 1/2] ARM: davinci: Allocate extra interrupts
Quoted 31 lines · Sekhar Nori
Quoted 30 lines · David Lechner
Quoted 28 lines · Sekhar Nori
Quoted 13 lines · David Lechner
Quoted 7 lines · Sekhar Nori
Quoted 3 lines · David Lechner
This allocates extra interrupts for mach-davinci. These extra interrupts
are need for things like IIO triggers.I am not really familiar with IIO triggers. Can you give some more detail on what fails without this patch?
A trigger is used to initiate the reading of an iio device. For example, there is a mechanism for a sysfs trigger. When you write 1 to the sysfs attribute, it triggers an interrupt that is handled by the iio device.
Quoted 9 lines
Since these triggers use interrupts, you need to allocate spare interrupts in order to set up the trigger. Otherwise, setting up the trigger will fail with an error code (I forgot which one exactly) because all of the allocated irqs have already been assigned to hardware irqs and are not available.
Here is where the iio subsytem actually allocates the irq:
http://lxr.free-electrons.com/source/drivers/iio/industrialio-trigger.c#L525Alright, I will take a look. Do note that this may not get included in the first batch of v4.11 changes I queue. But I promise to come back to it soon afterwards.
Quoted 4 lines
Quoted 1 line
It is not critical at this point, so it is fine to wait a bit.
So, I think instead of increasing
NR_IRQSby a small number, we should instead shift to useSPARSE_IRQ.
Sounds good. However, this is a bit beyond my expertise. Maybe if I can find a "Sparse IRQ for Dummies" book I could attempt this some time.
I looked at some patches from Tony
Quoted 11 lines
Lindgren converting OMAP1 to use
SPARSE_IRQ. There is some work involved, but it does not look to be too huge a change to me.
685e2d08c54bARM: OMAP1: Change interrupt numbering for sparse IRQb694331cfb2eARM: omap1: Switch to useMULTI_IRQ55b447744389ARM: OMAP1: Switch to use generic irqchip in preparation for sparse IRQ928f81aa619dARM: OMAP1: Move UART defines to prepare for sparse IRQThanks,
Sekhar