linux/drivers/mxc/vpu/mxc_vpu.c File Reference

VPU system initialization and file operation implementation. More...

Functions

static int vpu_alloc_dma_buffer (struct vpu_mem_desc *mem)
static void vpu_free_dma_buffer (struct vpu_mem_desc *mem)
static int vpu_free_buffers (void)
static irqreturn_t vpu_ipi_irq_handler (int irq, void *dev_id)
bool vpu_is_valid_phy_memory (u32 paddr)
static int vpu_open (struct inode *inode, struct file *filp)
static long vpu_ioctl (struct file *filp, u_int cmd, u_long arg)
static int vpu_release (struct inode *inode, struct file *filp)
static int vpu_fasync (int fd, struct file *filp, int mode)
static int vpu_map_hwregs (struct file *fp, struct vm_area_struct *vm)
static int vpu_map_dma_mem (struct file *fp, struct vm_area_struct *vm)
static int vpu_mmap (struct file *fp, struct vm_area_struct *vm)
static int vpu_dev_probe (struct platform_device *pdev)

Variables

static struct platform_driver mxcvpu_driver

Detailed Description

VPU system initialization and file operation implementation.


Function Documentation

static int vpu_alloc_dma_buffer ( struct vpu_mem_desc *  mem  )  [static]

Private function to alloc dma buffer

Returns:
status 0 success.

Referenced by vpu_ioctl().

static int vpu_dev_probe ( struct platform_device *  pdev  )  [static]

This function is called by the driver framework to initialize the vpu device.

Parameters:
dev The device structure for the vpu passed in by the framework.
Returns:
0 on success or negative error code on error

References vpu_ipi_irq_handler().

static int vpu_fasync ( int  fd,
struct file *  filp,
int  mode 
) [static]

fasync function for vpu file operation

Returns:
0 on success or negative error code on error
static int vpu_free_buffers ( void   )  [static]

Private function to free buffers

Returns:
status 0 success.

References vpu_free_dma_buffer().

Referenced by vpu_release().

static void vpu_free_dma_buffer ( struct vpu_mem_desc *  mem  )  [static]

Private function to free dma buffer

Referenced by vpu_free_buffers(), vpu_ioctl(), and vpu_release().

static long vpu_ioctl ( struct file *  filp,
u_int  cmd,
u_long  arg 
) [static]

IO ctrl function for vpu file operation.

Parameters:
cmd IO ctrl command
Returns:
0 on success or negative error code on error

References vpu_alloc_dma_buffer(), vpu_free_dma_buffer(), and vpu_is_valid_phy_memory().

static irqreturn_t vpu_ipi_irq_handler ( int  irq,
void *  dev_id 
) [static]

vpu interrupt handler

References IRQ_HANDLED.

Referenced by vpu_dev_probe().

bool vpu_is_valid_phy_memory ( u32  paddr  ) 

vpu jpu interrupt handler

check phy memory prepare to pass to vpu is valid or not, we already address some issue that if pass a wrong address to vpu (like virtual address), system will hang.

Returns:
true return is a valid phy memory address, false return not.

Referenced by vpu_ioctl().

static int vpu_map_dma_mem ( struct file *  fp,
struct vm_area_struct *  vm 
) [static]

memory map function of memory for vpu file operation

Returns:
0 on success or negative error code on error

Referenced by vpu_mmap().

static int vpu_map_hwregs ( struct file *  fp,
struct vm_area_struct *  vm 
) [static]

memory map function of harware registers for vpu file operation

Returns:
0 on success or negative error code on error

Referenced by vpu_mmap().

static int vpu_mmap ( struct file *  fp,
struct vm_area_struct *  vm 
) [static]

memory map interface for vpu file operation

Returns:
0 on success or negative error code on error

References vpu_map_dma_mem(), and vpu_map_hwregs().

static int vpu_open ( struct inode *  inode,
struct file *  filp 
) [static]

open function for vpu file operation

Returns:
0 on success or negative error code on error
static int vpu_release ( struct inode *  inode,
struct file *  filp 
) [static]

Release function for vpu file operation.

Returns:
0 on success or negative error code on error

References vpu_free_buffers(), and vpu_free_dma_buffer().


Variable Documentation

struct platform_driver mxcvpu_driver [static]
Initial value:
 {
        .driver = {
                   .name = "mxc_vpu",
                   },
        .probe = vpu_dev_probe,
        .remove = vpu_dev_remove,
        .suspend = vpu_suspend,
        .resume = vpu_resume,
}

Driver definition

footer
©  Freescale Semiconductor, Inc., 2007.  All rights reserved.
Freescale Confidential Proprietary
NDA Required
doxygen