Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
fsl-viu.c File Reference
#include <linux/module.h>
#include <linux/clk.h>
#include <linux/kernel.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/of_platform.h>
#include <linux/slab.h>
#include <media/v4l2-common.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/videobuf-dma-contig.h>

Go to the source code of this file.

Data Structures

struct  viu_fmt
 
struct  viu_buf
 
struct  viu_dmaqueue
 
struct  viu_status
 
struct  viu_reg
 
struct  viu_dev
 
struct  viu_fh
 

Macros

#define DRV_NAME   "fsl_viu"
 
#define VIU_VERSION   "0.5.1"
 
#define BUFFER_TIMEOUT   msecs_to_jiffies(500) /* 0.5 seconds */
 
#define VIU_VID_MEM_LIMIT   4 /* Video memory limit, in Mb */
 
#define VIU_VIDEO_DECODER_ADDR   0x25
 
#define dprintk(level, fmt, arg...)
 
#define norm_maxw()   720
 
#define norm_maxh()   576
 
#define INT_ALL_STATUS
 
#define NUM_FORMATS   ARRAY_SIZE(formats)
 
#define decoder_call(viu, o, f, args...)   v4l2_subdev_call(viu->decoder, o, f, ##args)
 

Enumerations

enum  status_config {
  SOFT_RST = 1 << 0, ERR_MASK = 0x0f << 4, ERR_NO = 0x00, ERR_DMA_V = 0x01 << 4,
  ERR_DMA_VB = 0x02 << 4, ERR_LINE_TOO_LONG = 0x04 << 4, ERR_TOO_MANG_LINES = 0x05 << 4, ERR_LINE_TOO_SHORT = 0x06 << 4,
  ERR_NOT_ENOUGH_LINE = 0x07 << 4, ERR_FIFO_OVERFLOW = 0x08 << 4, ERR_FIFO_UNDERFLOW = 0x09 << 4, ERR_1bit_ECC = 0x0a << 4,
  ERR_MORE_ECC = 0x0b << 4, INT_FIELD_EN = 0x01 << 8, INT_VSYNC_EN = 0x01 << 9, INT_HSYNC_EN = 0x01 << 10,
  INT_VSTART_EN = 0x01 << 11, INT_DMA_END_EN = 0x01 << 12, INT_ERROR_EN = 0x01 << 13, INT_ECC_EN = 0x01 << 14,
  INT_FIELD_STATUS = 0x01 << 16, INT_VSYNC_STATUS = 0x01 << 17, INT_HSYNC_STATUS = 0x01 << 18, INT_VSTART_STATUS = 0x01 << 19,
  INT_DMA_END_STATUS = 0x01 << 20, INT_ERROR_STATUS = 0x01 << 21, DMA_ACT = 0x01 << 27, FIELD_NO = 0x01 << 28,
  DITHER_ON = 0x01 << 29, ROUND_ON = 0x01 << 30, MODE_32BIT = 0x01 << 31
}
 

Functions

struct viu_reg __attribute__ ((packed))
 
struct viu_fmtformat_by_fourcc (int fourcc)
 
void viu_start_dma (struct viu_dev *dev)
 
void viu_stop_dma (struct viu_dev *dev)
 
int buffer_activate (struct viu_dev *dev, struct viu_buf *buf)
 
void viu_activate_overlay (struct viu_reg *viu_reg)
 
int vidioc_g_fbuf (struct file *file, void *priv, struct v4l2_framebuffer *arg)
 
int vidioc_s_fbuf (struct file *file, void *priv, const struct v4l2_framebuffer *arg)
 
void viu_activate_next_buf (struct viu_dev *dev, struct viu_dmaqueue *viuq)
 
void viu_default_settings (struct viu_reg *viu_reg)
 
void viu_reset (struct viu_reg *reg)
 
 MODULE_DEVICE_TABLE (of, mpc512x_viu_of_match)
 
 module_platform_driver (viu_of_platform_driver)
 
 MODULE_DESCRIPTION ("Freescale Video-In(VIU)")
 
 MODULE_AUTHOR ("Hongjun Chen")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (VIU_VERSION)
 

Variables

u32 status_cfg
 
u32 luminance
 
u32 chroma_r
 
u32 chroma_g
 
u32 chroma_b
 
u32 field_base_addr
 
u32 dma_inc
 
u32 picture_count
 
u32 req_alarm
 
u32 alpha
 
struct viu_dev __attribute__
 

Macro Definition Documentation

#define BUFFER_TIMEOUT   msecs_to_jiffies(500) /* 0.5 seconds */

Definition at line 34 of file fsl-viu.c.

