Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
mx2_emmaprp.c File Reference
#include <linux/module.h>
#include <linux/clk.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#include <media/v4l2-mem2mem.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/videobuf2-dma-contig.h>
#include <asm/sizes.h>

Go to the source code of this file.

Data Structures

struct  emmaprp_fmt
 
struct  emmaprp_q_data
 
struct  emmaprp_dev
 
struct  emmaprp_ctx
 

Macros

#define EMMAPRP_MODULE_NAME   "mem2mem-emmaprp"
 
#define MIN_W   32
 
#define MIN_H   32
 
#define MAX_W   2040
 
#define MAX_H   2046
 
#define S_ALIGN   1 /* multiple of 2 */
 
#define W_ALIGN_YUV420   3 /* multiple of 8 */
 
#define W_ALIGN_OTHERS   2 /* multiple of 4 */
 
#define H_ALIGN   1 /* multiple of 2 */
 
#define MEM2MEM_CAPTURE   (1 << 0)
 
#define MEM2MEM_OUTPUT   (1 << 1)
 
#define MEM2MEM_NAME   "m2m-emmaprp"
 
#define MEM2MEM_VID_MEM_LIMIT   SZ_16M
 
#define dprintk(dev, fmt, arg...)   v4l2_dbg(1, debug, &dev->v4l2_dev, "%s: " fmt, __func__, ## arg)
 
#define PRP_CNTL   0x00
 
#define PRP_INTR_CNTL   0x04
 
#define PRP_INTRSTATUS   0x08
 
#define PRP_SOURCE_Y_PTR   0x0c
 
#define PRP_SOURCE_CB_PTR   0x10
 
#define PRP_SOURCE_CR_PTR   0x14
 
#define PRP_DEST_RGB1_PTR   0x18
 
#define PRP_DEST_RGB2_PTR   0x1c
 
#define PRP_DEST_Y_PTR   0x20
 
#define PRP_DEST_CB_PTR   0x24
 
#define PRP_DEST_CR_PTR   0x28
 
#define PRP_SRC_FRAME_SIZE   0x2c
 
#define PRP_DEST_CH1_LINE_STRIDE   0x30
 
#define PRP_SRC_PIXEL_FORMAT_CNTL   0x34
 
#define PRP_CH1_PIXEL_FORMAT_CNTL   0x38
 
#define PRP_CH1_OUT_IMAGE_SIZE   0x3c
 
#define PRP_CH2_OUT_IMAGE_SIZE   0x40
 
#define PRP_SRC_LINE_STRIDE   0x44
 
#define PRP_CSC_COEF_012   0x48
 
#define PRP_CSC_COEF_345   0x4c
 
#define PRP_CSC_COEF_678   0x50
 
#define PRP_CH1_RZ_HORI_COEF1   0x54
 
#define PRP_CH1_RZ_HORI_COEF2   0x58
 
#define PRP_CH1_RZ_HORI_VALID   0x5c
 
#define PRP_CH1_RZ_VERT_COEF1   0x60
 
#define PRP_CH1_RZ_VERT_COEF2   0x64
 
#define PRP_CH1_RZ_VERT_VALID   0x68
 
#define PRP_CH2_RZ_HORI_COEF1   0x6c
 
#define PRP_CH2_RZ_HORI_COEF2   0x70
 
#define PRP_CH2_RZ_HORI_VALID   0x74
 
#define PRP_CH2_RZ_VERT_COEF1   0x78
 
#define PRP_CH2_RZ_VERT_COEF2   0x7c
 
#define PRP_CH2_RZ_VERT_VALID   0x80
 
#define PRP_CNTL_CH1EN   (1 << 0)
 
#define PRP_CNTL_CH2EN   (1 << 1)
 
#define PRP_CNTL_CSIEN   (1 << 2)
 
#define PRP_CNTL_DATA_IN_YUV420   (0 << 3)
 
#define PRP_CNTL_DATA_IN_YUV422   (1 << 3)
 
#define PRP_CNTL_DATA_IN_RGB16   (2 << 3)
 
