Skip to content

Commit 807d38b

Browse files
Hongtao JiaScott Wood
authored andcommitted
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 5e86bfd ("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>
1 parent 7dea9ec commit 807d38b

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎arch/powerpc/include/asm/mpic.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@ extern struct bus_type mpic_subsys;
391391
#define MPIC_REGSET_STANDARD MPIC_REGSET(0) /* Original MPIC */
392392
#define MPIC_REGSET_TSI108 MPIC_REGSET(1) /* Tsi108/109 PIC */
393393

394+
/* Get the version of primary MPIC */
395+
extern u32 fsl_mpic_primary_get_version(void);
396+
394397
/* Allocate the controller structure and setup the linux irq descs
395398
* for the range if interrupts passed in. No HW initialization is
396399
* actually performed.

‎arch/powerpc/sysdev/mpic.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,6 +1219,16 @@ static u32 fsl_mpic_get_version(struct mpic *mpic)
12191219
* Exported functions
12201220
*/
12211221

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+
12221232
struct mpic * __init mpic_alloc(struct device_node *node,
12231233
phys_addr_t phys_addr,
12241234
unsigned int flags,

0 commit comments

Comments
 (0)