Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/mpic: Add get_version API both for internal and external use

MPIC version is useful information for both mpic_alloc() and mpic_init().
The patch provide an API to get MPIC version for reusing the code.
Also, some other IP block may need MPIC version for their own use.
The API for external use is also provided.

This function had been previously added but was removed by commit
5e86bfde9cd93f2 ("powerpc/mpic: remove unused functions") due to the
lack of a user. This function will be used by "powerpc/mpic: Add
get_version API both for internal and external use".

Signed-off-by: Jia Hongtao <hongtao.jia@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
[scottwood@freescale.com: changelog update]
Signed-off-by: Scott Wood <scottwood@freescale.com>

authored by

Hongtao Jia and committed by
Scott Wood
807d38b7 7dea9ec5

+13
+3
arch/powerpc/include/asm/mpic.h
··· 391 391 #define MPIC_REGSET_STANDARD MPIC_REGSET(0) /* Original MPIC */ 392 392 #define MPIC_REGSET_TSI108 MPIC_REGSET(1) /* Tsi108/109 PIC */ 393 393 394 + /* Get the version of primary MPIC */ 395 + extern u32 fsl_mpic_primary_get_version(void); 396 + 394 397 /* Allocate the controller structure and setup the linux irq descs 395 398 * for the range if interrupts passed in. No HW initialization is 396 399 * actually performed.
+10
arch/powerpc/sysdev/mpic.c
··· 1219 1219 * Exported functions 1220 1220 */ 1221 1221 1222 + u32 fsl_mpic_primary_get_version(void) 1223 + { 1224 + struct mpic *mpic = mpic_primary; 1225 + 1226 + if (mpic) 1227 + return fsl_mpic_get_version(mpic); 1228 + 1229 + return 0; 1230 + } 1231 + 1222 1232 struct mpic * __init mpic_alloc(struct device_node *node, 1223 1233 phys_addr_t phys_addr, 1224 1234 unsigned int flags,