#define PRP_CNTL_DATA_IN_RGB32   (3 << 3)
 
#define PRP_CNTL_CH1_OUT_RGB8   (0 << 5)
 
#define PRP_CNTL_CH1_OUT_RGB16   (1 << 5)
 
#define PRP_CNTL_CH1_OUT_RGB32   (2 << 5)
 
#define PRP_CNTL_CH1_OUT_YUV422   (3 << 5)
 
#define PRP_CNTL_CH2_OUT_YUV420   (0 << 7)
 
#define PRP_CNTL_CH2_OUT_YUV422   (1 << 7)
 
#define PRP_CNTL_CH2_OUT_YUV444   (2 << 7)
 
#define PRP_CNTL_CH1_LEN   (1 << 9)
 
#define PRP_CNTL_CH2_LEN   (1 << 10)
 
#define PRP_CNTL_SKIP_FRAME   (1 << 11)
 
#define PRP_CNTL_SWRST   (1 << 12)
 
#define PRP_CNTL_CLKEN   (1 << 13)
 
#define PRP_CNTL_WEN   (1 << 14)
 
#define PRP_CNTL_CH1BYP   (1 << 15)
 
#define PRP_CNTL_IN_TSKIP(x)   ((x) << 16)
 
#define PRP_CNTL_CH1_TSKIP(x)   ((x) << 19)
 
#define PRP_CNTL_CH2_TSKIP(x)   ((x) << 22)
 
#define PRP_CNTL_INPUT_FIFO_LEVEL(x)   ((x) << 25)
 
#define PRP_CNTL_RZ_FIFO_LEVEL(x)   ((x) << 27)
 
#define PRP_CNTL_CH2B1EN   (1 << 29)
 
#define PRP_CNTL_CH2B2EN   (1 << 30)
 
#define PRP_CNTL_CH2FEN   (1 << 31)
 
#define PRP_SIZE_HEIGHT(x)   (x)
 
#define PRP_SIZE_WIDTH(x)   ((x) << 16)
 
#define PRP_INTR_RDERR   (1 << 0)
 
#define PRP_INTR_CH1WERR   (1 << 1)
 
#define PRP_INTR_CH2WERR   (1 << 2)
 
#define PRP_INTR_CH1FC   (1 << 3)
 
#define PRP_INTR_CH2FC   (1 << 5)
 
#define PRP_INTR_LBOVF   (1 << 7)
 
#define PRP_INTR_CH2OVF   (1 << 8)
 
#define PRP_INTR_ST_RDERR   (1 << 0)
 
#define PRP_INTR_ST_CH1WERR   (1 << 1)
 
#define PRP_INTR_ST_CH2WERR   (1 << 2)
 
#define PRP_INTR_ST_CH2B2CI   (1 << 3)
 
#define PRP_INTR_ST_CH2B1CI   (1 << 4)
 
#define PRP_INTR_ST_CH1B2CI   (1 << 5)
 
#define PRP_INTR_ST_CH1B1CI   (1 << 6)
 
#define PRP_INTR_ST_LBOVF   (1 << 7)
 
#define PRP_INTR_ST_CH2OVF   (1 << 8)
 
#define NUM_FORMATS   ARRAY_SIZE(formats)
 

Enumerations

enum  { V4L2_M2M_SRC = 0, V4L2_M2M_DST = 1 }
 

Functions

 MODULE_DESCRIPTION ("Mem-to-mem device which supports eMMa-PrP present in mx2 SoCs")
 
 MODULE_AUTHOR ("Javier Martin <[email protected]")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION ("0.0.1")
 
 module_param (debug, bool, 0644)
 
 module_init (emmaprp_init)
 
 module_exit (emmaprp_exit)
 

Macro Definition Documentation