#define decoder_call (   viu,
  o,
  f,
  args... 
)    v4l2_subdev_call(viu->decoder, o, f, ##args)

Definition at line 951 of file fsl-viu.c.

#define dprintk (   level,
  fmt,
  arg... 
)
Value:
do { \
if (level <= info_level) \
printk(KERN_DEBUG "viu: " fmt , ## arg); \
} while (0)

Definition at line 86 of file fsl-viu.c.

#define DRV_NAME   "fsl_viu"

Definition at line 31 of file fsl-viu.c.

#define INT_ALL_STATUS
Value:
INT_HSYNC_STATUS | INT_VSTART_STATUS | \
INT_DMA_END_STATUS | INT_ERROR_STATUS)

Definition at line 262 of file fsl-viu.c.

#define norm_maxh ( )    576

Definition at line 260 of file fsl-viu.c.

#define norm_maxw ( )    720

Definition at line 259 of file fsl-viu.c.

#define NUM_FORMATS   ARRAY_SIZE(formats)

Definition at line 266 of file fsl-viu.c.

#define VIU_VERSION   "0.5.1"

Definition at line 32 of file fsl-viu.c.

#define VIU_VID_MEM_LIMIT   4 /* Video memory limit, in Mb */

Definition at line 36 of file fsl-viu.c.

#define VIU_VIDEO_DECODER_ADDR   0x25

Definition at line 39 of file fsl-viu.c.

Enumeration Type Documentation

Enumerator:
SOFT_RST 
ERR_MASK 
ERR_NO 
ERR_DMA_V 
ERR_DMA_VB 
ERR_LINE_TOO_LONG 
ERR_TOO_MANG_LINES 
ERR_LINE_TOO_SHORT 
ERR_NOT_ENOUGH_LINE 
ERR_FIFO_OVERFLOW 
ERR_FIFO_UNDERFLOW 
ERR_1bit_ECC 
ERR_MORE_ECC 
INT_FIELD_EN 
INT_VSYNC_EN 
INT_HSYNC_EN 
INT_VSTART_EN 
INT_DMA_END_EN 
INT_ERROR_EN 
INT_ECC_EN 
INT_FIELD_STATUS 
INT_VSYNC_STATUS 
INT_HSYNC_STATUS 
INT_VSTART_STATUS 
INT_DMA_END_STATUS 
INT_ERROR_STATUS 
DMA_ACT 
FIELD_NO 
DITHER_ON 
ROUND_ON 
MODE_32BIT 

Definition at line 219 of file fsl-viu.c.

Function Documentation

struct viu_reg __attribute__ ( (packed)  )
read

Definition at line 171 of file esd_usb2.c.

int buffer_activate ( struct viu_dev dev,
struct viu_buf buf 
)
inline

Definition at line 436 of file fsl-viu.c.

struct viu_fmt* format_by_fourcc ( int  fourcc)
read

Definition at line 270 of file fsl-viu.c.

MODULE_AUTHOR ( "Hongjun Chen"  )
MODULE_DESCRIPTION ( "Freescale Video-In(VIU)"  )
MODULE_DEVICE_TABLE ( of  ,
mpc512x_viu_of_match   
)
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( viu_of_platform_driver  )
MODULE_VERSION ( VIU_VERSION  )
int vidioc_g_fbuf ( struct file file,
void priv,
struct v4l2_framebuffer arg 
)

Definition at line 852 of file fsl-viu.c.

int vidioc_s_fbuf ( struct file file,
void priv,
const struct v4l2_framebuffer arg 
)

Definition at line 863 of file fsl-viu.c.

void viu_activate_next_buf ( struct viu_dev dev,
struct viu_dmaqueue viuq 
)
inline

Definition at line 1056 of file fsl-viu.c.

void viu_activate_overlay ( struct viu_reg viu_reg)
inline

Definition at line 753 of file fsl-viu.c.

void viu_default_settings ( struct viu_reg viu_reg)
inline

Definition at line 1080 of file fsl-viu.c.

void viu_reset ( struct viu_reg reg)

Definition at line 1397 of file fsl-viu.c.

void viu_start_dma ( struct viu_dev dev)

Definition at line 283 of file fsl-viu.c.

void viu_stop_dma ( struct viu_dev dev)

Definition at line 294 of file fsl-viu.c.

Variable Documentation

u32 alpha

Definition at line 163 of file fsl-viu.c.

u32 chroma_b

Definition at line 158 of file fsl-viu.c.

u32 chroma_g

Definition at line 157 of file fsl-viu.c.

u32 chroma_r

Definition at line 156 of file fsl-viu.c.

u32 dma_inc

Definition at line 160 of file fsl-viu.c.

u32 field_base_addr

Definition at line 159 of file fsl-viu.c.

u32 luminance

Definition at line 155 of file fsl-viu.c.

u32 picture_count

Definition at line 161 of file fsl-viu.c.

u32 req_alarm

Definition at line 162 of file fsl-viu.c.

u32 status_cfg

Definition at line 154 of file fsl-viu.c.