Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
ipu_irq.c File Reference
#include <linux/init.h>
#include <linux/err.h>
#include <linux/spinlock.h>
#include <linux/delay.h>
#include <linux/clk.h>
#include <linux/irq.h>
#include <linux/io.h>
#include <linux/module.h>
#include <mach/ipu.h>
#include "ipu_intern.h"

Go to the source code of this file.

Data Structures

struct  ipu_irq_bank
 
struct  ipu_irq_map
 

Macros

#define IPU_IRQ_NR_FN_BANKS   3
 
#define IPU_IRQ_NR_ERR_BANKS   2
 
#define IPU_IRQ_NR_BANKS   (IPU_IRQ_NR_FN_BANKS + IPU_IRQ_NR_ERR_BANKS)
 

Functions

bool ipu_irq_status (unsigned int irq)
 
int ipu_irq_map (unsigned int source)
 
int ipu_irq_unmap (unsigned int source)
 
int __init ipu_irq_attach_irq (struct ipu *ipu, struct platform_device *dev)
 
void ipu_irq_detach_irq (struct ipu *ipu, struct platform_device *dev)
 

Macro Definition Documentation

#define IPU_IRQ_NR_BANKS   (IPU_IRQ_NR_FN_BANKS + IPU_IRQ_NR_ERR_BANKS)

Definition at line 43 of file ipu_irq.c.

#define IPU_IRQ_NR_ERR_BANKS   2

Definition at line 42 of file ipu_irq.c.

#define IPU_IRQ_NR_FN_BANKS   3

Definition at line 41 of file ipu_irq.c.

Function Documentation

int __init ipu_irq_attach_irq ( struct ipu ipu,
struct platform_device dev 
)

Definition at line 356 of file ipu_irq.c.

void ipu_irq_detach_irq ( struct ipu ipu,
struct platform_device dev 
)

Definition at line 398 of file ipu_irq.c.

int ipu_irq_map ( unsigned int  source)

ipu_irq_map() - map an IPU interrupt source to an IRQ number : interrupt source bit position (see below)

Returns
: mapped IRQ number or negative error code

The source parameter has to be explained further. On i.MX31 IPU has 137 IRQ sources, they are broken down in 5 32-bit registers, like 32, 32, 24, 32, 17. However, the source argument of this function is not the sequence number of the possible IRQ, but rather its bit position. So, first interrupt in fourth register has source number 96, and not 88. This makes calculations easier, and also provides forward compatibility with any future IPU implementations with any interrupt bit assignments.

Definition at line 198 of file ipu_irq.c.

bool ipu_irq_status ( unsigned int  irq)

ipu_irq_status() - returns the current interrupt status of the specified IRQ. : interrupt line to get status for.

Returns
: true if the interrupt is pending/asserted or false if the interrupt is not pending.

Definition at line 169 of file ipu_irq.c.

int ipu_irq_unmap ( unsigned int  source)

ipu_irq_map() - map an IPU interrupt source to an IRQ number : interrupt source bit position (see ipu_irq_map())

Returns
: 0 or negative error code

Definition at line 242 of file ipu_irq.c.