#define dprintk (   dev,
  fmt,
  arg... 
)    v4l2_dbg(1, debug, &dev->v4l2_dev, "%s: " fmt, __func__, ## arg)

Definition at line 61 of file mx2_emmaprp.c.

#define EMMAPRP_MODULE_NAME   "mem2mem-emmaprp"

Definition at line 32 of file mx2_emmaprp.c.

#define H_ALIGN   1 /* multiple of 2 */

Definition at line 50 of file mx2_emmaprp.c.

#define MAX_H   2046

Definition at line 45 of file mx2_emmaprp.c.

#define MAX_W   2040

Definition at line 44 of file mx2_emmaprp.c.

#define MEM2MEM_CAPTURE   (1 << 0)

Definition at line 53 of file mx2_emmaprp.c.

#define MEM2MEM_NAME   "m2m-emmaprp"

Definition at line 56 of file mx2_emmaprp.c.

#define MEM2MEM_OUTPUT   (1 << 1)

Definition at line 54 of file mx2_emmaprp.c.

#define MEM2MEM_VID_MEM_LIMIT   SZ_16M

Definition at line 59 of file mx2_emmaprp.c.

#define MIN_H   32

Definition at line 43 of file mx2_emmaprp.c.

#define MIN_W   32

Definition at line 42 of file mx2_emmaprp.c.

#define NUM_FORMATS   ARRAY_SIZE(formats)

Definition at line 184 of file mx2_emmaprp.c.

#define PRP_CH1_OUT_IMAGE_SIZE   0x3c

Definition at line 80 of file mx2_emmaprp.c.

#define PRP_CH1_PIXEL_FORMAT_CNTL   0x38

Definition at line 79 of file mx2_emmaprp.c.

#define PRP_CH1_RZ_HORI_COEF1   0x54

Definition at line 86 of file mx2_emmaprp.c.

#define PRP_CH1_RZ_HORI_COEF2   0x58

Definition at line 87 of file mx2_emmaprp.c.

#define PRP_CH1_RZ_HORI_VALID   0x5c

Definition at line 88 of file mx2_emmaprp.c.

#define PRP_CH1_RZ_VERT_COEF1   0x60

Definition at line 89 of file mx2_emmaprp.c.

#define PRP_CH1_RZ_VERT_COEF2   0x64

Definition at line 90 of file mx2_emmaprp.c.

#define PRP_CH1_RZ_VERT_VALID   0x68

Definition at line 91 of file mx2_emmaprp.c.

#define PRP_CH2_OUT_IMAGE_SIZE   0x40

Definition at line 81 of file mx2_emmaprp.c.

#define PRP_CH2_RZ_HORI_COEF1   0x6c

Definition at line 92 of file mx2_emmaprp.c.

#define PRP_CH2_RZ_HORI_COEF2   0x70

Definition at line 93 of file mx2_emmaprp.c.

#define PRP_CH2_RZ_HORI_VALID   0x74

Definition at line 94 of file mx2_emmaprp.c.

#define PRP_CH2_RZ_VERT_COEF1   0x78

Definition at line 95 of file mx2_emmaprp.c.

#define PRP_CH2_RZ_VERT_COEF2   0x7c

Definition at line 96 of file mx2_emmaprp.c.

#define PRP_CH2_RZ_VERT_VALID   0x80

Definition at line 97 of file mx2_emmaprp.c.

#define PRP_CNTL   0x00

Definition at line 65 of file mx2_emmaprp.c.

#define PRP_CNTL_CH1_LEN   (1 << 9)

Definition at line 113 of file mx2_emmaprp.c.

#define PRP_CNTL_CH1_OUT_RGB16   (1 << 5)

Definition at line 107 of file mx2_emmaprp.c.

#define PRP_CNTL_CH1_OUT_RGB32   (2 << 5)

Definition at line 108 of file mx2_emmaprp.c.

#define PRP_CNTL_CH1_OUT_RGB8   (0 << 5)

Definition at line 106 of file mx2_emmaprp.c.

#define PRP_CNTL_CH1_OUT_YUV422   (3 << 5)

Definition at line 109 of file mx2_emmaprp.c.

#define PRP_CNTL_CH1_TSKIP (   x)    ((x) << 19)

Definition at line 121 of file mx2_emmaprp.c.

#define PRP_CNTL_CH1BYP   (1 << 15)

Definition at line 119 of file mx2_emmaprp.c.

#define PRP_CNTL_CH1EN   (1 << 0)

Definition at line 99 of file mx2_emmaprp.c.

#define PRP_CNTL_CH2_LEN   (1 << 10)

Definition at line 114 of file mx2_emmaprp.c.

#define PRP_CNTL_CH2_OUT_YUV420   (0 << 7)

Definition at line 110 of file mx2_emmaprp.c.

#define PRP_CNTL_CH2_OUT_YUV422   (1 << 7)

Definition at line 111 of file mx2_emmaprp.c.

#define PRP_CNTL_CH2_OUT_YUV444   (2 << 7)

Definition at line 112 of file mx2_emmaprp.c.

#define PRP_CNTL_CH2_TSKIP (   x)    ((x) << 22)

Definition at line 122 of file mx2_emmaprp.c.

#define PRP_CNTL_CH2B1EN   (1 << 29)

Definition at line 125 of file mx2_emmaprp.c.

#define PRP_CNTL_CH2B2EN   (1 << 30)

Definition at line 126 of file mx2_emmaprp.c.

#define PRP_CNTL_CH2EN   (1 << 1)

Definition at line 100 of file mx2_emmaprp.c.

#define PRP_CNTL_CH2FEN   (1 << 31)

Definition at line 127 of file mx2_emmaprp.c.

#define PRP_CNTL_CLKEN   (1 << 13)

Definition at line 117 of file mx2_emmaprp.c.

#define PRP_CNTL_CSIEN   (1 << 2)

Definition at line 101 of file mx2_emmaprp.c.

#define PRP_CNTL_DATA_IN_RGB16   (2 << 3)

Definition at line 104 of file mx2_emmaprp.c.

#define PRP_CNTL_DATA_IN_RGB32   (3 << 3)

Definition at line 105 of file mx2_emmaprp.c.

#define PRP_CNTL_DATA_IN_YUV420   (0 << 3)

Definition at line 102 of file mx2_emmaprp.c.

#define PRP_CNTL_DATA_IN_YUV422   (1 << 3)

Definition at line 103 of file mx2_emmaprp.c.

#define PRP_CNTL_IN_TSKIP (   x)    ((x) << 16)

Definition at line 120 of file mx2_emmaprp.c.

#define PRP_CNTL_INPUT_FIFO_LEVEL (   x)    ((x) << 25)

Definition at line 123 of file mx2_emmaprp.c.

#define PRP_CNTL_RZ_FIFO_LEVEL (   x)    ((x) << 27)

Definition at line 124 of file mx2_emmaprp.c.

#define PRP_CNTL_SKIP_FRAME   (1 << 11)

Definition at line 115 of file mx2_emmaprp.c.

#define PRP_CNTL_SWRST   (1 << 12)

Definition at line 116 of file mx2_emmaprp.c.

#define PRP_CNTL_WEN   (1 << 14)

Definition at line 118 of file mx2_emmaprp.c.

#define PRP_CSC_COEF_012   0x48

Definition at line 83 of file mx2_emmaprp.c.

#define PRP_CSC_COEF_345   0x4c

Definition at line 84 of file mx2_emmaprp.c.

#define PRP_CSC_COEF_678   0x50

Definition at line 85 of file mx2_emmaprp.c.

#define PRP_DEST_CB_PTR   0x24

Definition at line 74 of file mx2_emmaprp.c.

#define PRP_DEST_CH1_LINE_STRIDE   0x30

Definition at line 77 of file mx2_emmaprp.c.

#define PRP_DEST_CR_PTR   0x28

Definition at line 75 of file mx2_emmaprp.c.

#define PRP_DEST_RGB1_PTR   0x18

Definition at line 71 of file mx2_emmaprp.c.

#define PRP_DEST_RGB2_PTR   0x1c

Definition at line 72 of file mx2_emmaprp.c.

#define PRP_DEST_Y_PTR   0x20

Definition at line 73 of file mx2_emmaprp.c.

#define PRP_INTR_CH1FC   (1 << 3)

Definition at line 136 of file mx2_emmaprp.c.

#define PRP_INTR_CH1WERR   (1 << 1)

Definition at line 134 of file mx2_emmaprp.c.

#define PRP_INTR_CH2FC   (1 << 5)

Definition at line 137 of file mx2_emmaprp.c.

#define PRP_INTR_CH2OVF   (1 << 8)

Definition at line 139 of file mx2_emmaprp.c.

#define PRP_INTR_CH2WERR   (1 << 2)

Definition at line 135 of file mx2_emmaprp.c.

#define PRP_INTR_CNTL   0x04

Definition at line 66 of file mx2_emmaprp.c.

#define PRP_INTR_LBOVF   (1 << 7)

Definition at line 138 of file mx2_emmaprp.c.

#define PRP_INTR_RDERR   (1 << 0)

Definition at line 133 of file mx2_emmaprp.c.

#define PRP_INTR_ST_CH1B1CI   (1 << 6)

Definition at line 147 of file mx2_emmaprp.c.

#define PRP_INTR_ST_CH1B2CI   (1 << 5)

Definition at line 146 of file mx2_emmaprp.c.

#define PRP_INTR_ST_CH1WERR   (1 << 1)

Definition at line 142 of file mx2_emmaprp.c.

#define PRP_INTR_ST_CH2B1CI   (1 << 4)

Definition at line 145 of file mx2_emmaprp.c.

#define PRP_INTR_ST_CH2B2CI   (1 << 3)

Definition at line 144 of file mx2_emmaprp.c.

#define PRP_INTR_ST_CH2OVF   (1 << 8)

Definition at line 149 of file mx2_emmaprp.c.

#define PRP_INTR_ST_CH2WERR   (1 << 2)

Definition at line 143 of file mx2_emmaprp.c.

#define PRP_INTR_ST_LBOVF   (1 << 7)

Definition at line 148 of file mx2_emmaprp.c.

#define PRP_INTR_ST_RDERR   (1 << 0)

Definition at line 141 of file mx2_emmaprp.c.

#define PRP_INTRSTATUS   0x08

Definition at line 67 of file mx2_emmaprp.c.

#define PRP_SIZE_HEIGHT (   x)    (x)

Definition at line 129 of file mx2_emmaprp.c.

#define PRP_SIZE_WIDTH (   x)    ((x) << 16)

Definition at line 130 of file mx2_emmaprp.c.

#define PRP_SOURCE_CB_PTR   0x10

Definition at line 69 of file mx2_emmaprp.c.

#define PRP_SOURCE_CR_PTR   0x14

Definition at line 70 of file mx2_emmaprp.c.

#define PRP_SOURCE_Y_PTR   0x0c

Definition at line 68 of file mx2_emmaprp.c.

#define PRP_SRC_FRAME_SIZE   0x2c

Definition at line 76 of file mx2_emmaprp.c.

#define PRP_SRC_LINE_STRIDE   0x44

Definition at line 82 of file mx2_emmaprp.c.

#define PRP_SRC_PIXEL_FORMAT_CNTL   0x34

Definition at line 78 of file mx2_emmaprp.c.

#define S_ALIGN   1 /* multiple of 2 */

Definition at line 47 of file mx2_emmaprp.c.

#define W_ALIGN_OTHERS   2 /* multiple of 4 */

Definition at line 49 of file mx2_emmaprp.c.

#define W_ALIGN_YUV420   3 /* multiple of 8 */

Definition at line 48 of file mx2_emmaprp.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
V4L2_M2M_SRC 
V4L2_M2M_DST 

Definition at line 179 of file mx2_emmaprp.c.

Function Documentation

MODULE_AUTHOR ( )
MODULE_DESCRIPTION ( "Mem-to-mem device which supports eMMa-PrP present in mx2 SoCs"  )
module_exit ( emmaprp_exit  )
module_init ( emmaprp_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
bool  ,
0644   
)
MODULE_VERSION ( "0.0.1"  )