initial commit, taken and modified from linaro/insignal
diff --git a/exynos4/hal/include/Exif.h b/exynos4/hal/include/Exif.h
new file mode 100644
index 0000000..71e2241
--- /dev/null
+++ b/exynos4/hal/include/Exif.h
@@ -0,0 +1,231 @@
+/*
+ * Copyright Samsung Electronics Co.,LTD.
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef ANDROID_HARDWARE_EXIF_H
+#define ANDROID_HARDWARE_EXIF_H
+
+#include <math.h>
+
+#define EXIF_LOG2(x)                    (log((double)(x)) / log(2.0))
+#define APEX_FNUM_TO_APERTURE(x)        ((int)(EXIF_LOG2((double)(x)) * 2 + 0.5))
+#define APEX_EXPOSURE_TO_SHUTTER(x)     ((x) >= 1 ?                                 \
+                                        (int)(-(EXIF_LOG2((double)(x)) + 0.5)) :    \
+                                        (int)(-(EXIF_LOG2((double)(x)) - 0.5)))
+#define APEX_ISO_TO_FILMSENSITIVITY(x)  ((int)(EXIF_LOG2((x) / 3.125) + 0.5))
+
+#define NUM_SIZE                    2
+#define IFD_SIZE                    12
+#define OFFSET_SIZE                 4
+
+#define NUM_0TH_IFD_TIFF            10
+#define NUM_0TH_IFD_EXIF            22
+#define NUM_0TH_IFD_GPS             10
+#define NUM_1TH_IFD_TIFF            9
+
+/* Type */
+#define EXIF_TYPE_BYTE              1
+#define EXIF_TYPE_ASCII             2
+#define EXIF_TYPE_SHORT             3
+#define EXIF_TYPE_LONG              4
+#define EXIF_TYPE_RATIONAL          5
+#define EXIF_TYPE_UNDEFINED         7
+#define EXIF_TYPE_SLONG             9
+#define EXIF_TYPE_SRATIONAL         10
+
+#define EXIF_FILE_SIZE              28800
+
+/* 0th IFD TIFF Tags */
+#define EXIF_TAG_IMAGE_WIDTH                    0x0100
+#define EXIF_TAG_IMAGE_HEIGHT                   0x0101
+#define EXIF_TAG_MAKE                           0x010f
+#define EXIF_TAG_MODEL                          0x0110
+#define EXIF_TAG_ORIENTATION                    0x0112
+#define EXIF_TAG_SOFTWARE                       0x0131
+#define EXIF_TAG_DATE_TIME                      0x0132
+#define EXIF_TAG_YCBCR_POSITIONING              0x0213
+#define EXIF_TAG_EXIF_IFD_POINTER               0x8769
+#define EXIF_TAG_GPS_IFD_POINTER                0x8825
+
+/* 0th IFD Exif Private Tags */
+#define EXIF_TAG_EXPOSURE_TIME                  0x829A
+#define EXIF_TAG_FNUMBER                        0x829D
+#define EXIF_TAG_EXPOSURE_PROGRAM               0x8822
+#define EXIF_TAG_ISO_SPEED_RATING               0x8827
+#define EXIF_TAG_EXIF_VERSION                   0x9000
+#define EXIF_TAG_DATE_TIME_ORG                  0x9003
+#define EXIF_TAG_DATE_TIME_DIGITIZE             0x9004
+#define EXIF_TAG_SHUTTER_SPEED                  0x9201
+#define EXIF_TAG_APERTURE                       0x9202
+#define EXIF_TAG_BRIGHTNESS                     0x9203
+#define EXIF_TAG_EXPOSURE_BIAS                  0x9204
+#define EXIF_TAG_MAX_APERTURE                   0x9205
+#define EXIF_TAG_METERING_MODE                  0x9207
+#define EXIF_TAG_FLASH                          0x9209
+#define EXIF_TAG_FOCAL_LENGTH                   0x920A
+#define EXIF_TAG_USER_COMMENT                   0x9286
+#define EXIF_TAG_COLOR_SPACE                    0xA001
+#define EXIF_TAG_PIXEL_X_DIMENSION              0xA002
+#define EXIF_TAG_PIXEL_Y_DIMENSION              0xA003
+#define EXIF_TAG_EXPOSURE_MODE                  0xA402
+#define EXIF_TAG_WHITE_BALANCE                  0xA403
+#define EXIF_TAG_SCENCE_CAPTURE_TYPE            0xA406
+
+/* 0th IFD GPS Info Tags */
+#define EXIF_TAG_GPS_VERSION_ID                 0x0000
+#define EXIF_TAG_GPS_LATITUDE_REF               0x0001
+#define EXIF_TAG_GPS_LATITUDE                   0x0002
+#define EXIF_TAG_GPS_LONGITUDE_REF              0x0003
+#define EXIF_TAG_GPS_LONGITUDE                  0x0004
+#define EXIF_TAG_GPS_ALTITUDE_REF               0x0005
+#define EXIF_TAG_GPS_ALTITUDE                   0x0006
+#define EXIF_TAG_GPS_TIMESTAMP                  0x0007
+#define EXIF_TAG_GPS_PROCESSING_METHOD          0x001B
+#define EXIF_TAG_GPS_DATESTAMP                  0x001D
+
+/* 1th IFD TIFF Tags */
+#define EXIF_TAG_COMPRESSION_SCHEME             0x0103
+#define EXIF_TAG_X_RESOLUTION                   0x011A
+#define EXIF_TAG_Y_RESOLUTION                   0x011B
+#define EXIF_TAG_RESOLUTION_UNIT                0x0128
+#define EXIF_TAG_JPEG_INTERCHANGE_FORMAT        0x0201
+#define EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LEN    0x0202
+
+typedef enum {
+    EXIF_ORIENTATION_UP     = 1,
+    EXIF_ORIENTATION_90     = 6,
+    EXIF_ORIENTATION_180    = 3,
+    EXIF_ORIENTATION_270    = 8,
+} ExifOrientationType;
+
+typedef enum {
+    EXIF_SCENE_STANDARD,
+    EXIF_SCENE_LANDSCAPE,
+    EXIF_SCENE_PORTRAIT,
+    EXIF_SCENE_NIGHT,
+} CamExifSceneCaptureType;
+
+typedef enum {
+    EXIF_METERING_UNKNOWN,
+    EXIF_METERING_AVERAGE,
+    EXIF_METERING_CENTER,
+    EXIF_METERING_SPOT,
+    EXIF_METERING_MULTISPOT,
+    EXIF_METERING_PATTERN,
+    EXIF_METERING_PARTIAL,
+    EXIF_METERING_OTHER     = 255,
+} CamExifMeteringModeType;
+
+typedef enum {
+    EXIF_EXPOSURE_AUTO,
+    EXIF_EXPOSURE_MANUAL,
+    EXIF_EXPOSURE_AUTO_BRACKET,
+} CamExifExposureModeType;
+
+typedef enum {
+    EXIF_WB_AUTO,
+    EXIF_WB_MANUAL,
+} CamExifWhiteBalanceType;
+
+/* Values */
+#define EXIF_DEF_MAKER          "SAMSUNG"
+#define EXIF_DEF_MODEL          "SAMSUNG"
+#define EXIF_DEF_SOFTWARE       "SAMSUNG"
+#define EXIF_DEF_EXIF_VERSION   "0220"
+#define EXIF_DEF_USERCOMMENTS   "User comments"
+
+#define EXIF_DEF_YCBCR_POSITIONING  1   /* centered */
+#define EXIF_DEF_FNUMBER_NUM        26  /* 2.6 */
+#define EXIF_DEF_FNUMBER_DEN        10
+#define EXIF_DEF_EXPOSURE_PROGRAM   3   /* aperture priority */
+#define EXIF_DEF_FOCAL_LEN_NUM      278 /* 2.78mm */
+#define EXIF_DEF_FOCAL_LEN_DEN      100
+#define EXIF_DEF_FLASH              0   /* O: off, 1: on*/
+#define EXIF_DEF_COLOR_SPACE        1
+#define EXIF_DEF_EXPOSURE_MODE      EXIF_EXPOSURE_AUTO
+#define EXIF_DEF_APEX_DEN           10
+
+#define EXIF_DEF_COMPRESSION        6
+#define EXIF_DEF_RESOLUTION_NUM     72
+#define EXIF_DEF_RESOLUTION_DEN     1
+#define EXIF_DEF_RESOLUTION_UNIT    2   /* inches */
+
+typedef struct {
+    uint32_t num;
+    uint32_t den;
+} rational_t;
+
+typedef struct {
+    int32_t num;
+    int32_t den;
+} srational_t;
+
+typedef struct {
+    bool enableGps;
+    bool enableThumb;
+
+    unsigned char maker[32];
+    unsigned char model[32];
+    unsigned char software[32];
+    unsigned char exif_version[4];
+    unsigned char date_time[20];
+    unsigned char user_comment[150];
+
+    uint32_t width;
+    uint32_t height;
+    uint32_t widthThumb;
+    uint32_t heightThumb;
+
+    uint16_t orientation;
+    uint16_t ycbcr_positioning;
+    uint16_t exposure_program;
+    uint16_t iso_speed_rating;
+    uint16_t metering_mode;
+    uint16_t flash;
+    uint16_t color_space;
+    uint16_t exposure_mode;
+    uint16_t white_balance;
+    uint16_t scene_capture_type;
+
+    rational_t exposure_time;
+    rational_t fnumber;
+    rational_t aperture;
+    rational_t max_aperture;
+    rational_t focal_length;
+
+    srational_t shutter_speed;
+    srational_t brightness;
+    srational_t exposure_bias;
+
+    unsigned char gps_latitude_ref[2];
+    unsigned char gps_longitude_ref[2];
+
+    uint8_t gps_version_id[4];
+    uint8_t gps_altitude_ref;
+
+    rational_t gps_latitude[3];
+    rational_t gps_longitude[3];
+    rational_t gps_altitude;
+    rational_t gps_timestamp[3];
+    unsigned char gps_datestamp[11];
+    unsigned char gps_processing_method[100];
+
+    rational_t x_resolution;
+    rational_t y_resolution;
+    uint16_t resolution_unit;
+    uint16_t compression_scheme;
+} exif_attribute_t;
+
+#endif /* ANDROID_HARDWARE_EXIF_H */
diff --git a/exynos4/hal/include/SecBuffer.h b/exynos4/hal/include/SecBuffer.h
new file mode 100644
index 0000000..b8a41df
--- /dev/null
+++ b/exynos4/hal/include/SecBuffer.h
@@ -0,0 +1,158 @@
+/*
+ * Copyright@ Samsung Electronics Co. LTD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+/*!
+ * \file      SecBuffer.h
+ * \brief     header file for SecBuffer
+ * \author    Sangwoo, Park(sw5771.park@samsung.com)
+ * \date      2011/06/02
+ *
+ * <b>Revision History: </b>
+ * - 2010/06/03 : Sangwoo, Park(sw5771.park@samsung.com) \n
+ *   Initial version
+ *
+ */
+
+/**
+ * @page SecBuffer
+ *
+ * @section Introduction
+ * SecBuffer is common struct for buffer
+ *
+ * @section Copyright
+ *  Copyright (c) 2008-2011 Samsung Electronics Co., Ltd.All rights reserved. \n
+ *  Proprietary and Confidential
+ *
+ * @image html samsung.png
+ */
+
+#ifndef __SEC_BUFFER_H__
+#define __SEC_BUFFER_H__
+
+#include <sys/types.h>
+
+//! Buffer information
+struct SecBuffer
+{
+public:
+    //! Buffer type
+    enum BUFFER_TYPE
+    {
+        BUFFER_TYPE_BASE     = 0,
+        BUFFER_TYPE_VIRT     = 1,      //!< virtual address
+        BUFFER_TYPE_PHYS     = 1 << 1, //!< physical address
+        BUFFER_TYPE_RESERVED = 1 << 2, //!< reserved type
+        BUFFER_TYPE_MAX,
+    };
+
+    //! Buffer virtual address
+    union {
+        char *p;       //! single address.
+        char *extP[3]; //! Y Cb Cr.
+    } virt;
+
+    //! Buffer physical address
+    union {
+        unsigned int p;       //! single address.
+        unsigned int extP[3]; //! Y Cb Cr.
+    } phys;
+
+    //! Buffer reserved id
+    union {
+        unsigned int p;       //! \n
+        unsigned int extP[3]; //! \n
+    } reserved;
+
+    //! Buffer size
+    union {
+        unsigned int s;
+        unsigned int extS[3];
+    } size;
+
+    //! Constructor
+    SecBuffer()
+    {
+        for (int i = 0; i < 3; i++) {
+            virt.    extP[i] = NULL;
+            phys.    extP[i] = 0;
+            reserved.extP[i] = 0;
+            size.    extS[i] = 0;
+        }
+    }
+
+    //! Constructor
+    SecBuffer(const SecBuffer *other)
+    {
+        for (int i = 0; i < 3; i++) {
+            virt.    extP[i] = other->virt.extP[i];
+            phys.    extP[i] = other->phys.extP[i];
+            reserved.extP[i] = other->reserved.extP[i];
+            size.    extS[i] = other->size.extS[i];
+        }
+    }
+
+    //! Operator(=) override
+    SecBuffer& operator =(const SecBuffer &other)
+    {
+        for (int i = 0; i < 3; i++) {
+            virt.    extP[i] = other.virt.extP[i];
+            phys.    extP[i] = other.phys.extP[i];
+            reserved.extP[i] = other.reserved.extP[i];
+            size.    extS[i] = other.size.extS[i];
+        }
+        return *this;
+    }
+
+    //! Operator(==) override
+    bool operator ==(const SecBuffer &other) const
+    {
+        return (   virt.    extP[0] == other.virt.extP[0]
+                && virt.    extP[1] == other.virt.extP[1]
+                && virt.    extP[2] == other.virt.extP[2]
+                && phys.    extP[0] == other.phys.extP[0]
+                && phys.    extP[1] == other.phys.extP[1]
+                && phys.    extP[2] == other.phys.extP[2]
+                && reserved.extP[0] == other.reserved.extP[0]
+                && reserved.extP[1] == other.reserved.extP[1]
+                && reserved.extP[2] == other.reserved.extP[2]
+                && size.    extS[0] == other.size.extS[0]
+                && size.    extS[1] == other.size.extS[1]
+                && size.    extS[2] == other.size.extS[2]);
+    }
+
+    //! Operator(!=) override
+    bool operator !=(const SecBuffer &other) const
+    {
+        // use operator(==)
+        return !(*this == other);
+    }
+
+    //! Get Buffer type
+    static int BUFFER_TYPE(SecBuffer *buf)
+    {
+        int type = BUFFER_TYPE_BASE;
+        if (buf->virt.p)
+            type |= BUFFER_TYPE_VIRT;
+        if (buf->phys.p)
+            type |= BUFFER_TYPE_PHYS;
+        if (buf->reserved.p)
+            type |= BUFFER_TYPE_RESERVED;
+
+        return type;
+    }
+};
+
+#endif //__SEC_BUFFER_H__
diff --git a/exynos4/hal/include/SecFimc.h b/exynos4/hal/include/SecFimc.h
new file mode 100644
index 0000000..61585c2
--- /dev/null
+++ b/exynos4/hal/include/SecFimc.h
@@ -0,0 +1,190 @@
+/*
+ * Copyright@ Samsung Electronics Co. LTD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*!
+ * \file      SecFimc.h
+ * \brief     header file for Fimc HAL MODULE
+ * \author    Hyunkyung, Kim(hk310.kim@samsung.com)
+ * \date      2010/10/13
+ *
+ * <b>Revision History: </b>
+ * - 2010/10/13 : Hyunkyung, Kim(hk310.kim@samsung.com) \n
+ *   Initial version
+ *
+ * - 2011/11/15 : Sunmi, Lee(carrotsm.lee@samsung.com) \n
+ *   Adjust V4L2 architecture \n
+ */
+
+#ifndef __SEC_FIMC_H__
+#define __SEC_FIMC_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <linux/fb.h>
+
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <asm/sizes.h>
+
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/poll.h>
+#include <sys/mman.h>
+#include <hardware/hardware.h>
+
+#include "utils/Timers.h"
+
+#ifdef BOARD_USE_V4L2
+#include "s5p_fimc_v4l2.h"
+#include "sec_utils_v4l2.h"
+#else
+#include "s5p_fimc.h"
+#include "sec_utils.h"
+#endif
+#include "sec_format.h"
+
+#include "SecBuffer.h"
+#include "SecRect.h"
+
+#define PFX_NODE_FIMC        "/dev/video"
+#define MAX_DST_BUFFERS     (3)
+#define MAX_SRC_BUFFERS     (1)
+#define MAX_PLANES          (3)
+
+#ifdef __cplusplus
+}
+
+class SecFimc
+{
+public:
+    enum DEV {
+        DEV_0 = 0,
+        DEV_1,
+        DEV_2,
+        DEV_3,
+        DEV_MAX,
+    };
+
+    enum MODE {
+        MODE_NONE = 0,
+        MODE_SINGLE_BUF,
+        MODE_MULTI_BUF,
+        MODE_DMA_AUTO,
+        MODE_MAX,
+    };
+
+private:
+    bool                        mFlagCreate;
+    int                         mDev;
+    int                         mFimcMode;
+    int                         mNumOfBuf;
+
+    int                         mRealDev;
+    int                         mFd;
+    int                         mHwVersion;
+    int                         mRotVal;
+    bool                        mFlagGlobalAlpha;
+    int                         mGlobalAlpha;
+    bool                        mFlagLocalAlpha;
+    bool                        mFlagColorKey;
+    int                         mColorKey;
+    bool                        mFlagSetSrcParam;
+    bool                        mFlagSetDstParam;
+    bool                        mFlagStreamOn;
+
+    s5p_fimc_t                  mS5pFimc;
+    struct v4l2_capability      mFimcCap;
+
+    SecBuffer                   mSrcBuffer;
+    SecBuffer                   mDstBuffer[MAX_DST_BUFFERS];
+
+public:
+    SecFimc();
+    virtual ~SecFimc();
+
+    virtual bool create(enum DEV dev, enum MODE mode, int numOfBuf);
+    virtual bool destroy(void);
+    bool flagCreate(void);
+
+    int  getFd(void);
+
+    SecBuffer * getMemAddr(int index = 0);
+
+    int  getHWVersion(void);
+
+    virtual bool setSrcParams(unsigned int width, unsigned int height,
+                      unsigned int cropX, unsigned int cropY,
+                      unsigned int *cropWidth, unsigned int *cropHeight,
+                      int colorFormat,
+                      bool forceChange = true);
+
+    virtual bool getSrcParams(unsigned int *width, unsigned int *height,
+                      unsigned int *cropX, unsigned int *cropY,
+                      unsigned int *cropWidth, unsigned int *cropHeight,
+                      int *colorFormat);
+
+    virtual bool setSrcAddr(unsigned int physYAddr,
+                    unsigned int physCbAddr = 0,
+                    unsigned int physCrAddr = 0,
+                    int colorFormat = 0);
+
+    virtual bool setDstParams(unsigned int width, unsigned int height,
+                      unsigned int cropX, unsigned int cropY,
+                      unsigned int *cropWidth, unsigned int *cropHeight,
+                      int colorFormat,
+                      bool forceChange = true);
+
+    virtual bool getDstParams(unsigned int *width, unsigned int *height,
+                      unsigned int *cropX, unsigned int *cropY,
+                      unsigned int *cropWidth, unsigned int *cropHeight,
+                      int *colorFormat);
+
+    virtual bool setDstAddr(unsigned int physYAddr, unsigned int physCbAddr = 0, unsigned int physCrAddr = 0, int buf_index = 0);
+
+    virtual bool setRotVal(unsigned int rotVal);
+    virtual bool setGlobalAlpha(bool enable = true, int alpha = 0xff);
+    virtual bool setLocalAlpha(bool enable);
+    virtual bool setColorKey(bool enable = true, int colorKey = 0xff);
+
+    virtual bool draw(int src_index, int dst_index);
+
+private:
+    bool m_streamOn(void);
+    bool m_checkSrcSize(unsigned int width, unsigned int height,
+                        unsigned int cropX, unsigned int cropY,
+                        unsigned int *cropWidth, unsigned int *cropHeight,
+                        int colorFormat,
+                        bool forceChange = false);
+
+    bool m_checkDstSize(unsigned int width, unsigned int height,
+                        unsigned int cropX, unsigned int cropY,
+                        unsigned int *cropWidth, unsigned int *cropHeight,
+                        int colorFormat,
+                        int rotVal,
+                        bool forceChange = false);
+    int  m_widthOfFimc(int v4l2ColorFormat, int width);
+    int  m_heightOfFimc(int v4l2ColorFormat, int height);
+    int  m_getYuvBpp(unsigned int fmt);
+    int  m_getYuvPlanes(unsigned int fmt);
+};
+#endif
+
+#endif //__SEC_FIMC_H__
diff --git a/exynos4/hal/include/SecHdmi.h b/exynos4/hal/include/SecHdmi.h
new file mode 100644
index 0000000..67c3378
--- /dev/null
+++ b/exynos4/hal/include/SecHdmi.h
@@ -0,0 +1,220 @@
+/*
+ * Copyright@ Samsung Electronics Co. LTD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**
+** @author Sangwoo, Park(sw5771.park@samsung.com)
+** @date   2010-09-10
+**
+*/
+
+#ifndef __SEC_HDMI_H__
+#define __SEC_HDMI_H__
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <ctype.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <signal.h>
+#include <pthread.h>
+
+#ifdef BOARD_USE_V4L2
+#include "s5p_tvout_v4l2.h"
+#else
+#include "s5p_tvout.h"
+#endif
+#if defined(BOARD_USES_FIMGAPI)
+#include "sec_g2d.h"
+#endif
+#include "s3c_lcd.h"
+#include "SecBuffer.h"
+#include "SecFimc.h"
+
+#include "../libhdmi/libsForhdmi/libedid/libedid.h"
+#include "../libhdmi/libsForhdmi/libcec/libcec.h"
+
+#include "../libhdmi/SecHdmi/SecHdmiCommon.h"
+#include "../libhdmi/SecHdmi/SecHdmiV4L2Utils.h"
+
+#if defined(BOARD_USES_FIMGAPI)
+#include "FimgApi.h"
+#endif
+
+#include <linux/fb.h>
+
+#include <hardware/hardware.h>
+
+#include <utils/threads.h>
+
+
+namespace android {
+
+class SecHdmi: virtual public RefBase
+{
+public :
+    enum HDMI_LAYER {
+        HDMI_LAYER_BASE   = 0,
+        HDMI_LAYER_VIDEO,
+        HDMI_LAYER_GRAPHIC_0,
+        HDMI_LAYER_GRAPHIC_1,
+        HDMI_LAYER_MAX,
+    };
+
+private :
+    class CECThread: public Thread
+    {
+        public:
+            bool                mFlagRunning;
+
+        private:
+            sp<SecHdmi>         mSecHdmi;
+            Mutex               mThreadLoopLock;
+            Mutex               mThreadControlLock;
+            virtual bool        threadLoop();
+            enum CECDeviceType  mDevtype;
+            int                 mLaddr;
+            int                 mPaddr;
+
+        public:
+            CECThread(sp<SecHdmi> secHdmi)
+                :Thread(false),
+                mFlagRunning(false),
+                mSecHdmi(secHdmi),
+                mDevtype(CEC_DEVICE_PLAYER),
+                mLaddr(0),
+                mPaddr(0){
+            };
+            virtual ~CECThread();
+
+            bool start();
+            bool stop();
+
+    };
+
+    Mutex        mLock;
+
+    sp<CECThread>               mCECThread;
+
+    bool         mFlagCreate;
+    bool         mFlagConnected;
+    bool         mFlagLayerEnable[HDMI_LAYER_MAX];
+    bool         mFlagHdmiStart[HDMI_LAYER_MAX];
+
+    int          mSrcWidth[HDMI_LAYER_MAX];
+    int          mSrcHeight[HDMI_LAYER_MAX];
+    int          mSrcColorFormat[HDMI_LAYER_MAX];
+    int          mHdmiResolutionWidth[HDMI_LAYER_MAX];
+    int          mHdmiResolutionHeight[HDMI_LAYER_MAX];
+
+    int          mHdmiDstWidth;
+    int          mHdmiDstHeight;
+
+    unsigned int mHdmiSrcYAddr;
+    unsigned int mHdmiSrcCbCrAddr;
+
+    int          mHdmiOutputMode;
+    unsigned int mHdmiResolutionValue;
+
+    unsigned int mHdmiPresetId;
+    v4l2_std_id  mHdmiStdId;
+    unsigned int mCompositeStd;
+
+    bool         mHdcpMode;
+    int          mAudioMode;
+    unsigned int mUIRotVal;
+    unsigned int mG2DUIRotVal;
+
+    int          mCurrentHdmiOutputMode;
+    unsigned int mCurrentHdmiResolutionValue;
+    bool         mCurrentHdcpMode;
+    int          mCurrentAudioMode;
+    bool         mHdmiInfoChange;
+
+    int          mFimcDstColorFormat;
+
+    SecBuffer    mFimcReservedMem[HDMI_FIMC_OUTPUT_BUF_NUM];
+    unsigned int mFimcCurrentOutBufIndex;
+    SecFimc      mSecFimc;
+
+    unsigned int mHdmiResolutionValueList[14];
+    int          mHdmiSizeOfResolutionValueList;
+
+    SecBuffer    mMixerBuffer[HDMI_LAYER_MAX][MAX_BUFFERS_MIXER];
+
+    void         *mFBaddr;
+    unsigned int mFBsize;
+    int          mFBionfd;
+    int          mHdmiFd[HDMI_LAYER_MAX];
+
+    int          mDstWidth[HDMI_LAYER_MAX];
+    int          mDstHeight[HDMI_LAYER_MAX];
+    int          mPrevDstWidth[HDMI_LAYER_MAX];
+    int          mPrevDstHeight[HDMI_LAYER_MAX];
+
+    int          mDefaultFBFd;
+    int          mDisplayWidth;
+    int          mDisplayHeight;
+
+    struct v4l2_rect mDstRect;
+
+public :
+
+    SecHdmi();
+    virtual ~SecHdmi();
+    bool        create(int width, int height);
+    bool        destroy(void);
+    inline bool flagCreate(void) { return mFlagCreate; }
+
+    bool        connect(void);
+    bool        disconnect(void);
+
+    bool        flagConnected(void);
+
+    bool        flush(int srcW, int srcH, int srcColorFormat,
+                        unsigned int srcYAddr, unsigned int srcCbAddr, unsigned int srcCrAddr,
+                        int dstX, int dstY,
+                        int hdmiLayer,
+                        int num_of_hwc_layer);
+
+	bool        clear(int hdmiLayer);
+
+    bool        setHdmiOutputMode(int hdmiOutputMode, bool forceRun = false);
+    bool        setHdmiResolution(unsigned int hdmiResolutionValue, bool forceRun = false);
+    bool        setHdcpMode(bool hdcpMode, bool forceRun = false);
+    bool        setUIRotation(unsigned int rotVal, unsigned int hwcLayer);
+    bool        setDisplaySize(int width, int height);
+
+private:
+
+    bool        m_reset(int w, int h, int colorFormat, int hdmiLayer, int hwcLayer);
+    bool        m_startHdmi(int hdmiLayer, unsigned int num_of_plane);
+    bool        m_startHdmi(int hdmiLayer);
+    bool        m_stopHdmi(int hdmiLayer);
+    bool        m_setHdmiOutputMode(int hdmiOutputMode);
+    bool        m_setHdmiResolution(unsigned int hdmiResolutionValue);
+    bool        m_setCompositeResolution(unsigned int compositeStdId);
+    bool        m_setHdcpMode(bool hdcpMode);
+    bool        m_setAudioMode(int audioMode);
+
+    int         m_resolutionValueIndex(unsigned int ResolutionValue);
+    bool        m_flagHWConnected(void);
+};
+
+}; // namespace android
+
+#endif //__SEC_HDMI_H__
diff --git a/exynos4/hal/include/SecRect.h b/exynos4/hal/include/SecRect.h
new file mode 100644
index 0000000..1160a0b
--- /dev/null
+++ b/exynos4/hal/include/SecRect.h
@@ -0,0 +1,172 @@
+/*
+ * Copyright@ Samsung Electronics Co. LTD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+/*!
+ * \file      SecRect.h
+ * \brief     header file for SecRect
+ * \author    Sangwoo, Park(sw5771.park@samsung.com)
+ * \date      2011/06/02
+ *
+ * <b>Revision History: </b>
+ * - 2010/06/03 : Sangwoo, Park(sw5771.park@samsung.com) \n
+ *   Initial version
+ *
+ */
+
+/**
+ * @page SecRect
+ *
+ * @section Introduction
+ * SetRect is common struct for rectangle
+ *
+ * @section Copyright
+ *  Copyright (c) 2008-2011 Samsung Electronics Co., Ltd.All rights reserved. \n
+ *  Proprietary and Confidential
+ *
+ * @image html samsung.png
+ */
+
+#ifndef __SEC_RECT_H__
+#define __SEC_RECT_H__
+
+//! Rectangle information
+struct SecRect
+{
+    int x;           //!< x pos
+    int y;           //!< y pos
+    int w;           //!< width
+    int h;           //!< height
+    int fullW;       //!< full width of image
+    int fullH;       //!< full height of image
+    int colorFormat; //!< V4L2_PIX_FMT_XXX
+
+    //! Constructor
+    SecRect(int _x_ = 0,
+            int _y_ = 0,
+            int _w_ = 0,
+            int _h_ = 0,
+            int _fullW_ = 0,
+            int _fullH_ = 0,
+            int _colorFormat_ = 0)
+    {
+        x = _x_;
+        y = _y_;
+        w = _w_;
+        h = _h_;
+        fullW = _fullW_;
+        fullH = _fullH_;
+        colorFormat = _colorFormat_;
+    }
+
+    //! Constructor
+    SecRect(const SecRect *other)
+    {
+        x           = other->x;
+        y           = other->y;
+        w           = other->w;
+        h           = other->h;
+        fullW       = other->fullW;
+        fullH       = other->fullH;
+        colorFormat = other->colorFormat;
+    }
+
+    //! Operator(=) override
+    SecRect& operator =(const SecRect &other)
+    {
+        x           = other.x;
+        y           = other.y;
+        w           = other.w;
+        h           = other.h;
+        fullW       = other.fullW;
+        fullH       = other.fullH;
+        colorFormat = other.colorFormat;
+        return *this;
+    }
+
+    //! Operator(==) override
+    bool operator ==(const SecRect &other) const
+    {
+        return (   x           == other.x
+                && y           == other.y
+                && w           == other.w
+                && h           == other.h
+                && fullW       == other.fullW
+                && fullH       == other.fullH
+                && colorFormat == other.colorFormat);
+    }
+
+    //! Operator(!=) override
+    bool operator !=(const SecRect &other) const
+    {
+        // use operator(==)
+        return !(*this == other);
+    }
+};
+
+//! Clip information
+struct SecRect2
+{
+    int x1; //!< Left   (The x-coordinate value of upper-left corner)
+    int y1; //!< Top    (The y-coordinate value of upper-left corner)
+    int x2; //!< Right  (The x-coordinate value of lower-right corner)
+    int y2; //!< Bottom (The y-coordinate value of lower-right corner)
+
+    //! Constructor
+    SecRect2(int _x1_ = 0, int _y1_ = 0, int _x2_ = 0, int _y2_ = 0)
+    {
+        x1 = _x1_;
+        y1 = _y1_;
+        x2 = _x2_;
+        y2 = _y2_;
+    }
+
+    //! Constructor
+    SecRect2(const SecRect2 *other)
+    {
+        x1 = other->x1;
+        y1 = other->y1;
+        x2 = other->x2;
+        y2 = other->y2;
+    }
+
+    //! Operator(=) override
+    SecRect2& operator =(const SecRect2 &other)
+    {
+        x1 = other.x1;
+        y1 = other.y1;
+        x2 = other.x2;
+        y2 = other.y2;
+        return *this;
+    }
+
+    //! Operator(==) override
+    bool operator ==(const SecRect2 &other) const
+    {
+        return (   x1           == other.x1
+                && y1           == other.y1
+                && x2           == other.x2
+                && y2           == other.y2);
+    }
+
+    //! Operator(!=) override
+    bool operator !=(const SecRect2 &other) const
+    {
+        // use operator(==)
+        return !(*this == other);
+    }
+};
+
+#endif //__SEC_RECT_H__
diff --git a/exynos4/hal/include/audio.h b/exynos4/hal/include/audio.h
new file mode 100644
index 0000000..1275db3
--- /dev/null
+++ b/exynos4/hal/include/audio.h
@@ -0,0 +1,363 @@
+/*
+ * Copyright@ Samsung Electronics Co. LTD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _AUDIO_H_
+#define _AUDIO_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef __HDMI_AUDIO_HDMIAUDIOPORT__
+#define __HDMI_AUDIO_HDMIAUDIOPORT__
+/**
+ * @enum HDMIAudioPort
+ * Available audio inputs on HDMI HW module.
+ */
+enum HDMIAudioPort {
+    /** I2S input port */
+    I2S_PORT,
+    /** SPDIF input port */
+    SPDIF_PORT,
+    /** DSD input port */
+    DSD_PORT,
+};
+#endif /* __HDMI_AUDIO_HDMIAUDIOPORT__ */
+
+#ifndef __HDMI_AUDIO_AUDIOFORMAT__
+#define __HDMI_AUDIO_AUDIOFORMAT__
+/**
+ * @enum AudioFormat
+ * The encoding format of audio stream
+ */
+enum AudioFormat {
+    /** LPCM encoding format */
+    LPCM_FORMAT = 1,
+    /** AC3 encoding format */
+    AC3_FORMAT,
+    /** MPEG1 encoding format */
+    MPEG1_FORMAT,
+    /** MP3 encoding format */
+    MP3_FORMAT,
+    /** MPEG2 encoding format */
+    MPEG2_FORMAT,
+    /** AAC encoding format */
+    AAC_FORMAT,
+    /** DTS encoding format */
+    DTS_FORMAT,
+    /** ATRAC encoding format */
+    ATRAC_FORMAT,
+    /** DSD encoding format */
+    DSD_FORMAT,
+    /** Dolby Digital+ encoding format */
+    Dolby_Digital_Plus_FORMAT,
+    /** DTS HD encoding format */
+    DTS_HD_FORMAT,
+    /** MAT encoding format */
+    MAT_FORMAT,
+    /** DST encoding format */
+    DST_FORMAT,
+    /** WAM_Pro encoding format */
+    WAM_Pro_FORMAT
+};
+#endif /* __HDMI_AUDIO_AUDIOFORMAT__ */
+
+#ifndef __HDMI_AUDIO_LPCMWORDLENGTH__
+#define __HDMI_AUDIO_LPCMWORDLENGTH__
+/**
+ * @enum LPCM_WordLen
+ * Word length of LPCM audio stream.
+ */
+enum LPCM_WordLen {
+    /** 16bit word length */
+    WORD_16 = 0,
+    /** 17bit word length */
+    WORD_17,
+    /** 18bit word length */
+    WORD_18,
+    /** 19bit word length */
+    WORD_19,
+    /** 20bit word length */
+    WORD_20,
+    /** 21bit word length */
+    WORD_21,
+    /** 22bit word length */
+    WORD_22,
+    /** 23bit word length */
+    WORD_23,
+    /** 24bit word length */
+    WORD_24
+};
+#endif /* __HDMI_AUDIO_LPCMWORDLENGTH__ */
+
+#ifndef __HDMI_AUDIO_SAMPLINGFREQUENCY__
+#define __HDMI_AUDIO_SAMPLINGFREQUENCY__
+/**
+ * @enum SamplingFreq
+ * Sampling frequency of audio stream.
+ */
+enum SamplingFreq {
+    /** 32KHz sampling frequency */
+    SF_32KHZ = 0,
+    /** 44.1KHz sampling frequency */
+    SF_44KHZ,
+    /** 48KHz sampling frequency */
+    SF_48KHZ,
+    /** 88.2KHz sampling frequency */
+    SF_88KHZ,
+    /** 96KHz sampling frequency */
+    SF_96KHZ,
+    /** 176.4KHz sampling frequency */
+    SF_176KHZ,
+    /** 192KHz sampling frequency */
+    SF_192KHZ
+};
+#endif /* __HDMI_AUDIO_SAMPLINGFREQUENCY__ */
+
+#ifndef __HDMI_AUDIO_CHANNELNUMBER__
+#define __HDMI_AUDIO_CHANNELNUMBER__
+/**
+ * @enum ChannelNum
+ * Channel number of audio stream.
+ */
+enum ChannelNum {
+    /** 2 channel audio stream */
+    CH_2 = 2,
+    /** 3 channel audio stream */
+    CH_3,
+    /** 4 channel audio stream */
+    CH_4,
+    /** 5 channel audio stream */
+    CH_5,
+    /** 6 channel audio stream */
+    CH_6,
+    /** 7 channel audio stream */
+    CH_7,
+    /** 8 channel audio stream */
+    CH_8,
+};
+#endif /* __HDMI_AUDIO_CHANNELNUMBER__ */
+
+#ifndef __HDMI_AUDIO_AUDIOSAMPLEPACKETTYPE__
+#define __HDMI_AUDIO_AUDIOSAMPLEPACKETTYPE__
+/**
+ * @enum HDMIASPType
+ * Type of HDMI audio sample packet
+ */
+enum HDMIASPType {
+    /** Audio Sample Packet Type */
+    HDMI_ASP,
+    /** One Bit Audio Packet Type */
+    HDMI_DSD,
+    /** High Bit Rate Packet Type */
+    HDMI_HBR,
+    /** DST Packet Type */
+    HDMI_DST
+};
+#endif /* __HDMI_AUDID_AUDIOSAMPLEPACKETTYPE__ */
+
+#ifndef __HDMI_AUDIO_I2S_CUV_AUDIO_CODING_TYPE__
+#define __HDMI_AUDIO_I2S_CUV_AUDIO_CODING_TYPE__
+/**
+ * @enum CUVAudioCoding
+ * Audio coding type information for CUV fields.
+ */
+enum CUVAudioCoding {
+    /** Linear PCM coding type */
+    CUV_LPCM,
+    /** Non-linear PCM coding type */
+    CUV_NLPCM
+};
+#endif /* __HDMI_AUDIO_I2S_CUV_AUDIO_CODING_TYPE__ */
+
+#ifndef __HDMI_AUDIO_SPDIF_AUDIO_CODING_TYPE__
+#define __HDMI_AUDIO_SPDIF_AUDIO_CODING_TYPE__
+/**
+ * @enum SPDIFAudioCoding
+ * Audio coding type information for SPDIF input port.
+ */
+enum SPDIFAudioCoding {
+    /** Linear PCM coding type */
+    SPDIF_LPCM,
+    /** Non-linear PCM coding type */
+    SPDIF_NLPCM
+};
+#endif /* __HDMI_AUDIO_SPDIF_AUDIO_CODING_TYPE__ */
+
+#ifndef __HDMI_AUDIO_I2S_CUV_CHANNEL_NUMBER__
+#define __HDMI_AUDIO_I2S_CUV_CHANNEL_NUMBER__
+/**
+ * @enum CUVChannelNumber
+ * Channel number information for CUV fields.
+ */
+enum CUVChannelNumber {
+    /** Unknown channel audio stream */
+    CUV_CH_UNDEFINED = 0,
+    /** 1 channel audio stream */
+    CUV_CH_01,
+    /** 2 channel audio stream */
+    CUV_CH_02,
+    /** 3 channel audio stream */
+    CUV_CH_03,
+    /** 4 channel audio stream */
+    CUV_CH_04,
+    /** 5 channel audio stream */
+    CUV_CH_05,
+    /** 6 channel audio stream */
+    CUV_CH_06,
+    /** 7 channel audio stream */
+    CUV_CH_07,
+    /** 8 channel audio stream */
+    CUV_CH_08,
+    /** 9 channel audio stream */
+    CUV_CH_09,
+    /** 10 channel audio stream */
+    CUV_CH_10,
+    /** 11 channel audio stream */
+    CUV_CH_11,
+    /** 12 channel audio stream */
+    CUV_CH_12,
+    /** 13 channel audio stream */
+    CUV_CH_13,
+    /** 14 channel audio stream */
+    CUV_CH_14,
+    /** 15 channel audio stream */
+    CUV_CH_15,
+};
+#endif /* __HDMI_AUDIO_I2S_CUV_CHANNEL_NUMBER__ */
+
+#ifndef __HDMI_AUDIO_I2S_CUV_WORD_LENGTH__
+#define __HDMI_AUDIO_I2S_CUV_WORD_LENGTH__
+/**
+ * @enum CUVWordLength
+ * Word length information of LPCM audio stream for CUV fields.
+ */
+enum CUVWordLength {
+    /** Max word length is 20 bits, number of valid bits is not defined */
+    CUV_WL_20_NOT_DEFINED,
+    /** Max word length is 20 bits, 16 bits are valid */
+    CUV_WL_20_16,
+    /** Max word length is 20 bits, 18 bits are valid */
+    CUV_WL_20_18,
+    /** Max word length is 20 bits, 19 bits are valid */
+    CUV_WL_20_19,
+    /** Max word length is 20 bits, 20 bits are valid */
+    CUV_WL_20_20,
+    /** Max word length is 20 bits, 17 bits are valid */
+    CUV_WL_20_17,
+    /** Max word length is 24 bits, number of valid bits is not defined */
+    CUV_WL_24_NOT_DEFINED,
+    /** Max word length is 24 bits, 20 bits are valid */
+    CUV_WL_24_20,
+    /** Max word length is 24 bits, 22 bits are valid */
+    CUV_WL_24_22,
+    /** Max word length is 24 bits, 23 bits are valid */
+    CUV_WL_24_23,
+    /** Max word length is 24 bits, 24 bits are valid */
+    CUV_WL_24_24,
+    /** Max word length is 24 bits, 21 bits are valid */
+    CUV_WL_24_21,
+};
+#endif /* __HDMI_AUDIO_I2S_CUV_WORD_LENGTH__ */
+
+#ifndef __HDMI_AUDIO_I2S_BITS_PER_CHANNEL__
+#define __HDMI_AUDIO_I2S_BITS_PER_CHANNEL__
+
+/**
+ * @enum I2SBitsPerChannel
+ * Serial data bit per channel in I2S audio stream.
+ */
+enum I2SBitsPerChannel {
+    /** 16 bits per channel */
+    I2S_BPC_16,
+    /** 20 bits per channel */
+    I2S_BPC_20,
+    /** 24 bits per channel */
+    I2S_BPC_24
+};
+
+#endif /* __HDMI_AUDIO_I2S_BITS_PER_CHANNEL__ */
+
+#ifndef __HDMI_AUDIO_I2S_DATA_FORMAT__
+#define __HDMI_AUDIO_I2S_DATA_FORMAT__
+
+/**
+ * @enum I2SDataFormat
+ * Foramt of data in I2S audio stream.
+ */
+enum I2SDataFormat {
+    /** Basic format */
+    I2S_BASIC,
+    /** Left justified format */
+    I2S_LEFT_JUSTIFIED,
+    /** Right justified format */
+    I2S_RIGHT_JUSTIFIED
+};
+
+#endif /* __HDMI_AUDIO_I2S_DATA_FORMAT__ */
+
+#ifndef __HDMI_AUDIO_I2S_CLOCK_PER_FRAME__
+#define __HDMI_AUDIO_I2S_CLOCK_PER_FRAME__
+
+/**
+ * @enum I2SClockPerFrame
+ * Bit clock per Frame in I2S audio stream.
+ */
+enum I2SClockPerFrame {
+    /** 32 clock per Frame */
+    I2S_32FS,
+    /** 48 clock per Frame */
+    I2S_48FS,
+    /** 64 clock per Frame */
+    I2S_64FS
+};
+
+#endif /* __HDMI_AUDIO_I2S_CLOCK_PER_FRAME__ */
+
+#ifndef __HDMI_AUDIO_I2S_PARAMETER__
+#define __HDMI_AUDIO_I2S_PARAMETER__
+
+//! Structure for I2S audio stream
+struct I2SParameter {
+    enum I2SBitsPerChannel bpc;
+    enum I2SDataFormat format;
+    enum I2SClockPerFrame clk;
+};
+#endif /* __HDMI_AUDIO_I2S_PARAMETER__ */
+
+//! Structure for HDMI audio input
+struct HDMIAudioParameter {
+    /** Input audio port to HDMI HW */
+    enum HDMIAudioPort inputPort;
+    /** Output Packet type **/
+    enum HDMIASPType outPacket;
+    /** Encoding format */
+    enum AudioFormat formatCode;
+    /** Channel number */
+    enum ChannelNum channelNum;
+    /** Sampling frequency */
+    enum SamplingFreq sampleFreq;
+    /** Word length. This is avaliable only if LPCM encoding format */
+    enum LPCM_WordLen wordLength;
+    /** structure for I2S audio stream */
+    struct I2SParameter i2sParam;
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _AUDIO_H_
diff --git a/exynos4/hal/include/exynos_mem.h b/exynos4/hal/include/exynos_mem.h
new file mode 100644
index 0000000..a65f030
--- /dev/null
+++ b/exynos4/hal/include/exynos_mem.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef __INCLUDE_EXYNOS_MEM_H
+#define __INCLUDE_EXYNOS_MEM_H __FILE__
+
+/* IOCTL commands */
+#define EXYNOS_MEM_SET_CACHEABLE	_IOW('M', 200, bool)
+#define EXYNOS_MEM_PADDR_CACHE_FLUSH	_IOW('M', 201, struct exynos_mem_flush_range)
+
+struct exynos_mem_flush_range {
+	dma_addr_t	start;
+	size_t		length;
+};
+
+#endif /* __INCLUDE_EXYNOS_MEM_H */
diff --git a/exynos4/hal/include/gralloc_priv.h b/exynos4/hal/include/gralloc_priv.h
new file mode 100644
index 0000000..9f3346a
--- /dev/null
+++ b/exynos4/hal/include/gralloc_priv.h
@@ -0,0 +1,172 @@
+/*
+ * Copyright (C) 2010 ARM Limited. All rights reserved.
+ *
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef GRALLOC_PRIV_H_
+#define GRALLOC_PRIV_H_
+
+#include <stdint.h>
+#include <pthread.h>
+#include <errno.h>
+#include <linux/fb.h>
+
+#include <hardware/gralloc.h>
+#include <cutils/native_handle.h>
+
+#include <ump/ump.h>
+
+#define GRALLOC_ARM_UMP_MODULE 1
+
+struct private_handle_t;
+
+struct private_module_t
+{
+	gralloc_module_t base;
+
+	private_handle_t* framebuffer;
+	uint32_t flags;
+	uint32_t numBuffers;
+	uint32_t bufferMask;
+	pthread_mutex_t lock;
+	buffer_handle_t currentBuffer;
+
+	struct fb_var_screeninfo info;
+	struct fb_fix_screeninfo finfo;
+	float xdpi;
+	float ydpi;
+	float fps;
+
+	enum
+	{
+		// flag to indicate we'll post this buffer
+		PRIV_USAGE_LOCKED_FOR_POST = 0x80000000
+	};
+};
+
+#ifdef __cplusplus
+struct private_handle_t : public native_handle
+{
+#else
+struct private_handle_t
+{
+	struct native_handle nativeHandle;
+#endif
+
+	enum
+	{
+		PRIV_FLAGS_FRAMEBUFFER = 0x00000001,
+		PRIV_FLAGS_USES_UMP    = 0x00000002,
+	};
+
+	enum
+	{
+		LOCK_STATE_WRITE     =   1<<31,
+		LOCK_STATE_MAPPED    =   1<<30,
+		LOCK_STATE_READ_MASK =   0x3FFFFFFF
+	};
+
+	// ints
+	int     magic;
+	int     flags;
+	int     size;
+	int     base;
+	int     lockState;
+	int     writeOwner;
+	int     pid;
+
+    // Following members are for UMP memory only
+	int     ump_id;
+	int     ump_mem_handle;
+
+	// Following members is for framebuffer only
+	int     fd;
+	int     offset;
+
+
+#ifdef __cplusplus
+	static const int sNumInts = 11;
+	static const int sNumFds = 0;
+	static const int sMagic = 0x3141592;
+
+	private_handle_t(int flags, int size, int base, int lock_state, ump_secure_id secure_id, ump_handle handle):
+		magic(sMagic),
+		flags(flags),
+		size(size),
+		base(base),
+		lockState(lock_state),
+		writeOwner(0),
+		pid(getpid()),
+		ump_id((int)secure_id),
+		ump_mem_handle((int)handle),
+		fd(0),
+		offset(0)
+	{
+		version = sizeof(native_handle);
+		numFds = sNumFds;
+		numInts = sNumInts;
+	}
+
+	private_handle_t(int flags, int size, int base, int lock_state, int fb_file, int fb_offset):
+		magic(sMagic),
+		flags(flags),
+		size(size),
+		base(base),
+		lockState(lock_state),
+		writeOwner(0),
+		pid(getpid()),
+		ump_id((int)UMP_INVALID_SECURE_ID),
+		ump_mem_handle((int)UMP_INVALID_MEMORY_HANDLE),
+		fd(fb_file),
+		offset(fb_offset)
+	{
+		version = sizeof(native_handle);
+		numFds = sNumFds;
+		numInts = sNumInts;
+	}
+
+	~private_handle_t()
+	{
+		magic = 0;
+	}
+
+	bool usesPhysicallyContiguousMemory()
+	{
+		return (flags & PRIV_FLAGS_FRAMEBUFFER) ? true : false;
+	}
+
+	static int validate(const native_handle* h)
+	{
+		const private_handle_t* hnd = (const private_handle_t*)h;
+		if (!h || h->version != sizeof(native_handle) || h->numInts != sNumInts || h->numFds != sNumFds || hnd->magic != sMagic)
+		{
+			return -EINVAL;
+		}
+		return 0;
+	}
+
+	static private_handle_t* dynamicCast(const native_handle* in)
+	{
+		if (validate(in) == 0)
+		{
+			return (private_handle_t*) in;
+		}
+		return NULL;
+	}
+#endif
+};
+
+#endif /* GRALLOC_PRIV_H_ */
diff --git a/exynos4/hal/include/i2c-dev.h b/exynos4/hal/include/i2c-dev.h
new file mode 100644
index 0000000..a7a35a7
--- /dev/null
+++ b/exynos4/hal/include/i2c-dev.h
@@ -0,0 +1,74 @@
+/*
+    i2c-dev.h - i2c-bus driver, char device interface
+
+    Copyright (C) 1995-97 Simon G. Vogl
+    Copyright (C) 1998-99 Frodo Looijaard <frodol@dds.nl>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef _LINUX_I2C_DEV_H
+#define _LINUX_I2C_DEV_H
+
+#include <linux/types.h>
+#include <linux/compiler.h>
+
+/* /dev/i2c-X ioctl commands.  The ioctl's parameter is always an
+ * unsigned long, except for:
+ *  - I2C_FUNCS, takes pointer to an unsigned long
+ *  - I2C_RDWR, takes pointer to struct i2c_rdwr_ioctl_data
+ *  - I2C_SMBUS, takes pointer to struct i2c_smbus_ioctl_data
+ */
+#define I2C_RETRIES 0x0701  /* number of times a device address should
+                   be polled when not acknowledging */
+#define I2C_TIMEOUT 0x0702  /* set timeout in units of 10 ms */
+
+/* NOTE: Slave address is 7 or 10 bits, but 10-bit addresses
+ * are NOT supported! (due to code brokenness)
+ */
+#define I2C_SLAVE   0x0703  /* Use this slave address */
+#define I2C_SLAVE_FORCE 0x0706  /* Use this slave address, even if it
+                   is already in use by a driver! */
+#define I2C_TENBIT  0x0704  /* 0 for 7 bit addrs, != 0 for 10 bit */
+
+#define I2C_FUNCS   0x0705  /* Get the adapter functionality mask */
+
+#define I2C_RDWR    0x0707  /* Combined R/W transfer (one STOP only) */
+
+#define I2C_PEC     0x0708  /* != 0 to use PEC with SMBus */
+#define I2C_SMBUS   0x0720  /* SMBus transfer */
+
+
+/* This is the structure as used in the I2C_SMBUS ioctl call */
+struct i2c_smbus_ioctl_data {
+    __u8 read_write;
+    __u8 command;
+    __u32 size;
+    union i2c_smbus_data __user *data;
+};
+
+/* This is the structure as used in the I2C_RDWR ioctl call */
+struct i2c_rdwr_ioctl_data {
+    struct i2c_msg __user *msgs;    /* pointers to i2c_msgs */
+    __u32 nmsgs;            /* number of i2c_msgs */
+};
+
+#define  I2C_RDRW_IOCTL_MAX_MSGS    42
+
+#ifdef __KERNEL__
+#define I2C_MAJOR   89      /* Device major number      */
+#endif
+
+#endif /* _LINUX_I2C_DEV_H */
diff --git a/exynos4/hal/include/ion.h b/exynos4/hal/include/ion.h
new file mode 100644
index 0000000..dbb8896
--- /dev/null
+++ b/exynos4/hal/include/ion.h
@@ -0,0 +1,144 @@
+#ifndef _LIB_ION_H_
+#define _LIB_ION_H_
+
+#include <unistd.h> /* size_t */
+
+#define ION_HEAP_SYSTEM_MASK		(1 << 0)
+#define ION_HEAP_SYSTEM_CONTIG_MASK	(1 << 1)
+#define ION_HEAP_EXYNOS_MASK		(1 << 4)
+#define ION_HEAP_EXYNOS_CONTIG_MASK	(1 << 5)
+
+/* ION_MSYNC_FLAGS
+ * values of @flags parameter to ion_msync()
+ *
+ * IMSYNC_DEV_TO_READ: Device only reads the buffer
+ * IMSYNC_DEV_TO_WRITE: Device may writes to the buffer
+ * IMSYNC_DEV_TO_RW: Device reads and writes to the buffer
+ *
+ * IMSYNC_SYNC_FOR_DEV: ion_msync() for device to access the buffer
+ * IMSYNC_SYNC_FOR_CPU: ion_msync() for CPU to access the buffer after device
+ *                      has accessed it.
+ *
+ * The values must be ORed with one of IMSYNC_DEV_* and one of IMSYNC_SYNC_*.
+ * Otherwise, ion_msync() will not effect.
+ */
+enum ION_MSYNC_FLAGS {
+	IMSYNC_DEV_TO_READ = 0,
+	IMSYNC_DEV_TO_WRITE = 1,
+	IMSYNC_DEV_TO_RW = 2,
+	IMSYNC_SYNC_FOR_DEV = 0x10000,
+	IMSYNC_SYNC_FOR_CPU = 0x20000,
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ion_client
+ * An ION client is an object or an entity that needs to use the service of
+ * ION and has unique address space. ion_client is an identifier of an ION
+ * client and it represents the ION client.
+ * All operations on ION needs a valid ion_client value and it can be obtained
+ * by ion_client_create().
+ */
+typedef int ion_client;
+
+/* ion_buffer
+ * An identifier of a buffer allocated from ION. You must obtain to access
+ * a buffer allocated from ION. If you have an effective ion_buffer, you have
+ * three options to work with it.
+ * - To access  the buffer, you can request an address (user virtual address)
+ *   of the buffer with ion_map().
+ * - To pass the buffer to the kernel, you can pass the ion_buffer to the
+ *   kernel driver directly, if the kernel driver can work with ION.
+ * - To pass the buffer to other processes, you can pass the ion_buffer to
+ *   other processes through RPC machanism such as socket communication or
+ *   Android Binder because ion_buffer is actually an open file descripotor
+ *   of the current process.
+ */
+typedef int ion_buffer;
+
+/* ion_client_create()
+ * @RETURN: new ion_client.
+ *          netative value if creating new ion_client is failed.
+ *
+ * A call to ion_client_create() must be paired with ion_client_destroy(),
+ * symmetrically. ion_client_destroy() needs a valid ion_client that
+ * is returned by ion_client_create().
+ */
+ion_client ion_client_create(void);
+
+/* ion_client_destroy()
+ * @client: An ion_client value to remove.
+ */
+void ion_client_destroy(ion_client client);
+
+/* ion_alloc() - Allocates new buffer from ION.
+ * @client: A valid ion_client value returned by ion_client_create().
+ * @len: Size of a buffer required in bytes.
+ * @align: Alignment requirements of @len and the start address of the allocated
+ *         buffer. If the @len is not aligned by @align, ION allocates a buffer
+ *         that is aligned by @align and the size of the buffer will be larger
+ *         than @len.
+ * @flags: Additional requirements about buffer. ION_HEAP_SYSTEM_CONTIG_MASK
+ *         for allocating physically contiguous buffer and ION_HEAP_SYSTEM_MASK
+ *         for virtually contiguous buffer. You can combine those flags or
+ *         simply give -1(0xFFFFFFFF) if you do not care about the contiguouty
+ *         of the buffer.
+ * @RETURN: An ion_buffer that represents the buffer allocated. It is only
+ *          unique in the context of the given client, @client.
+ *          -error if the allocation failed.
+ *          See the description of ion_buffer above for detailed information.
+ */
+ion_buffer ion_alloc(ion_client client, size_t len, size_t align,
+		     unsigned int flags);
+
+/* ion_free() - Frees an existing buffer that is allocated by ION
+ * @buffer: An ion_buffer of the buffer to be released.
+ */
+void ion_free(ion_buffer buffer);
+
+/* ion_map() - Obtains a virtual address of the buffer identied by @buffer
+ * @buffer: The buffer to map. The virtual address returned is allocated by the
+ *          kernel.
+ * @len: The size of the buffer to map. This must not exceed the size of the
+ *       buffer represented by @fd_buf. Thus you need to know the size of it
+ *       before calling this function. If @len is less than the size of the
+ *       buffer, this function just map just the size requested (@len) not the
+ *       entire buffer.
+ * @offset: How many pages will be ignored while mapping.@offset number of
+ *       pages from the start of the buffer will not be mapped.
+ * @RETURN: The start virtual addres mapped.
+ *          MAP_FAILED if mapping fails.
+ *
+ * Note that @len + (@offset * PAGE_SIZE) must not exceed the size of the
+ * buffer.
+ */
+void *ion_map(ion_buffer buffer, size_t len, off_t offset);
+
+/* ion_unmap() - Frees the buffer mapped by ion_map()
+ * @addr: The address returned by ion_map().
+ * @len: The size of the buffer mapped by ion_map().
+ * @RETURN: 0 on success, and -1 on failure.
+ *          errno is also set on failure.
+ */
+int ion_unmap(void *addr, size_t len);
+
+/* ion_msync() - Makes sure that data in the buffer are visible to H/W peri.
+ * @client: A valid ion_client value returned by ion_client_create().
+ * @buffer: The buffer to perform ion_msync().
+ * @flags: Direction of access of H/W peri and CPU. See the description of
+ *         ION_MSYNC_FLAGS.
+ * @size: Size to ion_msync() in bytes.
+ * @offset: Where ion_msync() start in @buffer, size in bytes.
+ * @RETURN: 0 if successful. -error, otherwise.
+ *
+ * Note that @offset + @size must not exceed the size of @buffer.
+ */
+int ion_msync(ion_client client, ion_buffer buffer, long flags,
+		size_t size, off_t offset);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _LIB_ION_H_ */
diff --git a/exynos4/hal/include/jpeg_api.h b/exynos4/hal/include/jpeg_api.h
new file mode 100644
index 0000000..f2685e1
--- /dev/null
+++ b/exynos4/hal/include/jpeg_api.h
@@ -0,0 +1,121 @@
+#ifndef __JPEG_API_H__
+#define __JPEG_API_H__
+
+#define JPEG_DRIVER_NAME        "/dev/s5p-jpeg"
+
+#define MAX_JPEG_WIDTH          3264
+#define MAX_JPEG_HEIGHT         2448
+
+#define MAX_JPEG_RES            (MAX_JPEG_WIDTH * MAX_JPEG_HEIGHT)
+
+#define JPEG_STREAM_BUF_SIZE    MAX_JPEG_RES
+#define JPEG_FRAME_BUF_SIZE     (MAX_JPEG_RES * 3)
+
+#define JPEG_TOTAL_BUF_SIZE     (JPEG_STREAM_BUF_SIZE + JPEG_FRAME_BUF_SIZE)
+
+#define JPEG_IOCTL_MAGIC    'J'
+
+#define IOCTL_JPEG_DEC_EXE              _IO(JPEG_IOCTL_MAGIC, 1)
+#define IOCTL_JPEG_ENC_EXE              _IO(JPEG_IOCTL_MAGIC, 2)
+#define IOCTL_GET_DEC_IN_BUF            _IO(JPEG_IOCTL_MAGIC, 3)
+#define IOCTL_GET_DEC_OUT_BUF           _IO(JPEG_IOCTL_MAGIC, 4)
+#define IOCTL_GET_ENC_IN_BUF            _IO(JPEG_IOCTL_MAGIC, 5)
+#define IOCTL_GET_ENC_OUT_BUF           _IO(JPEG_IOCTL_MAGIC, 6)
+#define IOCTL_SET_DEC_PARAM             _IO(JPEG_IOCTL_MAGIC, 7)
+#define IOCTL_SET_ENC_PARAM             _IO(JPEG_IOCTL_MAGIC, 8)
+
+enum jpeg_ret_type{
+    JPEG_FAIL,
+    JPEG_OK,
+    JPEG_ENCODE_FAIL,
+    JPEG_ENCODE_OK,
+    JPEG_DECODE_FAIL,
+    JPEG_DECODE_OK,
+    JPEG_OUT_OF_MEMORY,
+    JPEG_UNKNOWN_ERROR
+};
+
+enum jpeg_img_quality_level {
+    QUALITY_LEVEL_1 = 0,     /* high */
+    QUALITY_LEVEL_2,
+    QUALITY_LEVEL_3,
+    QUALITY_LEVEL_4,         /* low */
+};
+
+/* raw data image format */
+enum jpeg_frame_format {
+    YUV_422,    /* decode output, encode input */
+    YUV_420,    /* decode output, encode output */
+    RGB_565,    /* encode input */
+};
+
+/* jpeg data format */
+enum jpeg_stream_format {
+    JPEG_422,    /* decode input, encode output */
+    JPEG_420,    /* decode input, encode output */
+    JPEG_444,    /* decode input*/
+    JPEG_GRAY,    /* decode input*/
+    JPEG_RESERVED,
+};
+
+enum jpeg_test_mode {
+    encode_mode,
+    decode_mode,
+};
+
+struct jpeg_dec_param {
+    unsigned int width;
+    unsigned int height;
+    unsigned int size;
+    enum jpeg_stream_format in_fmt;
+    enum jpeg_frame_format out_fmt;
+};
+
+struct jpeg_enc_param {
+    unsigned int width;
+    unsigned int height;
+    unsigned int size;
+    enum jpeg_frame_format in_fmt;
+    enum jpeg_stream_format out_fmt;
+    enum jpeg_img_quality_level quality;
+};
+
+struct jpeg_args{
+    char                     *in_buf;
+    unsigned int             in_cookie;
+    unsigned int             in_buf_size;
+    char                     *out_buf;
+    unsigned int             out_cookie;
+    unsigned int             out_buf_size;
+    char                     *mmapped_addr;
+    struct jpeg_dec_param    *dec_param;
+    struct jpeg_enc_param    *enc_param;
+};
+
+struct jpeg_lib {
+    int  jpeg_fd;
+    struct jpeg_args args;
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+int api_jpeg_decode_init();
+int api_jpeg_encode_init();
+int api_jpeg_decode_deinit(int dev_fd);
+int api_jpeg_encode_deinit(int dev_fd);
+void *api_jpeg_get_decode_in_buf(int dev_fd, unsigned int size);
+void *api_jpeg_get_encode_in_buf(int dev_fd, unsigned int size);
+void *api_jpeg_get_decode_out_buf(int dev_fd);
+void *api_jpeg_get_encode_out_buf(int dev_fd);
+void api_jpeg_set_decode_param(struct jpeg_dec_param *param);
+void api_jpeg_set_encode_param(struct jpeg_enc_param *param);
+enum jpeg_ret_type api_jpeg_decode_exe(int dev_fd,
+                    struct jpeg_dec_param *dec_param);
+enum jpeg_ret_type api_jpeg_encode_exe(int dev_fd,
+                    struct jpeg_enc_param *enc_param);
+#ifdef __cplusplus
+}
+#endif
+
+#endif//__JPEG_API_H__
diff --git a/exynos4/hal/include/jpeg_hal.h b/exynos4/hal/include/jpeg_hal.h
new file mode 100644
index 0000000..5c55592
--- /dev/null
+++ b/exynos4/hal/include/jpeg_hal.h
@@ -0,0 +1,137 @@
+/*
+ * Copyright@ Samsung Electronics Co. LTD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "videodev2.h"
+
+#define JPEG_DEC_NODE        "/dev/video11"
+#define JPEG_ENC_NODE        "/dev/video12"
+
+#define JPEG_MAX_PLANE_CNT          3
+#define JPEG_DEC_OUT_BYTE_ALIGN     8
+
+//#define JPEG_PERF_MEAS
+
+#ifdef JPEG_PERF_MEAS
+#define JPEG_PERF_DEFINE(n) \
+    struct timeval time_start_##n, time_stop_##n; unsigned long log_time_##n = 0;
+
+#define JPEG_PERF_START(n) \
+    gettimeofday(&time_start_##n, NULL);
+
+#define JPEG_PERF_END(n) \
+    gettimeofday(&time_stop_##n, NULL); log_time_##n = measure_time(&time_start_##n, &time_stop_##n);
+
+#define JPEG_PERF(n) \
+    log_time_##n
+#else
+#define JPEG_PERF_DEFINE(n)
+#define JPEG_PERF_START(n)
+#define JPEG_PERF_END(n)
+#define JPEG_PERF(n)
+#endif
+
+enum jpeg_ret_type {
+    JPEG_FAIL,
+    JPEG_OK,
+    JPEG_ENCODE_FAIL,
+    JPEG_ENCODE_OK,
+    JPEG_DECODE_FAIL,
+    JPEG_DECODE_OK,
+    JPEG_OUT_OF_MEMORY,
+    JPEG_UNKNOWN_ERROR
+};
+
+enum jpeg_quality_level {
+    QUALITY_LEVEL_1 = 0,    /* high */
+    QUALITY_LEVEL_2,
+    QUALITY_LEVEL_3,
+    QUALITY_LEVEL_4,        /* low */
+};
+
+enum jpeg_mode {
+    JPEG_ENCODE,
+    JPEG_DECODE
+};
+
+struct jpeg_buf {
+    int     num_planes;
+    void    *start[JPEG_MAX_PLANE_CNT];
+    int     length[JPEG_MAX_PLANE_CNT];
+    enum    v4l2_memory    memory;
+    enum    v4l2_buf_type  buf_type;    // Caller need not set this
+};
+
+struct jpeg_buf_info {
+    int                 num_planes;
+    enum v4l2_memory    memory;
+    enum v4l2_buf_type  buf_type;
+    int                 reserved[4];
+};
+
+struct jpeg_pixfmt {
+    int in_fmt;
+    int out_fmt;
+    int reserved[4];
+};
+
+struct jpeg_config {
+    enum jpeg_mode              mode;
+    enum jpeg_quality_level     enc_qual; // for encoding
+
+    int                         width;
+    int                         height;
+
+    int                         num_planes;
+
+    int                         scaled_width; // 1/2, 1/4 scaling for decoding
+    int                         scaled_height; // 1/2, 1/4 scaling for decoding
+
+    int                         sizeJpeg;
+
+    union {
+        struct jpeg_pixfmt enc_fmt;
+        struct jpeg_pixfmt dec_fmt;
+    } pix;
+
+    int                         reserved[8];
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+int jpeghal_dec_init();
+int jpeghal_enc_init();
+
+int jpeghal_dec_setconfig(int fd, struct jpeg_config *config);
+int jpeghal_enc_setconfig(int fd, struct jpeg_config *config);
+int jpeghal_dec_getconfig(int fd, struct jpeg_config *config);
+int jpeghal_enc_getconfig(int fd, struct jpeg_config *config);
+
+int jpeghal_set_inbuf(int fd, struct jpeg_buf *buf);
+int jpeghal_set_outbuf(int fd, struct jpeg_buf *buf);
+
+int jpeghal_dec_exe(int fd, struct jpeg_buf *in_buf, struct jpeg_buf *out_buf);
+int jpeghal_enc_exe(int fd, struct jpeg_buf *in_buf, struct jpeg_buf *out_buf);
+
+int jpeghal_deinit(int fd, struct jpeg_buf *in_buf, struct jpeg_buf *out_buf);
+
+int jpeghal_s_ctrl(int fd, int cid, int value);
+int jpeghal_g_ctrl(int fd, int id);
+
+unsigned long measure_time(struct timeval *start, struct timeval *stop);
+#ifdef __cplusplus
+}
+#endif
diff --git a/exynos4/hal/include/s3c_lcd.h b/exynos4/hal/include/s3c_lcd.h
new file mode 100644
index 0000000..7f2dec7
--- /dev/null
+++ b/exynos4/hal/include/s3c_lcd.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright@ Samsung Electronics Co. LTD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _S3CFB_LCD_
+#define _S3CFB_LCD_
+
+/*
+ * S T R U C T U R E S  F O R  C U S T O M  I O C T L S
+ *
+*/
+struct s3cfb_user_window {
+    int x;
+    int y;
+};
+
+struct s3cfb_user_plane_alpha {
+    int             channel;
+    unsigned char   red;
+    unsigned char   green;
+    unsigned char   blue;
+};
+
+struct s3cfb_user_chroma {
+    int             enabled;
+    unsigned char   red;
+    unsigned char   green;
+    unsigned char   blue;
+};
+
+typedef struct {
+    unsigned int phy_start_addr;
+    unsigned int xres;      /* visible resolution*/
+    unsigned int yres;
+    unsigned int xres_virtual;  /* virtual resolution*/
+    unsigned int yres_virtual;
+    unsigned int xoffset;   /* offset from virtual to visible */
+    unsigned int yoffset;   /* resolution   */
+    unsigned int lcd_offset_x;
+    unsigned int lcd_offset_y;
+} s3c_fb_next_info_t;
+
+#ifdef BOARD_USE_V4L2_ION
+struct s3c_fb_user_ion_client {
+    int fd;
+    int offset;
+};
+#endif
+
+/*
+ * C U S T O M  I O C T L S
+ *
+*/
+
+#define S3CFB_WIN_POSITION          _IOW ('F', 203, struct s3cfb_user_window)
+#define S3CFB_WIN_SET_PLANE_ALPHA   _IOW ('F', 204, struct s3cfb_user_plane_alpha)
+#define S3CFB_WIN_SET_CHROMA        _IOW ('F', 205, struct s3cfb_user_chroma)
+#define S3CFB_SET_VSYNC_INT         _IOW ('F', 206, unsigned int)
+#define S3CFB_SET_SUSPEND_FIFO      _IOW ('F', 300, unsigned long)
+#define S3CFB_SET_RESUME_FIFO       _IOW ('F', 301, unsigned long)
+#define S3CFB_GET_LCD_WIDTH         _IOR ('F', 302, int)
+#define S3CFB_GET_LCD_HEIGHT        _IOR ('F', 303, int)
+#define S3CFB_GET_FB_PHY_ADDR       _IOR ('F', 310, unsigned int)
+#define S3C_FB_GET_CURR_FB_INFO     _IOR ('F', 305, s3c_fb_next_info_t)
+#define S3CFB_GET_ION_USER_HANDLE   _IOWR('F', 208, struct s3c_fb_user_ion_client)
+
+/***************** LCD frame buffer *****************/
+#define FB0_NAME    "/dev/fb0"
+#define FB1_NAME    "/dev/fb1"
+#define FB2_NAME    "/dev/fb2"
+#define FB3_NAME    "/dev/fb3"
+#define FB4_NAME    "/dev/fb4"
+
+#endif
diff --git a/exynos4/hal/include/s3c_mem.h b/exynos4/hal/include/s3c_mem.h
new file mode 100644
index 0000000..dd4cbdb
--- /dev/null
+++ b/exynos4/hal/include/s3c_mem.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright@ Samsung Electronics Co. LTD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _S3C_MEM_COMMON_H_
+#define _S3C_MEM_COMMON_H_
+
+#define MEM_IOCTL_MAGIC         'M'
+
+#define S3C_MEM_ALLOC           _IOWR(MEM_IOCTL_MAGIC, 310, struct s3c_mem_alloc)
+#define S3C_MEM_FREE            _IOWR(MEM_IOCTL_MAGIC, 311, struct s3c_mem_alloc)
+
+#define S3C_MEM_SHARE_ALLOC     _IOWR(MEM_IOCTL_MAGIC, 314, struct s3c_mem_alloc)
+#define S3C_MEM_SHARE_FREE      _IOWR(MEM_IOCTL_MAGIC, 315, struct s3c_mem_alloc)
+
+#define S3C_MEM_CACHEABLE_ALLOC     _IOWR(MEM_IOCTL_MAGIC, 316, struct s3c_mem_alloc)
+#define S3C_MEM_CACHEABLE_SHARE_ALLOC   _IOWR(MEM_IOCTL_MAGIC, 317, struct s3c_mem_alloc)
+
+#define S3C_MEM_CACHE_FLUSH     _IOWR(MEM_IOCTL_MAGIC, 318, struct s3c_mem_alloc)
+#define S3C_MEM_CACHE_INVAL     _IOWR(MEM_IOCTL_MAGIC, 319, struct s3c_mem_alloc)
+#define S3C_MEM_CACHE_CLEAN     _IOWR(MEM_IOCTL_MAGIC, 320, struct s3c_mem_alloc)
+
+struct s3c_mem_alloc {
+    int     size;
+    unsigned int    vir_addr;
+    unsigned int    phy_addr;
+};
+
+struct s3c_mem_dma_param {
+    int     size;
+    unsigned int    src_addr;
+    unsigned int    dst_addr;
+    int     cfg;
+};
+
+#endif // _S3C_MEM_COMMON_H_
diff --git a/exynos4/hal/include/s5p_fimc.h b/exynos4/hal/include/s5p_fimc.h
new file mode 100644
index 0000000..b813e69
--- /dev/null
+++ b/exynos4/hal/include/s5p_fimc.h
@@ -0,0 +1,162 @@
+/* Copyright(c) 2011 Samsung Electronics Co, Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Alternatively, Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef _S5P_FIMC_H_
+#define _S5P_FIMC_H_
+
+#include <linux/videodev2.h>
+#include "SecBuffer.h"
+/*
+ * G E N E R A L S
+ *
+*/
+#define MIN(x, y)       ((x < y) ? x : y)
+
+/*
+ * P I X E L   F O R M A T   G U I D E
+ *
+ * The 'x' means 'DO NOT CARE'
+ * The '*' means 'FIMC SPECIFIC'
+ * For some fimc formats, we couldn't find equivalent format in the V4L2 FOURCC.
+ *
+ * FIMC TYPE    PLANES  ORDER       V4L2_PIX_FMT
+ * ---------------------------------------------------------
+ * RGB565   x   x       V4L2_PIX_FMT_RGB565
+ * RGB888   x   x       V4L2_PIX_FMT_RGB24
+ * YUV420   2   LSB_CBCR    V4L2_PIX_FMT_NV12
+ * YUV420   2   LSB_CRCB    V4L2_PIX_FMT_NV21
+ * YUV420   2   MSB_CBCR    V4L2_PIX_FMT_NV21X*
+ * YUV420   2   MSB_CRCB    V4L2_PIX_FMT_NV12X*
+ * YUV420   3   x       V4L2_PIX_FMT_YUV420
+ * YUV422   1   YCBYCR      V4L2_PIX_FMT_YUYV
+ * YUV422   1   YCRYCB      V4L2_PIX_FMT_YVYU
+ * YUV422   1   CBYCRY      V4L2_PIX_FMT_UYVY
+ * YUV422   1   CRYCBY      V4L2_PIX_FMT_VYUY*
+ * YUV422   2   LSB_CBCR    V4L2_PIX_FMT_NV16*
+ * YUV422   2   LSB_CRCB    V4L2_PIX_FMT_NV61*
+ * YUV422   2   MSB_CBCR    V4L2_PIX_FMT_NV16X*
+ * YUV422   2   MSB_CRCB    V4L2_PIX_FMT_NV61X*
+ * YUV422   3   x       V4L2_PIX_FMT_YUV422P
+ *
+*/
+
+/*
+ * V 4 L 2   F I M C   E X T E N S I O N S
+ *
+*/
+#define V4L2_PIX_FMT_YVYU       v4l2_fourcc('Y', 'V', 'Y', 'U')
+
+/* FOURCC for FIMC specific */
+#define V4L2_PIX_FMT_NV12X      v4l2_fourcc('N', '1', '2', 'X')
+#define V4L2_PIX_FMT_NV21X      v4l2_fourcc('N', '2', '1', 'X')
+#define V4L2_PIX_FMT_VYUY       v4l2_fourcc('V', 'Y', 'U', 'Y')
+#define V4L2_PIX_FMT_NV16       v4l2_fourcc('N', 'V', '1', '6')
+#define V4L2_PIX_FMT_NV61       v4l2_fourcc('N', 'V', '6', '1')
+#define V4L2_PIX_FMT_NV16X      v4l2_fourcc('N', '1', '6', 'X')
+#define V4L2_PIX_FMT_NV61X      v4l2_fourcc('N', '6', '1', 'X')
+
+#define V4L2_PIX_FMT_NV12T      v4l2_fourcc('T', 'V', '1', '2') /* 12  Y/CbCr 4:2:0 64x32 macroblocks */
+
+/* CID extensions */
+#define V4L2_CID_ROTATION       (V4L2_CID_PRIVATE_BASE + 0)
+#define V4L2_CID_OVLY_MODE              (V4L2_CID_PRIVATE_BASE + 9)
+#define V4L2_CID_DST_INFO       (V4L2_CID_PRIVATE_BASE + 10)
+#define V4L2_CID_GET_PHY_SRC_YADDR  (V4L2_CID_PRIVATE_BASE + 12)
+#define V4L2_CID_GET_PHY_SRC_CADDR  (V4L2_CID_PRIVATE_BASE + 13)
+#define V4L2_CID_RESERVED_MEM_BASE_ADDR (V4L2_CID_PRIVATE_BASE + 20)
+#define V4L2_CID_FIMC_VERSION       (V4L2_CID_PRIVATE_BASE + 21)
+
+/*
+ * U S E R   D E F I N E D   T Y P E S
+ *
+*/
+#define FIMC1_RESERVED_SIZE 32768
+
+enum fimc_overlay_mode {
+    FIMC_OVLY_NOT_FIXED       = 0x0,    /* Overlay mode isn't fixed. */
+    FIMC_OVLY_FIFO            = 0x1,    /* Non-destructive Overlay with FIFO */
+    FIMC_OVLY_DMA_AUTO        = 0x2,    /* Non-destructive Overlay with DMA */
+    FIMC_OVLY_DMA_MANUAL      = 0x3,    /* Non-destructive Overlay with DMA */
+    FIMC_OVLY_NONE_SINGLE_BUF = 0x4,    /* Destructive Overlay with DMA single destination buffer */
+    FIMC_OVLY_NONE_MULTI_BUF  = 0x5,    /* Destructive Overlay with DMA multiple dstination buffer */
+};
+
+typedef unsigned int dma_addr_t;
+
+struct fimc_buf {
+    dma_addr_t  base[3];
+    size_t      length[3];
+};
+
+struct fimc_buffer {
+    void    *virt_addr;
+    void    *phys_addr;
+    size_t  length;
+};
+
+struct yuv_fmt_list {
+    const char      *name;
+    const char      *desc;
+    unsigned int    fmt;
+    int             bpp;
+    int             planes;
+};
+
+struct img_offset {
+    int y_h;
+    int y_v;
+    int cb_h;
+    int cb_v;
+    int cr_h;
+    int cr_v;
+};
+
+//------------ STRUCT ---------------------------------------------------------//
+
+typedef struct
+{
+    unsigned int full_width;            // Source Image Full Width (Virtual screen size)
+    unsigned int full_height;           // Source Image Full Height (Virtual screen size)
+    unsigned int start_x;               // Source Image Start width offset
+    unsigned int start_y;               // Source Image Start height offset
+    unsigned int width;                 // Source Image Width
+    unsigned int height;                // Source Image Height
+    unsigned int buf_addr_phy_rgb_y;    // Base Address of the Source Image (RGB or Y): Physical Address
+    unsigned int buf_addr_phy_cb;       // Base Address of the Source Image (CB Component) : Physical Address
+    unsigned int buf_addr_phy_cr;       // Base Address of the Source Image (CR Component) : Physical Address
+    unsigned int color_space;           // Color Space of the Source Image
+} s5p_fimc_img_info;
+
+typedef struct
+{
+    s5p_fimc_img_info   src;
+    s5p_fimc_img_info   dst;
+} s5p_fimc_params_t;
+
+typedef struct _s5p_fimc_t {
+    int                dev_fd;
+    struct fimc_buffer  out_buf;
+
+    s5p_fimc_params_t   params;
+
+    int                 use_ext_out_mem;
+    unsigned int        hw_ver;
+}s5p_fimc_t;
+
+#endif
diff --git a/exynos4/hal/include/s5p_fimc_v4l2.h b/exynos4/hal/include/s5p_fimc_v4l2.h
new file mode 100644
index 0000000..35b84a0
--- /dev/null
+++ b/exynos4/hal/include/s5p_fimc_v4l2.h
@@ -0,0 +1,164 @@
+/* Copyright(c) 2011 Samsung Electronics Co, Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Alternatively, Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef _S5P_FIMC_H_
+#define _S5P_FIMC_H_
+
+#include "videodev2.h"
+#include "SecBuffer.h"
+
+/*
+ * G E N E R A L S
+ *
+*/
+
+/*
+ * P I X E L   F O R M A T   G U I D E
+ *
+ * The 'x' means 'DO NOT CARE'
+ * The '*' means 'FIMC SPECIFIC'
+ * For some fimc formats, we couldn't find equivalent format in the V4L2 FOURCC.
+ *
+ * FIMC TYPE    PLANES  ORDER       V4L2_PIX_FMT
+ * ---------------------------------------------------------
+ * RGB565   x   x       V4L2_PIX_FMT_RGB565
+ * RGB888   x   x       V4L2_PIX_FMT_RGB24
+ * YUV420   2   LSB_CBCR    V4L2_PIX_FMT_NV12
+ * YUV420   2   LSB_CRCB    V4L2_PIX_FMT_NV21
+ * YUV420   2   MSB_CBCR    V4L2_PIX_FMT_NV21X*
+ * YUV420   2   MSB_CRCB    V4L2_PIX_FMT_NV12X*
+ * YUV420   3   x       V4L2_PIX_FMT_YUV420
+ * YUV422   1   YCBYCR      V4L2_PIX_FMT_YUYV
+ * YUV422   1   YCRYCB      V4L2_PIX_FMT_YVYU
+ * YUV422   1   CBYCRY      V4L2_PIX_FMT_UYVY
+ * YUV422   1   CRYCBY      V4L2_PIX_FMT_VYUY*
+ * YUV422   2   LSB_CBCR    V4L2_PIX_FMT_NV16*
+ * YUV422   2   LSB_CRCB    V4L2_PIX_FMT_NV61*
+ * YUV422   2   MSB_CBCR    V4L2_PIX_FMT_NV16X*
+ * YUV422   2   MSB_CRCB    V4L2_PIX_FMT_NV61X*
+ * YUV422   3   x       V4L2_PIX_FMT_YUV422P
+ *
+*/
+
+/*
+ * V 4 L 2   F I M C   E X T E N S I O N S
+ *
+*/
+#define V4L2_PIX_FMT_YVYU       v4l2_fourcc('Y', 'V', 'Y', 'U')
+
+/* FOURCC for FIMC specific */
+#define V4L2_PIX_FMT_NV12X      v4l2_fourcc('N', '1', '2', 'X')
+#define V4L2_PIX_FMT_NV21X      v4l2_fourcc('N', '2', '1', 'X')
+#define V4L2_PIX_FMT_VYUY       v4l2_fourcc('V', 'Y', 'U', 'Y')
+#define V4L2_PIX_FMT_NV16       v4l2_fourcc('N', 'V', '1', '6')
+#define V4L2_PIX_FMT_NV61       v4l2_fourcc('N', 'V', '6', '1')
+#define V4L2_PIX_FMT_NV16X      v4l2_fourcc('N', '1', '6', 'X')
+#define V4L2_PIX_FMT_NV61X      v4l2_fourcc('N', '6', '1', 'X')
+
+#define V4L2_PIX_FMT_NV12T      v4l2_fourcc('T', 'V', '1', '2') /* 12  Y/CbCr 4:2:0 64x32 macroblocks */
+
+/* CID extensions */
+#define V4L2_CID_ROTATION       (V4L2_CID_PRIVATE_BASE + 0)
+#define V4L2_CID_OVLY_MODE              (V4L2_CID_PRIVATE_BASE + 9)
+#define V4L2_CID_DST_INFO       (V4L2_CID_PRIVATE_BASE + 10)
+#define V4L2_CID_GET_PHY_SRC_YADDR  (V4L2_CID_PRIVATE_BASE + 12)
+#define V4L2_CID_GET_PHY_SRC_CADDR  (V4L2_CID_PRIVATE_BASE + 13)
+#define V4L2_CID_RESERVED_MEM_BASE_ADDR (V4L2_CID_PRIVATE_BASE + 20)
+#define V4L2_CID_FIMC_VERSION       (V4L2_CID_PRIVATE_BASE + 21)
+
+/*
+ * U S E R   D E F I N E D   T Y P E S
+ *
+*/
+#define FIMC1_RESERVED_SIZE 32768
+
+enum fimc_overlay_mode {
+    FIMC_OVLY_NOT_FIXED       = 0x0,    /* Overlay mode isn't fixed. */
+    FIMC_OVLY_FIFO            = 0x1,    /* Non-destructive Overlay with FIFO */
+    FIMC_OVLY_DMA_AUTO        = 0x2,    /* Non-destructive Overlay with DMA */
+    FIMC_OVLY_DMA_MANUAL      = 0x3,    /* Non-destructive Overlay with DMA */
+    FIMC_OVLY_NONE_SINGLE_BUF = 0x4,    /* Destructive Overlay with DMA single destination buffer */
+    FIMC_OVLY_NONE_MULTI_BUF  = 0x5,    /* Destructive Overlay with DMA multiple dstination buffer */
+};
+
+typedef unsigned int dma_addr_t;
+
+struct fimc_buf {
+    dma_addr_t  base[3];
+    size_t      size[3];
+    int         planes;
+};
+
+struct fimc_buffer {
+    void    *virt_addr;
+    void    *phys_addr;
+    size_t  length;
+};
+
+struct yuv_fmt_list {
+    const char      *name;
+    const char      *desc;
+    unsigned int    fmt;
+    int             bpp;
+    int             planes;
+};
+
+struct img_offset {
+    int y_h;
+    int y_v;
+    int cb_h;
+    int cb_v;
+    int cr_h;
+    int cr_v;
+};
+
+//------------ STRUCT ---------------------------------------------------------//
+
+typedef struct
+{
+    unsigned int full_width;            // Source Image Full Width (Virtual screen size)
+    unsigned int full_height;           // Source Image Full Height (Virtual screen size)
+    unsigned int start_x;               // Source Image Start width offset
+    unsigned int start_y;               // Source Image Start height offset
+    unsigned int width;                 // Source Image Width
+    unsigned int height;                // Source Image Height
+    unsigned int buf_addr_phy_rgb_y;    // Base Address of the Source Image (RGB or Y): Physical Address
+    unsigned int buf_addr_phy_cb;       // Base Address of the Source Image (CB Component) : Physical Address
+    unsigned int buf_addr_phy_cr;       // Base Address of the Source Image (CR Component) : Physical Address
+    unsigned int color_space;           // Color Space of the Source Image
+    unsigned int planes;                // number of planes for the Image
+} s5p_fimc_img_info;
+
+typedef struct
+{
+    s5p_fimc_img_info   src;
+    s5p_fimc_img_info   dst;
+} s5p_fimc_params_t;
+
+typedef struct _s5p_fimc_t {
+    int                 dev_fd;
+    struct fimc_buffer  out_buf;
+
+    s5p_fimc_params_t   params;
+
+    int                 use_ext_out_mem;
+    unsigned int        hw_ver;
+} s5p_fimc_t;
+
+#endif
diff --git a/exynos4/hal/include/s5p_tvout.h b/exynos4/hal/include/s5p_tvout.h
new file mode 100644
index 0000000..62295d2
--- /dev/null
+++ b/exynos4/hal/include/s5p_tvout.h
@@ -0,0 +1,198 @@
+/*
+ * Copyright@ Samsung Electronics Co. LTD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __S5P_TVOUT_H__
+#define __S5P_TVOUT_H__
+
+#include <linux/fb.h>
+#include "videodev2.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*******************************************
+ * Define
+ *******************************************/
+/* TVOUT control */
+#ifdef SAMSUNG_EXYNOS4210
+#define TVOUT_DEV   "/dev/video14"
+#else
+#define TVOUT_DEV   "/dev/video16"
+#endif
+#define HPD_DEV         "/dev/HPD"
+
+/* ------------- Output -----------------*/
+/* type */
+#define V4L2_OUTPUT_TYPE_MSDMA          4
+#define V4L2_OUTPUT_TYPE_COMPOSITE      5
+#define V4L2_OUTPUT_TYPE_SVIDEO         6
+#define V4L2_OUTPUT_TYPE_YPBPR_INERLACED    7
+#define V4L2_OUTPUT_TYPE_YPBPR_PROGRESSIVE  8
+#define V4L2_OUTPUT_TYPE_RGB_PROGRESSIVE    9
+#define V4L2_OUTPUT_TYPE_DIGITAL        10
+#define V4L2_OUTPUT_TYPE_HDMI           V4L2_OUTPUT_TYPE_DIGITAL
+#define V4L2_OUTPUT_TYPE_HDMI_RGB       11
+#define V4L2_OUTPUT_TYPE_DVI            12
+
+/* ------------- STD -------------------*/
+#define V4L2_STD_PAL_BDGHI\
+ (V4L2_STD_PAL_B|V4L2_STD_PAL_D|V4L2_STD_PAL_G|V4L2_STD_PAL_H|V4L2_STD_PAL_I)
+
+#define V4L2_STD_480P_60_16_9           ((v4l2_std_id)0x04000000)
+#define V4L2_STD_480P_60_4_3            ((v4l2_std_id)0x05000000)
+#define V4L2_STD_576P_50_16_9           ((v4l2_std_id)0x06000000)
+#define V4L2_STD_576P_50_4_3            ((v4l2_std_id)0x07000000)
+#define V4L2_STD_720P_60                ((v4l2_std_id)0x08000000)
+#define V4L2_STD_720P_50                ((v4l2_std_id)0x09000000)
+#define V4L2_STD_1080P_60               ((v4l2_std_id)0x0a000000)
+#define V4L2_STD_1080P_50               ((v4l2_std_id)0x0b000000)
+#define V4L2_STD_1080I_60               ((v4l2_std_id)0x0c000000)
+#define V4L2_STD_1080I_50               ((v4l2_std_id)0x0d000000)
+#define V4L2_STD_480P_59                ((v4l2_std_id)0x0e000000)
+#define V4L2_STD_720P_59                ((v4l2_std_id)0x0f000000)
+#define V4L2_STD_1080I_59               ((v4l2_std_id)0x10000000)
+#define V4L2_STD_1080P_59               ((v4l2_std_id)0x11000000)
+#define V4L2_STD_1080P_30               ((v4l2_std_id)0x12000000)
+#define V4L2_STD_TVOUT_720P_60_SBS_HALF ((v4l2_std_id)0x13000000)
+#define V4L2_STD_TVOUT_720P_59_SBS_HALF ((v4l2_std_id)0x14000000)
+#define V4L2_STD_TVOUT_720P_50_TB       ((v4l2_std_id)0x15000000)
+#define V4L2_STD_TVOUT_1080P_24_TB      ((v4l2_std_id)0x16000000)
+#define V4L2_STD_TVOUT_1080P_23_TB      ((v4l2_std_id)0x17000000)
+
+/* TVOUT video */
+#ifdef SAMSUNG_EXYNOS4210
+#define TVOUT_DEV_V "/dev/video21"
+#else
+#define TVOUT_DEV_V "/dev/video20"
+#endif
+
+/* ------------- Input ------------------*/
+/* type */
+#define V4L2_INPUT_TYPE_MSDMA           3
+#define V4L2_INPUT_TYPE_FIFO            4
+
+/* TVOUT video */
+#define PFX_NODE_FB "/dev/graphics/fb"
+
+/*******************************************
+ * structures
+ *******************************************/
+
+/* TVOUT */
+struct v4l2_vid_overlay_src {
+    void            *base_y;
+    void            *base_c;
+    struct v4l2_pix_format  pix_fmt;
+};
+
+struct v4l2_window_s5p_tvout {
+    __u32       capability;
+    __u32       flags;
+    __u32       priority;
+    struct v4l2_window  win;
+};
+
+struct v4l2_pix_format_s5p_tvout {
+    void *base_y;
+    void *base_c;
+    __u32 src_img_endian;
+    struct v4l2_pix_format  pix_fmt;
+};
+
+struct vid_overlay_param {
+    struct v4l2_vid_overlay_src     src;
+    struct v4l2_rect                src_crop;
+    struct v4l2_framebuffer         dst;
+    struct v4l2_window              dst_win;
+};
+
+struct tvout_param {
+    struct v4l2_pix_format_s5p_tvout    tvout_src;
+    struct v4l2_window_s5p_tvout        tvout_rect;
+    struct v4l2_rect                    tvout_dst;
+};
+
+struct overlay_param {
+    struct v4l2_framebuffer         overlay_frame;
+    struct v4l2_window_s5p_tvout    overlay_rect;
+    struct v4l2_rect                overlay_dst;
+};
+
+/* FB */
+struct s5ptvfb_user_window {
+    int x;
+    int y;
+};
+
+struct s5ptvfb_user_plane_alpha {
+    int channel;
+    unsigned char alpha;
+};
+
+struct s5ptvfb_user_chroma {
+    int enabled;
+    unsigned char red;
+    unsigned char green;
+    unsigned char blue;
+};
+
+enum s5ptvfb_ver_scaling_t {
+    VERTICAL_X1,
+    VERTICAL_X2,
+};
+
+enum s5ptvfb_hor_scaling_t {
+    HORIZONTAL_X1,
+    HORIZONTAL_X2,
+};
+
+struct s5ptvfb_user_scaling {
+    enum s5ptvfb_ver_scaling_t ver;
+    enum s5ptvfb_hor_scaling_t hor;
+};
+
+/*******************************************
+ * custom ioctls
+ *******************************************/
+
+#define VIDIOC_S_BASEADDR        _IOR('V', 83, int)
+
+#define VIDIOC_HDCP_ENABLE _IOWR('V', 100, unsigned int)
+#define VIDIOC_HDCP_STATUS _IOR('V', 101, unsigned int)
+#define VIDIOC_HDCP_PROT_STATUS _IOR('V', 102, unsigned int)
+
+#define VIDIOC_INIT_AUDIO _IOR('V', 103, unsigned int)
+#define VIDIOC_AV_MUTE _IOR('V', 104, unsigned int)
+#define VIDIOC_G_AVMUTE _IOR('V', 105, unsigned int)
+#define HPD_GET_STATE _IOR('H', 100, unsigned int)
+
+#define S5PTVFB_WIN_POSITION _IOW('F', 213, struct s5ptvfb_user_window)
+#define S5PTVFB_WIN_SET_PLANE_ALPHA _IOW('F', 214, struct s5ptvfb_user_plane_alpha)
+#define S5PTVFB_WIN_SET_CHROMA _IOW('F', 215, struct s5ptvfb_user_chroma)
+
+#define S5PTVFB_SET_VSYNC_INT _IOW('F', 216, unsigned int)
+#define S5PTVFB_WAITFORVSYNC _IO('F', 32)
+#define S5PTVFB_WIN_SET_ADDR _IOW('F', 219, unsigned int)
+#define S5PTVFB_SET_WIN_ON _IOW('F', 220, unsigned int)
+#define S5PTVFB_SET_WIN_OFF _IOW('F', 221, unsigned int)
+#define S5PTVFB_SCALING _IOW('F', 222, struct s5ptvfb_user_scaling)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __S5P_TVOUT_H__ */
diff --git a/exynos4/hal/include/s5p_tvout_v4l2.h b/exynos4/hal/include/s5p_tvout_v4l2.h
new file mode 100644
index 0000000..16f78b1
--- /dev/null
+++ b/exynos4/hal/include/s5p_tvout_v4l2.h
@@ -0,0 +1,190 @@
+/*
+ * Copyright@ Samsung Electronics Co. LTD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __S5P_TVOUT_H__
+#define __S5P_TVOUT_H__
+
+#include <linux/fb.h>
+
+#include "videodev2.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*******************************************
+ * Define
+ *******************************************/
+/* TVOUT control */
+#define PFX_NODE_FB     "/dev/graphics/fb"
+
+#define TVOUT_DEV_V     "/dev/video20"
+#define TVOUT_DEV_G0    "/dev/video16"
+#define TVOUT_DEV_G1    "/dev/video17"
+
+#define HPD_DEV         "/dev/HPD"
+
+/* ------------- Output -----------------*/
+/* type */
+#define V4L2_OUTPUT_TYPE_MSDMA          4
+#define V4L2_OUTPUT_TYPE_COMPOSITE      5
+#define V4L2_OUTPUT_TYPE_SVIDEO         6
+#define V4L2_OUTPUT_TYPE_YPBPR_INERLACED    7
+#define V4L2_OUTPUT_TYPE_YPBPR_PROGRESSIVE  8
+#define V4L2_OUTPUT_TYPE_RGB_PROGRESSIVE    9
+#define V4L2_OUTPUT_TYPE_DIGITAL        10
+#define V4L2_OUTPUT_TYPE_HDMI           V4L2_OUTPUT_TYPE_DIGITAL
+#define V4L2_OUTPUT_TYPE_HDMI_RGB       11
+#define V4L2_OUTPUT_TYPE_DVI            12
+
+/* ------------- STD -------------------*/
+#define V4L2_STD_PAL_BDGHI\
+ (V4L2_STD_PAL_B|V4L2_STD_PAL_D|V4L2_STD_PAL_G|V4L2_STD_PAL_H|V4L2_STD_PAL_I)
+
+#define V4L2_STD_480P_60_16_9           ((v4l2_std_id)0x04000000)
+#define V4L2_STD_480P_60_4_3            ((v4l2_std_id)0x05000000)
+#define V4L2_STD_576P_50_16_9           ((v4l2_std_id)0x06000000)
+#define V4L2_STD_576P_50_4_3            ((v4l2_std_id)0x07000000)
+#define V4L2_STD_720P_60                ((v4l2_std_id)0x08000000)
+#define V4L2_STD_720P_50                ((v4l2_std_id)0x09000000)
+#define V4L2_STD_1080P_60               ((v4l2_std_id)0x0a000000)
+#define V4L2_STD_1080P_50               ((v4l2_std_id)0x0b000000)
+#define V4L2_STD_1080I_60               ((v4l2_std_id)0x0c000000)
+#define V4L2_STD_1080I_50               ((v4l2_std_id)0x0d000000)
+#define V4L2_STD_480P_59                ((v4l2_std_id)0x0e000000)
+#define V4L2_STD_720P_59                ((v4l2_std_id)0x0f000000)
+#define V4L2_STD_1080I_59               ((v4l2_std_id)0x10000000)
+#define V4L2_STD_1080P_59               ((v4l2_std_id)0x11000000)
+#define V4L2_STD_1080P_30               ((v4l2_std_id)0x12000000)
+#define V4L2_STD_TVOUT_720P_60_SBS_HALF ((v4l2_std_id)0x13000000)
+#define V4L2_STD_TVOUT_720P_59_SBS_HALF ((v4l2_std_id)0x14000000)
+#define V4L2_STD_TVOUT_720P_50_TB       ((v4l2_std_id)0x15000000)
+#define V4L2_STD_TVOUT_1080P_24_TB      ((v4l2_std_id)0x16000000)
+#define V4L2_STD_TVOUT_1080P_23_TB      ((v4l2_std_id)0x17000000)
+
+/* ------------- Input ------------------*/
+/* type */
+#define V4L2_INPUT_TYPE_MSDMA           3
+#define V4L2_INPUT_TYPE_FIFO            4
+
+/*******************************************
+ * structures
+ *******************************************/
+
+/* TVOUT */
+struct v4l2_vid_overlay_src {
+    void            *base_y;
+    void            *base_c;
+    struct v4l2_pix_format  pix_fmt;
+};
+
+struct v4l2_window_s5p_tvout {
+    __u32       capability;
+    __u32       flags;
+    __u32       priority;
+    struct v4l2_window  win;
+};
+
+struct v4l2_pix_format_s5p_tvout {
+    void *base_y;
+    void *base_c;
+    __u32 src_img_endian;
+    struct v4l2_pix_format  pix_fmt;
+};
+
+struct vid_overlay_param {
+    struct v4l2_vid_overlay_src     src;
+    struct v4l2_rect                src_crop;
+    struct v4l2_framebuffer         dst;
+    struct v4l2_window              dst_win;
+};
+
+struct tvout_param {
+    struct v4l2_pix_format_s5p_tvout    tvout_src;
+    struct v4l2_window_s5p_tvout        tvout_rect;
+    struct v4l2_rect                    tvout_dst;
+};
+
+struct overlay_param {
+    struct v4l2_framebuffer         overlay_frame;
+    struct v4l2_window_s5p_tvout    overlay_rect;
+    struct v4l2_rect                overlay_dst;
+};
+
+/* FB */
+struct s5ptvfb_user_window {
+    int x;
+    int y;
+};
+
+struct s5ptvfb_user_plane_alpha {
+    int channel;
+    unsigned char alpha;
+};
+
+struct s5ptvfb_user_chroma {
+    int enabled;
+    unsigned char red;
+    unsigned char green;
+    unsigned char blue;
+};
+
+enum s5ptvfb_ver_scaling_t {
+    VERTICAL_X1,
+    VERTICAL_X2,
+};
+
+enum s5ptvfb_hor_scaling_t {
+    HORIZONTAL_X1,
+    HORIZONTAL_X2,
+};
+
+struct s5ptvfb_user_scaling {
+    enum s5ptvfb_ver_scaling_t ver;
+    enum s5ptvfb_hor_scaling_t hor;
+};
+
+/*******************************************
+ * custom ioctls
+ *******************************************/
+
+#define VIDIOC_S_BASEADDR        _IOR('V', 83, int)
+
+#define VIDIOC_HDCP_ENABLE _IOWR('V', 100, unsigned int)
+#define VIDIOC_HDCP_STATUS _IOR('V', 101, unsigned int)
+#define VIDIOC_HDCP_PROT_STATUS _IOR('V', 102, unsigned int)
+
+#define VIDIOC_INIT_AUDIO _IOR('V', 103, unsigned int)
+#define VIDIOC_AV_MUTE _IOR('V', 104, unsigned int)
+#define VIDIOC_G_AVMUTE _IOR('V', 105, unsigned int)
+#define HPD_GET_STATE _IOR('H', 100, unsigned int)
+
+#define S5PTVFB_WIN_POSITION _IOW('F', 213, struct s5ptvfb_user_window)
+#define S5PTVFB_WIN_SET_PLANE_ALPHA _IOW('F', 214, struct s5ptvfb_user_plane_alpha)
+#define S5PTVFB_WIN_SET_CHROMA _IOW('F', 215, struct s5ptvfb_user_chroma)
+
+#define S5PTVFB_SET_VSYNC_INT _IOW('F', 216, unsigned int)
+#define S5PTVFB_WAITFORVSYNC _IO('F', 32)
+#define S5PTVFB_WIN_SET_ADDR _IOW('F', 219, unsigned int)
+#define S5PTVFB_SET_WIN_ON _IOW('F', 220, unsigned int)
+#define S5PTVFB_SET_WIN_OFF _IOW('F', 221, unsigned int)
+#define S5PTVFB_SCALING _IOW('F', 222, struct s5ptvfb_user_scaling)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __S5P_TVOUT_H__ */
diff --git a/exynos4/hal/include/sec_format.h b/exynos4/hal/include/sec_format.h
new file mode 100644
index 0000000..8722b45
--- /dev/null
+++ b/exynos4/hal/include/sec_format.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright@ Samsung Electronics Co. LTD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef _SEC_FORMAT_H_
+#define _SEC_FORMAT_H_
+
+/* enum related to pixel format */
+
+enum {
+    HAL_PIXEL_FORMAT_YCbCr_422_P         = 0x100,
+    HAL_PIXEL_FORMAT_YCbCr_420_P         = 0x101,
+    HAL_PIXEL_FORMAT_YCbCr_420_I         = 0x102,
+    HAL_PIXEL_FORMAT_CbYCrY_422_I        = 0x103,
+    HAL_PIXEL_FORMAT_CbYCrY_420_I        = 0x104,
+    HAL_PIXEL_FORMAT_YCbCr_420_SP        = 0x105,
+    HAL_PIXEL_FORMAT_YCrCb_422_SP        = 0x106,
+    HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED  = 0x107,
+    HAL_PIXEL_FORMAT_ARGB888             = 0x108,
+    // support custom format for zero copy
+    HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP = 0x110,
+    HAL_PIXEL_FORMAT_CUSTOM_YCrCb_420_SP = 0x111,
+    HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP_TILED = 0x112,
+    HAL_PIXEL_FORMAT_CUSTOM_YCbCr_422_SP = 0x113,
+    HAL_PIXEL_FORMAT_CUSTOM_YCrCb_422_SP = 0x114,
+    HAL_PIXEL_FORMAT_CUSTOM_YCbCr_422_I = 0x115,
+    HAL_PIXEL_FORMAT_CUSTOM_YCrCb_422_I = 0x116,
+    HAL_PIXEL_FORMAT_CUSTOM_CbYCrY_422_I = 0x117,
+    HAL_PIXEL_FORMAT_CUSTOM_CrYCbY_422_I = 0x118,
+    HAL_PIXEL_FORMAT_CUSTOM_CbYCr_422_I  = 0x11B,
+    HAL_PIXEL_FORMAT_CUSTOM_MAX
+};
+
+#endif
diff --git a/exynos4/hal/include/sec_g2d.h b/exynos4/hal/include/sec_g2d.h
new file mode 100644
index 0000000..772cbf8
--- /dev/null
+++ b/exynos4/hal/include/sec_g2d.h
@@ -0,0 +1,251 @@
+/*
+ * Copyright@ Samsung Electronics Co. LTD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _SEC_G2D_DRIVER_H_
+#define _SEC_G2D_DRIVER_H_
+typedef unsigned char  u8;
+typedef unsigned short u16;
+typedef unsigned long  u32;
+
+#define SEC_G2D_DEV_NAME        "/dev/fimg2d"
+
+#define G2D_IOCTL_MAGIC 'G'
+
+#define G2D_BLIT                    _IO(G2D_IOCTL_MAGIC,0)
+#define G2D_GET_VERSION             _IO(G2D_IOCTL_MAGIC,1)
+#define G2D_GET_MEMORY              _IOR(G2D_IOCTL_MAGIC,2, unsigned int)
+#define G2D_GET_MEMORY_SIZE         _IOR(G2D_IOCTL_MAGIC,3, unsigned int)
+#define G2D_DMA_CACHE_CLEAN         _IOWR(G2D_IOCTL_MAGIC,4, struct g2d_dma_info)
+#define G2D_DMA_CACHE_FLUSH         _IOWR(G2D_IOCTL_MAGIC,5, struct g2d_dma_info)
+#define G2D_SYNC                    _IO(G2D_IOCTL_MAGIC,6)
+#define G2D_RESET                   _IO(G2D_IOCTL_MAGIC,7)
+
+#define G2D_MAX_WIDTH   (2048)
+#define G2D_MAX_HEIGHT  (2048)
+
+#define G2D_ALPHA_VALUE_MAX (255)
+
+#define G2D_POLLING (1<<0)
+#define G2D_INTERRUPT (0<<0)
+#define G2D_CACHE_OP (1<<1)
+#define G2D_NONE_INVALIDATE (0<<1)
+#define G2D_HYBRID_MODE (1<<2)
+
+typedef enum {
+    G2D_ROT_0 = 0,
+    G2D_ROT_90,
+    G2D_ROT_180,
+    G2D_ROT_270,
+    G2D_ROT_X_FLIP,
+    G2D_ROT_Y_FLIP
+} G2D_ROT_DEG;
+
+typedef enum {
+    G2D_ALPHA_BLENDING_MIN    = 0,   // wholly transparent
+    G2D_ALPHA_BLENDING_MAX    = 255, // 255
+    G2D_ALPHA_BLENDING_OPAQUE = 256, // opaque
+} G2D_ALPHA_BLENDING_MODE;
+
+typedef enum {
+    G2D_COLORKEY_NONE = 0,
+    G2D_COLORKEY_SRC_ON,
+    G2D_COLORKEY_DST_ON,
+    G2D_COLORKEY_SRC_DST_ON,
+} G2D_COLORKEY_MODE;
+
+typedef enum {
+    G2D_BLUE_SCREEN_NONE = 0,
+    G2D_BLUE_SCREEN_TRANSPARENT,
+    G2D_BLUE_SCREEN_WITH_COLOR,
+} G2D_BLUE_SCREEN_MODE;
+
+typedef enum {
+    G2D_ROP_SRC = 0,
+    G2D_ROP_DST,
+    G2D_ROP_SRC_AND_DST,
+    G2D_ROP_SRC_OR_DST,
+    G2D_ROP_3RD_OPRND,
+    G2D_ROP_SRC_AND_3RD_OPRND,
+    G2D_ROP_SRC_OR_3RD_OPRND,
+    G2D_ROP_SRC_XOR_3RD_OPRND,
+    G2D_ROP_DST_OR_3RD,
+} G2D_ROP_TYPE;
+
+typedef enum {
+    G2D_THIRD_OP_NONE = 0,
+    G2D_THIRD_OP_PATTERN,
+    G2D_THIRD_OP_FG,
+    G2D_THIRD_OP_BG
+} G2D_THIRD_OP_MODE;
+
+typedef enum {
+    G2D_BLACK = 0,
+    G2D_RED,
+    G2D_GREEN,
+    G2D_BLUE,
+    G2D_WHITE,
+    G2D_YELLOW,
+    G2D_CYAN,
+    G2D_MAGENTA
+} G2D_COLOR;
+
+typedef enum {
+    G2D_RGB_565 = ((0<<4)|2),
+
+    G2D_ABGR_8888 = ((2<<4)|1),
+    G2D_BGRA_8888 = ((3<<4)|1),
+    G2D_ARGB_8888 = ((0<<4)|1),
+    G2D_RGBA_8888 = ((1<<4)|1),
+
+    G2D_XBGR_8888 = ((2<<4)|0),
+    G2D_BGRX_8888 = ((3<<4)|0),
+    G2D_XRGB_8888 = ((0<<4)|0),
+    G2D_RGBX_8888 = ((1<<4)|0),
+
+    G2D_ABGR_1555 = ((2<<4)|4),
+    G2D_BGRA_5551 = ((3<<4)|4),
+    G2D_ARGB_1555 = ((0<<4)|4),
+    G2D_RGBA_5551 = ((1<<4)|4),
+
+    G2D_XBGR_1555 = ((2<<4)|3),
+    G2D_BGRX_5551 = ((3<<4)|3),
+    G2D_XRGB_1555 = ((0<<4)|3),
+    G2D_RGBX_5551 = ((1<<4)|3),
+
+    G2D_ABGR_4444 = ((2<<4)|6),
+    G2D_BGRA_4444 = ((3<<4)|6),
+    G2D_ARGB_4444 = ((0<<4)|6),
+    G2D_RGBA_4444 = ((1<<4)|6),
+
+    G2D_XBGR_4444 = ((2<<4)|5),
+    G2D_BGRX_4444 = ((3<<4)|5),
+    G2D_XRGB_4444 = ((0<<4)|5),
+    G2D_RGBX_4444 = ((1<<4)|5),
+
+    G2D_PACKED_BGR_888 = ((2<<4)|7),
+    G2D_PACKED_RGB_888 = ((0<<4)|7),
+
+    G2D_MAX_COLOR_SPACE
+} G2D_COLOR_SPACE;
+
+typedef enum {
+    G2D_Clear_Mode,    //!< [0, 0]
+    G2D_Src_Mode,      //!< [Sa, Sc]
+    G2D_Dst_Mode,      //!< [Da, Dc]
+    G2D_SrcOver_Mode,  //!< [Sa + Da - Sa*Da, Rc = Sc + (1 - Sa)*Dc]
+    G2D_DstOver_Mode,  //!< [Sa + Da - Sa*Da, Rc = Dc + (1 - Da)*Sc]
+    G2D_SrcIn_Mode,    //!< [Sa * Da, Sc * Da]
+    G2D_DstIn_Mode,    //!< [Sa * Da, Sa * Dc]
+    G2D_SrcOut_Mode,   //!< [Sa * (1 - Da), Sc * (1 - Da)]
+    G2D_DstOut_Mode,   //!< [Da * (1 - Sa), Dc * (1 - Sa)]
+    G2D_SrcATop_Mode,  //!< [Da, Sc * Da + (1 - Sa) * Dc]
+    G2D_DstATop_Mode,  //!< [Sa, Sa * Dc + Sc * (1 - Da)]
+    G2D_Xor_Mode,      //!< [Sa + Da - 2 * Sa * Da, Sc * (1 - Da) + (1 - Sa) * Dc]
+
+    // these modes are defined in the SVG Compositing standard
+    // http://www.w3.org/TR/2009/WD-SVGCompositing-20090430/
+    G2D_Plus_Mode,
+    G2D_Multiply_Mode,
+    G2D_Screen_Mode,
+    G2D_Overlay_Mode,
+    G2D_Darken_Mode,
+    G2D_Lighten_Mode,
+    G2D_ColorDodge_Mode,
+    G2D_ColorBurn_Mode,
+    G2D_HardLight_Mode,
+    G2D_SoftLight_Mode,
+    G2D_Difference_Mode,
+    G2D_Exclusion_Mode,
+
+    kLastMode = G2D_Exclusion_Mode
+} G2D_PORTTERDUFF_MODE;
+
+typedef enum {
+       G2D_MEMORY_KERNEL,
+       G2D_MEMORY_USER
+} G2D_MEMORY_TYPE;
+
+typedef struct {
+    int    x;
+    int    y;
+    unsigned int    w;
+    unsigned int    h;
+    unsigned int    full_w;
+    unsigned int    full_h;
+    int             color_format;
+    unsigned int    bytes_per_pixel;
+    unsigned char * addr;
+} g2d_rect;
+
+typedef struct {
+    unsigned int    rotate_val;
+    unsigned int    alpha_val;
+
+    unsigned int    blue_screen_mode;     //true : enable, false : disable
+    unsigned int    color_key_val;        //screen color value
+    unsigned int    color_switch_val;     //one color
+
+    unsigned int    src_color;            // when set one color on SRC
+
+    unsigned int    third_op_mode;
+    unsigned int    rop_mode;
+    unsigned int    mask_mode;
+    unsigned int    render_mode;
+    unsigned int    potterduff_mode;
+        unsigned int    memory_type;
+} g2d_flag;
+
+typedef struct {
+    unsigned int    t;
+    unsigned int    b;
+    unsigned int    l;
+    unsigned int    r;
+} g2d_clip;
+
+typedef struct {
+    g2d_rect src_rect;
+    g2d_rect dst_rect;
+    g2d_clip clip;
+    g2d_flag flag;
+} g2d_params;
+
+struct g2d_dma_info {
+    unsigned long addr;
+    unsigned int  size;
+};
+
+typedef struct _sec_g2d_t {
+    int dev_fd;
+    g2d_params  params;
+}sec_g2d_t;
+
+typedef struct __s5p_rect {
+    uint32_t x;
+    uint32_t y;
+    uint32_t w;
+    uint32_t h;
+} __s5p_rect;
+
+typedef struct __s5p_img {
+    uint32_t width;
+    uint32_t height;
+    uint32_t format;
+    uint32_t offset;
+    uint32_t base;
+    int memory_id;
+} __s5p_img;
+
+#endif /*_SEC_G2D_DRIVER_H_*/
diff --git a/exynos4/hal/include/sec_utils.h b/exynos4/hal/include/sec_utils.h
new file mode 100644
index 0000000..55808f4
--- /dev/null
+++ b/exynos4/hal/include/sec_utils.h
@@ -0,0 +1,298 @@
+/*
+ * Copyright@ Samsung Electronics Co. LTD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+#ifndef __SAMSUNG_SYSLSI_SEC_COMMON_H__
+#define __SAMSUNG_SYSLSI_SEC_COMMON_H__
+
+//---------------------------------------------------------//
+// Include
+//---------------------------------------------------------//
+
+#include <hardware/hardware.h>
+#include "sec_format.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <linux/videodev2.h>
+#include "videodev2_samsung.h"
+
+#ifdef __cplusplus
+}
+#endif
+
+//---------------------------------------------------------//
+// Common structure                                        //
+//---------------------------------------------------------//
+struct ADDRS {
+    unsigned int addr_y;
+    unsigned int addr_cbcr;
+    unsigned int buf_idx;
+    unsigned int reserved;
+};
+
+//---------------------------------------------------------//
+// Common function                                         //
+//---------------------------------------------------------//
+inline int HAL_PIXEL_FORMAT_2_V4L2_PIX(int HAL_PIXEL_FORMAT)
+{
+    int V4L2_PIX = -1;
+
+    switch (HAL_PIXEL_FORMAT) {
+    case HAL_PIXEL_FORMAT_RGBA_8888:
+    case HAL_PIXEL_FORMAT_RGBX_8888:
+        V4L2_PIX = V4L2_PIX_FMT_RGB32;
+        break;
+
+    case HAL_PIXEL_FORMAT_RGB_888:
+        V4L2_PIX = V4L2_PIX_FMT_RGB24;
+        break;
+
+    case HAL_PIXEL_FORMAT_RGB_565:
+        V4L2_PIX = V4L2_PIX_FMT_RGB565;
+        break;
+
+    case HAL_PIXEL_FORMAT_BGRA_8888:
+        V4L2_PIX = V4L2_PIX_FMT_RGB32;
+        break;
+
+    case HAL_PIXEL_FORMAT_RGBA_5551:
+        V4L2_PIX = V4L2_PIX_FMT_RGB555X;
+        break;
+
+    case HAL_PIXEL_FORMAT_RGBA_4444:
+        V4L2_PIX = V4L2_PIX_FMT_RGB444;
+        break;
+
+    case HAL_PIXEL_FORMAT_YV12:
+    case HAL_PIXEL_FORMAT_YCbCr_420_P:
+        V4L2_PIX = V4L2_PIX_FMT_YUV420;
+        break;
+
+    case HAL_PIXEL_FORMAT_YCbCr_422_SP:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_422_SP:
+        V4L2_PIX = V4L2_PIX_FMT_NV61;
+        break;
+
+    case HAL_PIXEL_FORMAT_YCbCr_420_SP:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP:
+        V4L2_PIX = V4L2_PIX_FMT_NV12;
+        break;
+
+    case HAL_PIXEL_FORMAT_YCbCr_422_I:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_422_I:
+        V4L2_PIX = V4L2_PIX_FMT_YUYV;
+        break;
+
+    case HAL_PIXEL_FORMAT_YCbCr_422_P:
+        V4L2_PIX = V4L2_PIX_FMT_YUV422P;
+        break;
+
+    case HAL_PIXEL_FORMAT_CbYCrY_422_I:
+    case HAL_PIXEL_FORMAT_CUSTOM_CbYCrY_422_I:
+        V4L2_PIX = V4L2_PIX_FMT_UYVY;
+        break;
+
+    case HAL_PIXEL_FORMAT_YCrCb_422_SP:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCrCb_422_SP:
+        V4L2_PIX = V4L2_PIX_FMT_NV16;
+        break;
+
+    case HAL_PIXEL_FORMAT_YCrCb_420_SP:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCrCb_420_SP:
+        V4L2_PIX = V4L2_PIX_FMT_NV21;
+        break;
+
+    case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP_TILED:
+        V4L2_PIX = V4L2_PIX_FMT_NV12T;
+        break;
+
+   case HAL_PIXEL_FORMAT_CUSTOM_YCrCb_422_I:
+        V4L2_PIX = V4L2_PIX_FMT_YVYU;
+        break;
+
+   case HAL_PIXEL_FORMAT_CUSTOM_CrYCbY_422_I:
+        V4L2_PIX = V4L2_PIX_FMT_VYUY;
+        break;
+
+    default:
+        LOGE("%s::unmatched HAL_PIXEL_FORMAT color_space(0x%x)\n",
+                __func__, HAL_PIXEL_FORMAT);
+        break;
+    }
+
+    return V4L2_PIX;
+}
+
+inline int V4L2_PIX_2_HAL_PIXEL_FORMAT(int V4L2_PIX)
+{
+    int HAL_PIXEL_FORMAT = -1;
+
+    switch (V4L2_PIX) {
+    case V4L2_PIX_FMT_RGB32:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_RGBA_8888;
+        break;
+
+    case V4L2_PIX_FMT_RGB24:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_RGB_888;
+        break;
+
+    case V4L2_PIX_FMT_RGB565:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_RGB_565;
+        break;
+
+    case V4L2_PIX_FMT_BGR32:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_BGRA_8888;
+        break;
+
+    case V4L2_PIX_FMT_RGB555X:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_RGBA_5551;
+        break;
+
+    case V4L2_PIX_FMT_RGB444:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_RGBA_4444;
+        break;
+
+    case V4L2_PIX_FMT_YUV420:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_YCbCr_420_P;
+        break;
+
+    case V4L2_PIX_FMT_NV16:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_CUSTOM_YCrCb_422_SP;
+        break;
+
+    case V4L2_PIX_FMT_NV12:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP;
+        break;
+
+    case V4L2_PIX_FMT_YUYV:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_CUSTOM_YCbCr_422_I;
+        break;
+
+    case V4L2_PIX_FMT_YUV422P:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_YCbCr_422_P;
+        break;
+
+    case V4L2_PIX_FMT_UYVY:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_CUSTOM_CbYCrY_422_I;
+        break;
+
+    case V4L2_PIX_FMT_NV21:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_CUSTOM_YCrCb_420_SP;
+        break;
+
+    case V4L2_PIX_FMT_NV12T:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP_TILED;
+        break;
+
+    case V4L2_PIX_FMT_NV61:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_CUSTOM_YCbCr_422_SP;
+        break;
+
+    case V4L2_PIX_FMT_YVYU:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_CUSTOM_YCrCb_422_I;
+        break;
+
+    case V4L2_PIX_FMT_VYUY:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_CUSTOM_CrYCbY_422_I;
+        break;
+
+    default:
+        LOGE("%s::unmatched V4L2_PIX color_space(%d)\n",
+                __func__, V4L2_PIX);
+        break;
+    }
+
+    return HAL_PIXEL_FORMAT;
+}
+
+#define ALIGN_TO_32B(x)   ((((x) + (1 <<  5) - 1) >>  5) <<  5)
+#define ALIGN_TO_128B(x)  ((((x) + (1 <<  7) - 1) >>  7) <<  7)
+#define ALIGN_TO_8KB(x)   ((((x) + (1 << 13) - 1) >> 13) << 13)
+
+#define GET_32BPP_FRAME_SIZE(w, h)  (((w) * (h)) << 2)
+#define GET_24BPP_FRAME_SIZE(w, h)  (((w) * (h)) * 3)
+#define GET_16BPP_FRAME_SIZE(w, h)  (((w) * (h)) << 1)
+
+inline unsigned int FRAME_SIZE(int HAL_PIXEL_FORMAT, int w, int h)
+{
+    unsigned int frame_size = 0;
+    unsigned int size       = 0;
+
+    switch (HAL_PIXEL_FORMAT) {
+    // 16bpp
+    case HAL_PIXEL_FORMAT_RGB_565:
+    case HAL_PIXEL_FORMAT_RGBA_5551:
+    case HAL_PIXEL_FORMAT_RGBA_4444:
+        frame_size = GET_16BPP_FRAME_SIZE(w, h);
+        break;
+
+    // 24bpp
+    case HAL_PIXEL_FORMAT_RGB_888:
+        frame_size = GET_24BPP_FRAME_SIZE(w, h);
+        break;
+
+    // 32bpp
+    case HAL_PIXEL_FORMAT_RGBA_8888:
+    case HAL_PIXEL_FORMAT_BGRA_8888:
+    case HAL_PIXEL_FORMAT_RGBX_8888:
+        frame_size = GET_32BPP_FRAME_SIZE(w, h);
+        break;
+
+    // 12bpp
+    case HAL_PIXEL_FORMAT_YV12:
+    case HAL_PIXEL_FORMAT_YCrCb_420_SP:
+    case HAL_PIXEL_FORMAT_YCbCr_420_P:
+    case HAL_PIXEL_FORMAT_YCbCr_420_I:
+    case HAL_PIXEL_FORMAT_CbYCrY_420_I:
+    case HAL_PIXEL_FORMAT_YCbCr_420_SP:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCrCb_420_SP:
+        size = w * h;
+        frame_size = size + ((size >> 2) << 1);
+        break;
+
+    case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP_TILED:
+        frame_size =   ALIGN_TO_8KB(ALIGN_TO_128B(w) * ALIGN_TO_32B(h))
+                     + ALIGN_TO_8KB(ALIGN_TO_128B(w) * ALIGN_TO_32B(h >> 1));
+        break;
+
+    // 16bpp
+    case HAL_PIXEL_FORMAT_YCbCr_422_SP:
+    case HAL_PIXEL_FORMAT_YCbCr_422_I:
+    case HAL_PIXEL_FORMAT_YCbCr_422_P:
+    case HAL_PIXEL_FORMAT_CbYCrY_422_I:
+    case HAL_PIXEL_FORMAT_YCrCb_422_SP:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_422_SP:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCrCb_422_SP:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_422_I:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCrCb_422_I:
+    case HAL_PIXEL_FORMAT_CUSTOM_CbYCrY_422_I:
+    case HAL_PIXEL_FORMAT_CUSTOM_CrYCbY_422_I:
+        frame_size = GET_16BPP_FRAME_SIZE(w, h);
+        break;
+
+    default:
+        LOGD("%s::no matching source colorformat(0x%x), w(%d), h(%d) fail\n",
+                __func__, HAL_PIXEL_FORMAT, w, h);
+        break;
+    }
+
+    return frame_size;
+}
+
+#endif //__SAMSUNG_SYSLSI_SEC_COMMON_H__
\ No newline at end of file
diff --git a/exynos4/hal/include/sec_utils_v4l2.h b/exynos4/hal/include/sec_utils_v4l2.h
new file mode 100644
index 0000000..3aa7c35
--- /dev/null
+++ b/exynos4/hal/include/sec_utils_v4l2.h
@@ -0,0 +1,327 @@
+/*
+ * Copyright@ Samsung Electronics Co. LTD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+
+/*
+ * file sec_utils_v4l2.h
+ * brief header file for sec_utils_v4l2.h
+ * author Sangwoo, Park(sw5771.park@samsung.com)
+ * date 2011/06/02
+ *
+ * Revision History:
+ * - 2010/06/03 : Sangwoo, Park(sw5771.park@samsung.com)
+ * Initial version
+ *
+ * - 2011/12/07 : Jeonghee, Kim(jhhhh.kim@samsung.com)
+ * use V4L2_PIX_FMT_NV12M as HAL_PIXEL_FORMAT_YCbCr_420_SP, HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP
+ *
+ * - 2011/12/07 : Hyeonmyeong Choi( hyeon.choi@samsung.com)
+ * Add V4L2_PIX_FMT_YVU420M
+ *
+ */
+
+
+#ifndef __SAMSUNG_SYSLSI_SEC_COMMON_H__
+#define __SAMSUNG_SYSLSI_SEC_COMMON_H__
+
+//---------------------------------------------------------//
+// Include
+//---------------------------------------------------------//
+
+#include <hardware/hardware.h>
+#include "sec_format.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "videodev2.h"
+
+#ifdef __cplusplus
+}
+#endif
+
+//---------------------------------------------------------//
+// Common structure                                        //
+//---------------------------------------------------------//
+struct ADDRS {
+    unsigned int addr_y;
+    unsigned int addr_cbcr;
+    unsigned int buf_idx;
+    unsigned int reserved;
+};
+
+//---------------------------------------------------------//
+// Common function                                         //
+//---------------------------------------------------------//
+inline int HAL_PIXEL_FORMAT_2_V4L2_PIX(int HAL_PIXEL_FORMAT)
+{
+    int V4L2_PIX = -1;
+
+    switch (HAL_PIXEL_FORMAT) {
+    case HAL_PIXEL_FORMAT_RGBA_8888:
+    case HAL_PIXEL_FORMAT_RGBX_8888:
+        V4L2_PIX = V4L2_PIX_FMT_RGB32;
+        break;
+
+    case HAL_PIXEL_FORMAT_RGB_888:
+        V4L2_PIX = V4L2_PIX_FMT_RGB24;
+        break;
+
+    case HAL_PIXEL_FORMAT_RGB_565:
+        V4L2_PIX = V4L2_PIX_FMT_RGB565;
+        break;
+
+    case HAL_PIXEL_FORMAT_BGRA_8888:
+#if defined(BOARD_USE_V4L2)
+        V4L2_PIX = V4L2_PIX_FMT_BGR32;
+#else
+        V4L2_PIX = V4L2_PIX_FMT_RGB32;
+#endif
+        break;
+
+    case HAL_PIXEL_FORMAT_RGBA_5551:
+        V4L2_PIX = V4L2_PIX_FMT_RGB555X;
+        break;
+
+    case HAL_PIXEL_FORMAT_RGBA_4444:
+        V4L2_PIX = V4L2_PIX_FMT_RGB444;
+        break;
+
+    case HAL_PIXEL_FORMAT_YV12:
+    case HAL_PIXEL_FORMAT_YCbCr_420_P:
+        V4L2_PIX = V4L2_PIX_FMT_YUV420M;
+        break;
+
+    case HAL_PIXEL_FORMAT_YCbCr_422_SP:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_422_SP:
+        V4L2_PIX = V4L2_PIX_FMT_NV61;
+        break;
+
+    case HAL_PIXEL_FORMAT_YCbCr_420_SP:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP:
+        V4L2_PIX = V4L2_PIX_FMT_NV12M;
+        break;
+
+    case HAL_PIXEL_FORMAT_YCbCr_422_I:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_422_I:
+        V4L2_PIX = V4L2_PIX_FMT_YUYV;
+        break;
+
+    case HAL_PIXEL_FORMAT_YCbCr_422_P:
+        V4L2_PIX = V4L2_PIX_FMT_YUV422P;
+        break;
+
+    case HAL_PIXEL_FORMAT_CbYCrY_422_I:
+    case HAL_PIXEL_FORMAT_CUSTOM_CbYCrY_422_I:
+        V4L2_PIX = V4L2_PIX_FMT_UYVY;
+        break;
+
+    case HAL_PIXEL_FORMAT_YCrCb_422_SP:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCrCb_422_SP:
+        V4L2_PIX = V4L2_PIX_FMT_NV16;
+        break;
+
+    case HAL_PIXEL_FORMAT_YCrCb_420_SP:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCrCb_420_SP:
+        V4L2_PIX = V4L2_PIX_FMT_NV21;
+        break;
+
+    case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP_TILED:
+        V4L2_PIX = V4L2_PIX_FMT_NV12MT;
+        break;
+
+   case HAL_PIXEL_FORMAT_CUSTOM_YCrCb_422_I:
+        V4L2_PIX = V4L2_PIX_FMT_YVYU;
+        break;
+
+   case HAL_PIXEL_FORMAT_CUSTOM_CrYCbY_422_I:
+        V4L2_PIX = V4L2_PIX_FMT_VYUY;
+        break;
+
+    default:
+        LOGE("%s::unmatched HAL_PIXEL_FORMAT color_space(0x%x)\n",
+                __func__, HAL_PIXEL_FORMAT);
+        break;
+    }
+
+    return V4L2_PIX;
+}
+
+inline int V4L2_PIX_2_HAL_PIXEL_FORMAT(int V4L2_PIX)
+{
+    int HAL_PIXEL_FORMAT = -1;
+
+    switch (V4L2_PIX) {
+    case V4L2_PIX_FMT_RGB32:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_RGBA_8888;
+        break;
+
+    case V4L2_PIX_FMT_RGB24:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_RGB_888;
+        break;
+
+    case V4L2_PIX_FMT_RGB565:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_RGB_565;
+        break;
+
+    case V4L2_PIX_FMT_BGR32:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_BGRA_8888;
+        break;
+
+    case V4L2_PIX_FMT_RGB555X:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_RGBA_5551;
+        break;
+
+    case V4L2_PIX_FMT_RGB444:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_RGBA_4444;
+        break;
+
+    case V4L2_PIX_FMT_YUV420:
+    case V4L2_PIX_FMT_YUV420M:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_YCbCr_420_P;
+        break;
+
+    case V4L2_PIX_FMT_YVU420:
+    case V4L2_PIX_FMT_YVU420M:
+         HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_YV12;
+         break;
+
+    case V4L2_PIX_FMT_NV16:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_CUSTOM_YCrCb_422_SP;
+        break;
+
+    case V4L2_PIX_FMT_NV12:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP;
+        break;
+
+    case V4L2_PIX_FMT_YUYV:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_CUSTOM_YCbCr_422_I;
+        break;
+
+    case V4L2_PIX_FMT_YUV422P:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_YCbCr_422_P;
+        break;
+
+    case V4L2_PIX_FMT_UYVY:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_CUSTOM_CbYCrY_422_I;
+        break;
+
+    case V4L2_PIX_FMT_NV21:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_CUSTOM_YCrCb_420_SP;
+        break;
+    case V4L2_PIX_FMT_NV12MT:
+
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP_TILED;
+        break;
+
+    case V4L2_PIX_FMT_NV61:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_CUSTOM_YCbCr_422_SP;
+        break;
+
+    case V4L2_PIX_FMT_YVYU:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_CUSTOM_YCrCb_422_I;
+        break;
+
+    case V4L2_PIX_FMT_VYUY:
+        HAL_PIXEL_FORMAT = HAL_PIXEL_FORMAT_CUSTOM_CrYCbY_422_I;
+        break;
+
+    default:
+        LOGE("%s::unmatched V4L2_PIX color_space(%d)\n",
+                __func__, V4L2_PIX);
+        break;
+    }
+
+    return HAL_PIXEL_FORMAT;
+}
+
+#define ALIGN_TO_32B(x)   ((((x) + (1 <<  5) - 1) >>  5) <<  5)
+#define ALIGN_TO_128B(x)  ((((x) + (1 <<  7) - 1) >>  7) <<  7)
+#define ALIGN_TO_8KB(x)   ((((x) + (1 << 13) - 1) >> 13) << 13)
+#define ALIGN(x, a)       (((x) + (a) - 1) & ~((a) - 1))
+
+#define GET_32BPP_FRAME_SIZE(w, h)  (((w) * (h)) << 2)
+#define GET_24BPP_FRAME_SIZE(w, h)  (((w) * (h)) * 3)
+#define GET_16BPP_FRAME_SIZE(w, h)  (((w) * (h)) << 1)
+
+inline unsigned int FRAME_SIZE(int HAL_PIXEL_FORMAT, int w, int h)
+{
+    unsigned int frame_size = 0;
+    unsigned int size       = 0;
+
+    switch (HAL_PIXEL_FORMAT) {
+    // 16bpp
+    case HAL_PIXEL_FORMAT_RGB_565:
+    case HAL_PIXEL_FORMAT_RGBA_5551:
+    case HAL_PIXEL_FORMAT_RGBA_4444:
+        frame_size = GET_16BPP_FRAME_SIZE(w, h);
+        break;
+
+    // 24bpp
+    case HAL_PIXEL_FORMAT_RGB_888:
+        frame_size = GET_24BPP_FRAME_SIZE(w, h);
+        break;
+
+    // 32bpp
+    case HAL_PIXEL_FORMAT_RGBA_8888:
+    case HAL_PIXEL_FORMAT_BGRA_8888:
+    case HAL_PIXEL_FORMAT_RGBX_8888:
+        frame_size = GET_32BPP_FRAME_SIZE(w, h);
+        break;
+
+    // 12bpp
+    case HAL_PIXEL_FORMAT_YV12:
+    case HAL_PIXEL_FORMAT_YCrCb_420_SP:
+    case HAL_PIXEL_FORMAT_YCbCr_420_P:
+    case HAL_PIXEL_FORMAT_YCbCr_420_I:
+    case HAL_PIXEL_FORMAT_CbYCrY_420_I:
+    case HAL_PIXEL_FORMAT_YCbCr_420_SP:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCrCb_420_SP:
+        size = w * h;
+        frame_size = size + ((size >> 2) << 1);
+        break;
+
+    case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_420_SP_TILED:
+        frame_size =   ALIGN_TO_8KB(ALIGN_TO_128B(w) * ALIGN_TO_32B(h))
+                     + ALIGN_TO_8KB(ALIGN_TO_128B(w) * ALIGN_TO_32B(h >> 1));
+        break;
+
+    // 16bpp
+    case HAL_PIXEL_FORMAT_YCbCr_422_SP:
+    case HAL_PIXEL_FORMAT_YCbCr_422_I:
+    case HAL_PIXEL_FORMAT_YCbCr_422_P:
+    case HAL_PIXEL_FORMAT_CbYCrY_422_I:
+    case HAL_PIXEL_FORMAT_YCrCb_422_SP:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_422_SP:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCrCb_422_SP:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCbCr_422_I:
+    case HAL_PIXEL_FORMAT_CUSTOM_YCrCb_422_I:
+    case HAL_PIXEL_FORMAT_CUSTOM_CbYCrY_422_I:
+    case HAL_PIXEL_FORMAT_CUSTOM_CrYCbY_422_I:
+        frame_size = GET_16BPP_FRAME_SIZE(w, h);
+        break;
+
+    default:
+        LOGD("%s::no matching source colorformat(0x%x), w(%d), h(%d) fail\n",
+                __func__, HAL_PIXEL_FORMAT, w, h);
+        break;
+    }
+
+    return frame_size;
+}
+
+#endif //__SAMSUNG_SYSLSI_SEC_COMMON_H__
diff --git a/exynos4/hal/include/swconverter.h b/exynos4/hal/include/swconverter.h
new file mode 100644
index 0000000..eb2eae3
--- /dev/null
+++ b/exynos4/hal/include/swconverter.h
@@ -0,0 +1,462 @@
+/*
+ *
+ * Copyright 2012 Samsung Electronics S.LSI Co. LTD
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * @file    swconverter.h
+ * @brief   SEC_OMX specific define. It support MFC 5.x tiled.
+ *   NV12T(tiled) layout:
+ *   Each element is not pixel. It is 64x32 pixel block.
+ *   uv pixel block is interleaved as u v u v u v ...
+ *   y1    y2    y7    y8    y9    y10   y15   y16
+ *   y3    y4    y5    y6    y11   y12   y13   y14
+ *   y17   y18   y23   y24   y25   y26   y31   y32
+ *   y19   y20   y21   y22   y27   y28   y29   y30
+ *   uv1   uv2   uv7   uv8   uv9   uv10  uv15  uv16
+ *   uv3   uv4   uv5   uv6   uv11  uv12  uv13  uv14
+ *   YUV420Planar(linear) layout:
+ *   Each element is not pixel. It is 64x32 pixel block.
+ *   y1    y2    y3    y4    y5    y6    y7    y8
+ *   y9    y10   y11   y12   y13   y14   y15   y16
+ *   y17   y18   y19   y20   y21   y22   y23   y24
+ *   y25   y26   y27   y28   y29   y30   y31   y32
+ *   u1    u2    u3    u4    u5    u6    u7    u8
+ *   v1    v2    v3    v4    v5    v6    v7    v8
+ *   YUV420Semiplanar(linear) layout:
+ *   Each element is not pixel. It is 64x32 pixel block.
+ *   uv pixel block is interleaved as u v u v u v ...
+ *   y1    y2    y3    y4    y5    y6    y7    y8
+ *   y9    y10   y11   y12   y13   y14   y15   y16
+ *   y17   y18   y19   y20   y21   y22   y23   y24
+ *   y25   y26   y27   y28   y29   y30   y31   y32
+ *   uv1   uv2   uv3   uv4   uv5   uv6   uv7   uv8
+ *   uv9   uv10  uv11  uv12  uv13  uv14  uv15  uv16
+ * @author  ShinWon Lee (shinwon.lee@samsung.com)
+ * @version 1.0
+ * @history
+ *   2012.02.01 : Create
+ */
+
+#ifndef SW_CONVERTOR_H_
+#define SW_CONVERTOR_H_
+
+/*--------------------------------------------------------------------------------*/
+/* Format Conversion API                                                          */
+/*--------------------------------------------------------------------------------*/
+/*
+ * De-interleaves src to dest1, dest2
+ *
+ * @param dest1
+ *   Address of de-interleaved data[out]
+ *
+ * @param dest2
+ *   Address of de-interleaved data[out]
+ *
+ * @param src
+ *   Address of interleaved data[in]
+ *
+ * @param src_size
+ *   Size of interleaved data[in]
+ */
+void csc_deinterleave_memcpy(
+    unsigned char *dest1,
+    unsigned char *dest2,
+    unsigned char *src,
+    unsigned int src_size);
+
+/*
+ * Interleaves src1, src2 to dest
+ *
+ * @param dest
+ *   Address of interleaved data[out]
+ *
+ * @param src1
+ *   Address of de-interleaved data[in]
+ *
+ * @param src2
+ *   Address of de-interleaved data[in]
+ *
+ * @param src_size
+ *   Size of de-interleaved data[in]
+ */
+void csc_interleave_memcpy(
+    unsigned char *dest,
+    unsigned char *src1,
+    unsigned char *src2,
+    unsigned int src_size);
+
+/* C Code */
+/*
+ * Converts tiled data to linear
+ * 1. y of nv12t to y of yuv420p
+ * 2. y of nv12t to y of yuv420s
+ *
+ * @param dst
+ *   y address of yuv420[out]
+ *
+ * @param src
+ *   y address of nv12t[in]
+ *
+ * @param yuv420_width
+ *   real width of yuv420[in]
+ *   it should be even
+ *
+ * @param yuv420_height
+ *   real height of yuv420[in]
+ *   it should be even.
+ *
+ */
+void csc_tiled_to_linear_y(
+    unsigned char *y_dst,
+    unsigned char *y_src,
+    unsigned int width,
+    unsigned int height);
+
+/*
+ * Converts tiled data to linear
+ * 1. uv of nv12t to y of yuv420s
+ *
+ * @param dst
+ *   uv address of yuv420s[out]
+ *
+ * @param src
+ *   uv address of nv12t[in]
+ *
+ * @param yuv420_width
+ *   real width of yuv420s[in]
+ *
+ * @param yuv420_height
+ *   real height of yuv420s[in]
+ *
+ */
+void csc_tiled_to_linear_uv(
+    unsigned char *uv_dst,
+    unsigned char *uv_src,
+    unsigned int width,
+    unsigned int height);
+
+/*
+ * Converts tiled data to linear
+ * 1. uv of nt12t to uv of yuv420p
+ *
+ * @param u_dst
+ *   u address of yuv420p[out]
+ *
+ * @param v_dst
+ *   v address of yuv420p[out]
+ *
+ * @param uv_src
+ *   uv address of nt12t[in]
+ *
+ * @param yuv420_width
+ *   real width of yuv420p[in]
+ *
+ * @param yuv420_height
+ *   real height of yuv420p[in]
+ */
+void csc_tiled_to_linear_uv_deinterleave(
+    unsigned char *u_dst,
+    unsigned char *v_dst,
+    unsigned char *uv_src,
+    unsigned int width,
+    unsigned int height);
+
+/*
+ * Converts linear data to tiled
+ * 1. y of yuv420 to y of nv12t
+ *
+ * @param dst
+ *   y address of nv12t[out]
+ *
+ * @param src
+ *   y address of yuv420[in]
+ *
+ * @param yuv420_width
+ *   real width of yuv420[in]
+ *   it should be even
+ *
+ * @param yuv420_height
+ *   real height of yuv420[in]
+ *   it should be even.
+ *
+ */
+void csc_linear_to_tiled_y(
+    unsigned char *y_dst,
+    unsigned char *y_src,
+    unsigned int width,
+    unsigned int height);
+
+/*
+ * Converts and interleaves linear data to tiled
+ * 1. uv of nv12t to uv of yuv420
+ *
+ * @param dst
+ *   uv address of nv12t[out]
+ *
+ * @param src
+ *   u address of yuv420[in]
+ *
+ * @param src
+ *   v address of yuv420[in]
+ *
+ * @param yuv420_width
+ *   real width of yuv420[in]
+ *
+ * @param yuv420_height
+ *   real height of yuv420[in]
+ *
+ */
+void csc_linear_to_tiled_uv(
+    unsigned char *uv_dst,
+    unsigned char *u_src,
+    unsigned char *v_src,
+    unsigned int width,
+    unsigned int height);
+
+/*
+ * Converts tiled data to linear for mfc 6.x
+ * 1. Y of NV12T to Y of YUV420P
+ * 2. Y of NV12T to Y of YUV420S
+ *
+ * @param dst
+ *   Y address of YUV420[out]
+ *
+ * @param src
+ *   Y address of NV12T[in]
+ *
+ * @param yuv420_width
+ *   real width of YUV420[in]
+ *
+ * @param yuv420_height
+ *   Y: real height of YUV420[in]
+ *
+ */
+void csc_tiled_to_linear_y_neon(
+    unsigned char *y_dst,
+    unsigned char *y_src,
+    unsigned int width,
+    unsigned int height);
+
+/*
+ * Converts tiled data to linear for mfc 6.x
+ * 1. UV of NV12T to Y of YUV420S
+ *
+ * @param u_dst
+ *   UV plane address of YUV420P[out]
+ *
+ * @param nv12t_src
+ *   Y or UV plane address of NV12T[in]
+ *
+ * @param yuv420_width
+ *   real width of YUV420[in]
+ *
+ * @param yuv420_height
+ *   (real height)/2 of YUV420[in]
+ */
+void csc_tiled_to_linear_uv_neon(
+    unsigned char *uv_dst,
+    unsigned char *uv_src,
+    unsigned int width,
+    unsigned int height);
+
+/*
+ * Converts tiled data to linear for mfc 6.x
+ * Deinterleave src to u_dst, v_dst
+ * 1. UV of NV12T to Y of YUV420P
+ *
+ * @param u_dst
+ *   U plane address of YUV420P[out]
+ *
+ * @param v_dst
+ *   V plane address of YUV420P[out]
+ *
+ * @param nv12t_src
+ *   Y or UV plane address of NV12T[in]
+ *
+ * @param yuv420_width
+ *   real width of YUV420[in]
+ *
+ * @param yuv420_height
+ *   (real height)/2 of YUV420[in]
+ */
+void csc_tiled_to_linear_uv_deinterleave_neon(
+    unsigned char *u_dst,
+    unsigned char *v_dst,
+    unsigned char *uv_src,
+    unsigned int width,
+    unsigned int height);
+
+/*
+ * Converts linear data to tiled
+ * 1. y of yuv420 to y of nv12t
+ *
+ * @param dst
+ *   y address of nv12t[out]
+ *
+ * @param src
+ *   y address of yuv420[in]
+ *
+ * @param yuv420_width
+ *   real width of yuv420[in]
+ *   it should be even
+ *
+ * @param yuv420_height
+ *   real height of yuv420[in]
+ *   it should be even.
+ *
+ */
+void csc_linear_to_tiled_y_neon(
+    unsigned char *y_dst,
+    unsigned char *y_src,
+    unsigned int width,
+    unsigned int height);
+
+/*
+ * Converts and interleaves linear data to tiled
+ * 1. uv of nv12t to uv of yuv420
+ *
+ * @param dst
+ *   uv address of nv12t[out]
+ *
+ * @param src
+ *   u address of yuv420[in]
+ *
+ * @param src
+ *   v address of yuv420[in]
+ *
+ * @param yuv420_width
+ *   real width of yuv420[in]
+ *
+ * @param yuv420_height
+ *   real height of yuv420[in]
+ *
+ */
+void csc_linear_to_tiled_uv_neon(
+    unsigned char *uv_dst,
+    unsigned char *u_src,
+    unsigned char *v_src,
+    unsigned int width,
+    unsigned int height);
+
+/*
+ * Converts RGB565 to YUV420P
+ *
+ * @param y_dst
+ *   Y plane address of YUV420P[out]
+ *
+ * @param u_dst
+ *   U plane address of YUV420P[out]
+ *
+ * @param v_dst
+ *   V plane address of YUV420P[out]
+ *
+ * @param rgb_src
+ *   Address of RGB565[in]
+ *
+ * @param width
+ *   Width of RGB565[in]
+ *
+ * @param height
+ *   Height of RGB565[in]
+ */
+void csc_RGB565_to_YUV420P(
+    unsigned char *y_dst,
+    unsigned char *u_dst,
+    unsigned char *v_dst,
+    unsigned char *rgb_src,
+    unsigned int width,
+    unsigned int height);
+
+/*
+ * Converts RGB565 to YUV420S
+ *
+ * @param y_dst
+ *   Y plane address of YUV420S[out]
+ *
+ * @param uv_dst
+ *   UV plane address of YUV420S[out]
+ *
+ * @param rgb_src
+ *   Address of RGB565[in]
+ *
+ * @param width
+ *   Width of RGB565[in]
+ *
+ * @param height
+ *   Height of RGB565[in]
+ */
+void csc_RGB565_to_YUV420SP(
+    unsigned char *y_dst,
+    unsigned char *uv_dst,
+    unsigned char *rgb_src,
+    unsigned int width,
+    unsigned int height);
+
+/*
+ * Converts ARGB8888 to YUV420P
+ *
+ * @param y_dst
+ *   Y plane address of YUV420P[out]
+ *
+ * @param u_dst
+ *   U plane address of YUV420P[out]
+ *
+ * @param v_dst
+ *   V plane address of YUV420P[out]
+ *
+ * @param rgb_src
+ *   Address of ARGB8888[in]
+ *
+ * @param width
+ *   Width of ARGB8888[in]
+ *
+ * @param height
+ *   Height of ARGB8888[in]
+ */
+void csc_ARGB8888_to_YUV420P(
+    unsigned char *y_dst,
+    unsigned char *u_dst,
+    unsigned char *v_dst,
+    unsigned char *rgb_src,
+    unsigned int width,
+    unsigned int height);
+
+/*
+ * Converts ARGB888 to YUV420SP
+ *
+ * @param y_dst
+ *   Y plane address of YUV420SP[out]
+ *
+ * @param uv_dst
+ *   UV plane address of YUV420SP[out]
+ *
+ * @param rgb_src
+ *   Address of ARGB8888[in]
+ *
+ * @param width
+ *   Width of ARGB8888[in]
+ *
+ * @param height
+ *   Height of ARGB8888[in]
+ */
+void csc_ARGB8888_to_YUV420SP(
+    unsigned char *y_dst,
+    unsigned char *uv_dst,
+    unsigned char *rgb_src,
+    unsigned int width,
+    unsigned int height);
+
+#endif /*COLOR_SPACE_CONVERTOR_H_*/
diff --git a/exynos4/hal/include/video.h b/exynos4/hal/include/video.h
new file mode 100644
index 0000000..0565b85
--- /dev/null
+++ b/exynos4/hal/include/video.h
@@ -0,0 +1,363 @@
+#ifndef _VIDEO_H_
+#define _VIDEO_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef __HDMI_VIDEO_VIDEOFORMAT__
+#define __HDMI_VIDEO_VIDEOFORMAT__
+/**
+ * @enum VideoFormat
+ * Video format
+ */
+enum VideoFormat {
+    /** 640x480p\@60Hz */
+    v640x480p_60Hz = 0,
+    /** 720x480p\@60Hz */
+    v720x480p_60Hz,
+    /** 1280x700p\@60Hz */
+    v1280x720p_60Hz,
+    /** 1920x1080i\@60Hz */
+    v1920x1080i_60Hz,
+    /** 720x480i\@60Hz */
+    v720x480i_60Hz,
+    /** 720x240p\@60Hz */
+    v720x240p_60Hz,
+    /** 2880x480i\@60Hz */
+    v2880x480i_60Hz,
+    /** 2880x240p\@60Hz */
+    v2880x240p_60Hz,
+    /** 1440x480p\@60Hz */
+    v1440x480p_60Hz,
+    /** 1920x1080p\@60Hz */
+    v1920x1080p_60Hz,
+    /** 720x576p\@60Hz */
+    v720x576p_50Hz,
+    /** 1280x720p\@50Hz */
+    v1280x720p_50Hz,
+    /** 1920x1080i\@50Hz (V total = 1125) */
+    v1920x1080i_50Hz,
+    /** 720x576i\@50Hz */
+    v720x576i_50Hz,
+    /** 720x288p\@50Hz */
+    v720x288p_50Hz,
+    /** 2880x576i\@50Hz */
+    v2880x576i_50Hz,
+    /** 2880x288p\@50Hz */
+    v2880x288p_50Hz,
+    /** 1440x576p\@50Hz */
+    v1440x576p_50Hz,
+    /** 1920x1080p\@50Hz */
+    v1920x1080p_50Hz,
+    /** 1920x1080p\@24Hz */
+    v1920x1080p_24Hz,
+    /** 1920x1080p\@25Hz */
+    v1920x1080p_25Hz,
+    /** 1920x1080p\@30Hz */
+    v1920x1080p_30Hz,
+    /** 2880x480p\@60Hz */
+    v2880x480p_60Hz,
+    /** 2880x576p\@60Hz */
+    v2880x576p_50Hz,
+    /** 1920x1080i\@50Hz (V total = 1250) */
+    v1920x1080i_50Hz_1250,
+    /** 1920x1080i\@100Hz */
+    v1920x1080i_100Hz,
+    /** 1280x720p\@100Hz */
+    v1280x720p_100Hz,
+    /** 720x576p\@100Hz */
+    v720x576p_100Hz,
+    /** 720x576i\@100Hz */
+    v720x576i_100Hz,
+    /** 1920x1080i\@120Hz */
+    v1920x1080i_120Hz,
+    /** 1280x720p\@120Hz */
+    v1280x720p_120Hz,
+    /** 720x480p\@120Hz */
+    v720x480p_120Hz,
+    /** 720x480i\@120Hz */
+    v720x480i_120Hz,
+    /** 720x576p\@200Hz */
+    v720x576p_200Hz,
+    /** 720x576i\@200Hz */
+    v720x576i_200Hz,
+    /** 720x480p\@240Hz */
+    v720x480p_240Hz,
+    /** 720x480i\@240Hz */
+    v720x480i_240Hz,
+    /** 1280x720p\@24Hz */
+    v1280x720p_24Hz,
+    /** 1280x720p\@25Hz */
+    v1280x720p_25Hz,
+    /** 1280x720p\@30Hz */
+    v1280x720p_30Hz,
+    /** 1920x1080p\@120Hz */
+    v1920x1080p_120Hz,
+    /** 1920x1080p\@100Hz */
+    v1920x1080p_100Hz,
+    /** 4Kx2K\@30Hz     */
+    v4Kx2K_30Hz,
+};
+#endif /* __HDMI_VIDEO_VIDEOFORMAT__ */
+#ifndef __HDMI_VIDEO_COLORSPACE__
+#define __HDMI_VIDEO_COLORSPACE__
+/**
+ * @enum ColorSpace
+ * Color space of video stream.
+ */
+enum ColorSpace {
+    /** RGB color space */
+    HDMI_CS_RGB,
+    /** YCbCr 4:4:4 color space */
+    HDMI_CS_YCBCR444,
+    /** YCbCr 4:2:2 color space */
+    HDMI_CS_YCBCR422
+};
+#endif /* __HDMI_VIDEO_COLORSPACE__ */
+
+#ifndef __HDMI_VIDEO_COLORDEPTH__
+#define __HDMI_VIDEO_COLORDEPTH__
+/**
+ * @enum ColorDepth
+ * Color depth per pixel of video stream
+ */
+enum ColorDepth {
+    /** 36 bit color depth per pixel */
+    HDMI_CD_36,
+    /** 30 bit color depth per pixel */
+    HDMI_CD_30,
+    /** 24 bit color depth per pixel */
+    HDMI_CD_24
+};
+#endif /* __HDMI_VIDEO_COLORDEPTH__ */
+
+#ifndef __HDMI_VIDEO_HDMIMODE__
+#define __HDMI_VIDEO_HDMIMODE__
+/**
+ * @enum HDMIMode
+ * System mode
+ */
+enum HDMIMode {
+    /** DVI mode */
+    DVI = 0,
+    /** HDMI mode */
+    HDMI
+};
+#endif /* __HDMI_VIDEO_HDMIMODE__ */
+
+#ifndef __HDMI_VIDEO_PIXELLIMIT__
+#define __HDMI_VIDEO_PIXELLIMIT__
+/**
+ * @enum PixelLimit
+ * Pixel limitation of video stream
+ */
+enum PixelLimit {
+    /** Full range */
+    HDMI_FULL_RANGE,
+    /** Limit range for RGB color space */
+    HDMI_RGB_LIMIT_RANGE,
+    /** Limit range for YCbCr color space */
+    HDMI_YCBCR_LIMIT_RANGE
+};
+#endif /* __HDMI_VIDEO_PIXELLIMIT__ */
+
+#ifndef __HDMI_VIDEO_COLORIMETRY__
+#define __HDMI_VIDEO_COLORIMETRY__
+/**
+ * @enum HDMIColorimetry
+ * Colorimetry of video stream
+ */
+enum HDMIColorimetry {
+    /** Colorimetry is not defined */
+    HDMI_COLORIMETRY_NO_DATA,
+    /** ITU601 colorimetry */
+    HDMI_COLORIMETRY_ITU601,
+    /** ITU709 colorimetry */
+    HDMI_COLORIMETRY_ITU709,
+    /** Extended ITU601 colorimetry */
+    HDMI_COLORIMETRY_EXTENDED_xvYCC601,
+    /** Extended ITU709 colorimetry */
+    HDMI_COLORIMETRY_EXTENDED_xvYCC709
+};
+#endif /* __HDMI_VIDEO_COLORIMETRY__ */
+
+#ifndef __HDMI_VIDEO_PIXELASPECTRATIO__
+#define __HDMI_VIDEO_PIXELASPECTRATIO__
+/**
+ * @enum PixelAspectRatio
+ * Pixel aspect ratio of video stream
+ */
+enum PixelAspectRatio {
+    /** as picutre pixel ratio */
+    HDMI_PIXEL_RATIO_AS_PICTURE,
+    /** 4:3 pixel ratio */
+    HDMI_PIXEL_RATIO_4_3,
+    /** 16:9 pixel ratio */
+    HDMI_PIXEL_RATIO_16_9
+};
+#endif /* __HDMI_VIDEO_PIXELASPECTRATIO__ */
+
+#ifndef __HDMI_VIDEO_PIXELFREQUENCY__
+#define __HDMI_VIDEO_PIXELFREQUENCY__
+/**
+ * @enum PixelFreq
+ * Pixel Frequency
+ */
+enum PixelFreq {
+    /** 25.2 MHz pixel frequency */
+    PIXEL_FREQ_25_200 = 2520,
+    /** 25.175 MHz pixel frequency */
+    PIXEL_FREQ_25_175 = 2517,
+    /** 27 MHz pixel frequency */
+    PIXEL_FREQ_27 = 2700,
+    /** 27.027 MHz pixel frequency */
+    PIXEL_FREQ_27_027 = 2702,
+    /** 54 MHz pixel frequency */
+    PIXEL_FREQ_54 = 5400,
+    /** 54.054 MHz pixel frequency */
+    PIXEL_FREQ_54_054 = 5405,
+    /** 74.25 MHz pixel frequency */
+    PIXEL_FREQ_74_250 = 7425,
+    /** 74.176 MHz pixel frequency */
+    PIXEL_FREQ_74_176 = 7417,
+    /** 148.5 MHz pixel frequency */
+    PIXEL_FREQ_148_500 = 14850,
+    /** 148.352 MHz pixel frequency */
+    PIXEL_FREQ_148_352 = 14835,
+    /** 108.108 MHz pixel frequency */
+    PIXEL_FREQ_108_108 = 10810,
+    /** 72 MHz pixel frequency */
+    PIXEL_FREQ_72 = 7200,
+    /** 25 MHz pixel frequency */
+    PIXEL_FREQ_25 = 2500,
+    /** 65 MHz pixel frequency */
+    PIXEL_FREQ_65 = 6500,
+    /** 108 MHz pixel frequency */
+    PIXEL_FREQ_108 = 10800,
+    /** 162 MHz pixel frequency */
+    PIXEL_FREQ_162 = 16200,
+    /** 59.4 MHz pixel frequency */
+    PIXEL_FREQ_59_400 = 5940,
+};
+#endif /* __HDMI_VIDEO_PIXELFREQUENCY__ */
+
+#ifndef __HDMI_PHY_PIXELFREQUENCY__
+#define __HDMI_PHY_PIXELFREQUENCY__
+
+/**
+ * @enum PHYFreq
+ * PHY Frequency
+ */
+enum PHYFreq {
+    /** Not supported */
+    PHY_FREQ_NOT_SUPPORTED = -1,
+    /** 25.2 MHz pixel frequency */
+    PHY_FREQ_25_200 = 0,
+    /** 25.175 MHz pixel frequency */
+    PHY_FREQ_25_175,
+    /** 27 MHz pixel frequency */
+    PHY_FREQ_27,
+    /** 27.027 MHz pixel frequency */
+    PHY_FREQ_27_027,
+    /** 54 MHz pixel frequency */
+    PHY_FREQ_54,
+    /** 54.054 MHz pixel frequency */
+    PHY_FREQ_54_054,
+    /** 74.25 MHz pixel frequency */
+    PHY_FREQ_74_250,
+    /** 74.176 MHz pixel frequency */
+    PHY_FREQ_74_176,
+    /** 148.5 MHz pixel frequency */
+    PHY_FREQ_148_500,
+    /** 148.352 MHz pixel frequency */
+    PHY_FREQ_148_352,
+    /** 108.108 MHz pixel frequency */
+    PHY_FREQ_108_108,
+    /** 72 MHz pixel frequency */
+    PHY_FREQ_72,
+    /** 25 MHz pixel frequency */
+    PHY_FREQ_25,
+    /** 65 MHz pixel frequency */
+    PHY_FREQ_65,
+    /** 108 MHz pixel frequency */
+    PHY_FREQ_108,
+    /** 162 MHz pixel frequency */
+    PHY_FREQ_162,
+    /** 59.4 MHz pixel frequency */
+    PHY_FREQ_59_400,
+};
+
+#endif /* __HDMI_PHY_PIXELFREQUENCY__ */
+
+#ifndef __HDMI_VIDEO_SOURCE__
+#define __HDMI_VIDEO_SOURCE__
+/**
+ * @enum HDMIVideoSource
+ * Type of video source.
+ */
+enum HDMIVideoSource {
+    /** Internal Video Source */
+    HDMI_SOURCE_INTERNAL,
+    /** External Video Source */
+    HDMI_SOURCE_EXTERNAL,
+};
+#endif /* __HDMI_VIDEO_SOURCE__ */
+
+#ifndef __HDMI_3D_VIDEO_STRUCTURE__
+#define __HDMI_3D_VIDEO_STRUCTURE__
+/**
+ * @enum HDMI3DVideoStructure
+ * Type of 3D Video Structure
+ */
+enum HDMI3DVideoStructure {
+    /** 2D Video Format  */
+    HDMI_2D_VIDEO_FORMAT = -1,
+    /** 3D Frame Packing Structure */
+    HDMI_3D_FP_FORMAT = 0,
+    /** 3D Field Alternative Structure  */
+    HDMI_3D_FA_FORMAT,
+    /** 3D Line Alternative Structure */
+    HDMI_3D_LA_FORMAT,
+    /** Side-by-Side(Full)Structure */
+    HDMI_3D_SSF_FORMAT,
+    /** 3D L+Depth Structure */
+    HDMI_3D_LD_FORMAT,
+    /** 3D L+Depth+Graphics Structure */
+    HDMI_3D_LDGFX_FORMAT,
+    /** 3D Top-and-Bottom Structure */
+    HDMI_3D_TB_FORMAT,
+    /** HDMI VIC Structure (ex. 4Kx2K) */
+    HDMI_VIC_FORMAT,
+    /** Side-by-Side(Half)Structure */
+    HDMI_3D_SSH_FORMAT,
+};
+#endif /* __HDMI_3D_VIDEO_STRUCTURE__ */
+
+#ifndef __HDMI_VIDEO_PARAMETER__
+#define __HDMI_VIDEO_PARAMETER__
+//! Structure for HDMI video
+struct HDMIVideoParameter {
+    /** Video interface */
+    enum HDMIMode mode;
+    /** Video format */
+    enum VideoFormat resolution;
+    /** Color space */
+    enum ColorSpace colorSpace;
+    /** Color depth */
+    enum ColorDepth colorDepth;
+    /** Colorimetry */
+    enum HDMIColorimetry colorimetry;
+    /** Pixel aspect ratio */
+    enum PixelAspectRatio pixelAspectRatio;
+    /** Video Source */
+    enum HDMIVideoSource videoSrc;
+    /** 3D Video Structure */
+    enum HDMI3DVideoStructure hdmi_3d_format;
+};
+#endif /* __HDMI_VIDEO_PARAMETER__*/
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _VIDEO_H_ */
diff --git a/exynos4/hal/include/videodev2.h b/exynos4/hal/include/videodev2.h
new file mode 100644
index 0000000..48b3081
--- /dev/null
+++ b/exynos4/hal/include/videodev2.h
@@ -0,0 +1,2227 @@
+/*
+ *  Video for Linux Two header file
+ *
+ *  Copyright (C) 1999-2007 the contributors
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  Alternatively you can redistribute this file under the terms of the
+ *  BSD license as stated below:
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *  1. Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *  2. Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *  3. The names of its contributors may not be used to endorse or promote
+ *     products derived from this software without specific prior written
+ *     permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ *  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *	Header file for v4l or V4L2 drivers and applications
+ * with public API.
+ * All kernel-specific stuff were moved to media/v4l2-dev.h, so
+ * no #if __KERNEL tests are allowed here
+ *
+ *	See http://linuxtv.org for more info
+ *
+ *	Author: Bill Dirks <bill@thedirks.org>
+ *		Justin Schoeman
+ *              Hans Verkuil <hverkuil@xs4all.nl>
+ *		et al.
+ */
+#ifndef __LINUX_VIDEODEV2_H
+#define __LINUX_VIDEODEV2_H
+
+#ifdef __KERNEL__
+#include <linux/time.h>     /* need struct timeval */
+#else
+#include <sys/time.h>
+#endif
+#include <linux/compiler.h>
+#include <linux/ioctl.h>
+#include <linux/types.h>
+
+/*
+ * Common stuff for both V4L1 and V4L2
+ * Moved from videodev.h
+ */
+#define VIDEO_MAX_FRAME               32
+#define VIDEO_MAX_PLANES               8
+
+#ifndef __KERNEL__
+
+/* These defines are V4L1 specific and should not be used with the V4L2 API!
+   They will be removed from this header in the future. */
+
+#define VID_TYPE_CAPTURE	1	/* Can capture */
+#define VID_TYPE_TUNER		2	/* Can tune */
+#define VID_TYPE_TELETEXT	4	/* Does teletext */
+#define VID_TYPE_OVERLAY	8	/* Overlay onto frame buffer */
+#define VID_TYPE_CHROMAKEY	16	/* Overlay by chromakey */
+#define VID_TYPE_CLIPPING	32	/* Can clip */
+#define VID_TYPE_FRAMERAM	64	/* Uses the frame buffer memory */
+#define VID_TYPE_SCALES		128	/* Scalable */
+#define VID_TYPE_MONOCHROME	256	/* Monochrome only */
+#define VID_TYPE_SUBCAPTURE	512	/* Can capture subareas of the image */
+#define VID_TYPE_MPEG_DECODER	1024	/* Can decode MPEG streams */
+#define VID_TYPE_MPEG_ENCODER	2048	/* Can encode MPEG streams */
+#define VID_TYPE_MJPEG_DECODER	4096	/* Can decode MJPEG streams */
+#define VID_TYPE_MJPEG_ENCODER	8192	/* Can encode MJPEG streams */
+#endif
+
+/*
+ *	M I S C E L L A N E O U S
+ */
+
+/*  Four-character-code (FOURCC) */
+#define v4l2_fourcc(a, b, c, d)\
+	((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24))
+
+/*
+ *	E N U M S
+ */
+enum v4l2_field {
+	V4L2_FIELD_ANY           = 0, /* driver can choose from none,
+					 top, bottom, interlaced
+					 depending on whatever it thinks
+					 is approximate ... */
+	V4L2_FIELD_NONE          = 1, /* this device has no fields ... */
+	V4L2_FIELD_TOP           = 2, /* top field only */
+	V4L2_FIELD_BOTTOM        = 3, /* bottom field only */
+	V4L2_FIELD_INTERLACED    = 4, /* both fields interlaced */
+	V4L2_FIELD_SEQ_TB        = 5, /* both fields sequential into one
+					 buffer, top-bottom order */
+	V4L2_FIELD_SEQ_BT        = 6, /* same as above + bottom-top order */
+	V4L2_FIELD_ALTERNATE     = 7, /* both fields alternating into
+					 separate buffers */
+	V4L2_FIELD_INTERLACED_TB = 8, /* both fields interlaced, top field
+					 first and the top field is
+					 transmitted first */
+	V4L2_FIELD_INTERLACED_BT = 9, /* both fields interlaced, top field
+					 first and the bottom field is
+					 transmitted first */
+};
+#define V4L2_FIELD_HAS_TOP(field)	\
+	((field) == V4L2_FIELD_TOP 	||\
+	 (field) == V4L2_FIELD_INTERLACED ||\
+	 (field) == V4L2_FIELD_INTERLACED_TB ||\
+	 (field) == V4L2_FIELD_INTERLACED_BT ||\
+	 (field) == V4L2_FIELD_SEQ_TB	||\
+	 (field) == V4L2_FIELD_SEQ_BT)
+#define V4L2_FIELD_HAS_BOTTOM(field)	\
+	((field) == V4L2_FIELD_BOTTOM 	||\
+	 (field) == V4L2_FIELD_INTERLACED ||\
+	 (field) == V4L2_FIELD_INTERLACED_TB ||\
+	 (field) == V4L2_FIELD_INTERLACED_BT ||\
+	 (field) == V4L2_FIELD_SEQ_TB	||\
+	 (field) == V4L2_FIELD_SEQ_BT)
+#define V4L2_FIELD_HAS_BOTH(field)	\
+	((field) == V4L2_FIELD_INTERLACED ||\
+	 (field) == V4L2_FIELD_INTERLACED_TB ||\
+	 (field) == V4L2_FIELD_INTERLACED_BT ||\
+	 (field) == V4L2_FIELD_SEQ_TB ||\
+	 (field) == V4L2_FIELD_SEQ_BT)
+
+enum v4l2_buf_type {
+	V4L2_BUF_TYPE_VIDEO_CAPTURE        = 1,
+	V4L2_BUF_TYPE_VIDEO_OUTPUT         = 2,
+	V4L2_BUF_TYPE_VIDEO_OVERLAY        = 3,
+	V4L2_BUF_TYPE_VBI_CAPTURE          = 4,
+	V4L2_BUF_TYPE_VBI_OUTPUT           = 5,
+	V4L2_BUF_TYPE_SLICED_VBI_CAPTURE   = 6,
+	V4L2_BUF_TYPE_SLICED_VBI_OUTPUT    = 7,
+#if 1
+	/* Experimental */
+	V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
+#endif
+	V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,
+	V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE  = 10,
+	V4L2_BUF_TYPE_PRIVATE              = 0x80,
+};
+
+#define V4L2_TYPE_IS_MULTIPLANAR(type)			\
+	((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE	\
+	 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
+
+#define V4L2_TYPE_IS_OUTPUT(type)				\
+	((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT			\
+	 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE		\
+	 || (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY		\
+	 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY	\
+	 || (type) == V4L2_BUF_TYPE_VBI_OUTPUT			\
+	 || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT)
+
+enum v4l2_tuner_type {
+	V4L2_TUNER_RADIO	     = 1,
+	V4L2_TUNER_ANALOG_TV	     = 2,
+	V4L2_TUNER_DIGITAL_TV	     = 3,
+};
+
+enum v4l2_memory {
+	V4L2_MEMORY_MMAP             = 1,
+	V4L2_MEMORY_USERPTR          = 2,
+	V4L2_MEMORY_OVERLAY          = 3,
+};
+
+/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
+enum v4l2_colorspace {
+	/* ITU-R 601 -- broadcast NTSC/PAL */
+	V4L2_COLORSPACE_SMPTE170M     = 1,
+
+	/* 1125-Line (US) HDTV */
+	V4L2_COLORSPACE_SMPTE240M     = 2,
+
+	/* HD and modern captures. */
+	V4L2_COLORSPACE_REC709        = 3,
+
+	/* broken BT878 extents (601, luma range 16-253 instead of 16-235) */
+	V4L2_COLORSPACE_BT878         = 4,
+
+	/* These should be useful.  Assume 601 extents. */
+	V4L2_COLORSPACE_470_SYSTEM_M  = 5,
+	V4L2_COLORSPACE_470_SYSTEM_BG = 6,
+
+	/* I know there will be cameras that send this.  So, this is
+	 * unspecified chromaticities and full 0-255 on each of the
+	 * Y'CbCr components
+	 */
+	V4L2_COLORSPACE_JPEG          = 7,
+
+	/* For RGB colourspaces, this is probably a good start. */
+	V4L2_COLORSPACE_SRGB          = 8,
+};
+
+enum v4l2_priority {
+	V4L2_PRIORITY_UNSET       = 0,  /* not initialized */
+	V4L2_PRIORITY_BACKGROUND  = 1,
+	V4L2_PRIORITY_INTERACTIVE = 2,
+	V4L2_PRIORITY_RECORD      = 3,
+	V4L2_PRIORITY_DEFAULT     = V4L2_PRIORITY_INTERACTIVE,
+};
+
+struct v4l2_rect {
+	__s32   left;
+	__s32   top;
+	__s32   width;
+	__s32   height;
+};
+
+struct v4l2_fract {
+	__u32   numerator;
+	__u32   denominator;
+};
+
+/*
+ *	D R I V E R   C A P A B I L I T I E S
+ */
+struct v4l2_capability {
+	__u8	driver[16];	/* i.e. "bttv" */
+	__u8	card[32];	/* i.e. "Hauppauge WinTV" */
+	__u8	bus_info[32];	/* "PCI:" + pci_name(pci_dev) */
+	__u32   version;        /* should use KERNEL_VERSION() */
+	__u32	capabilities;	/* Device capabilities */
+	__u32	reserved[4];
+};
+
+/* Values for 'capabilities' field */
+#define V4L2_CAP_VIDEO_CAPTURE		0x00000001  /* Is a video capture device */
+#define V4L2_CAP_VIDEO_OUTPUT		0x00000002  /* Is a video output device */
+#define V4L2_CAP_VIDEO_OVERLAY		0x00000004  /* Can do video overlay */
+#define V4L2_CAP_VBI_CAPTURE		0x00000010  /* Is a raw VBI capture device */
+#define V4L2_CAP_VBI_OUTPUT		0x00000020  /* Is a raw VBI output device */
+#define V4L2_CAP_SLICED_VBI_CAPTURE	0x00000040  /* Is a sliced VBI capture device */
+#define V4L2_CAP_SLICED_VBI_OUTPUT	0x00000080  /* Is a sliced VBI output device */
+#define V4L2_CAP_RDS_CAPTURE		0x00000100  /* RDS data capture */
+#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY	0x00000200  /* Can do video output overlay */
+#define V4L2_CAP_HW_FREQ_SEEK		0x00000400  /* Can do hardware frequency seek  */
+#define V4L2_CAP_RDS_OUTPUT		0x00000800  /* Is an RDS encoder */
+
+/* Is a video capture device that supports multiplanar formats */
+#define V4L2_CAP_VIDEO_CAPTURE_MPLANE	0x00001000
+/* Is a video output device that supports multiplanar formats */
+#define V4L2_CAP_VIDEO_OUTPUT_MPLANE	0x00002000
+
+#define V4L2_CAP_TUNER			0x00010000  /* has a tuner */
+#define V4L2_CAP_AUDIO			0x00020000  /* has audio support */
+#define V4L2_CAP_RADIO			0x00040000  /* is a radio device */
+#define V4L2_CAP_MODULATOR		0x00080000  /* has a modulator */
+
+#define V4L2_CAP_READWRITE              0x01000000  /* read/write systemcalls */
+#define V4L2_CAP_ASYNCIO                0x02000000  /* async I/O */
+#define V4L2_CAP_STREAMING              0x04000000  /* streaming I/O ioctls */
+
+/*
+ *	V I D E O   I M A G E   F O R M A T
+ */
+struct v4l2_pix_format {
+	__u32         		width;
+	__u32			height;
+	__u32			pixelformat;
+	enum v4l2_field  	field;
+	__u32            	bytesperline;	/* for padding, zero if unused */
+	__u32          		sizeimage;
+	enum v4l2_colorspace	colorspace;
+	__u32			priv;		/* private data, depends on pixelformat */
+};
+
+/*      Pixel format         FOURCC                          depth  Description  */
+
+/* RGB formats */
+#define V4L2_PIX_FMT_RGB332  v4l2_fourcc('R', 'G', 'B', '1') /*  8  RGB-3-3-2     */
+#define V4L2_PIX_FMT_RGB444  v4l2_fourcc('R', '4', '4', '4') /* 16  xxxxrrrr ggggbbbb */
+#define V4L2_PIX_FMT_RGB555  v4l2_fourcc('R', 'G', 'B', 'O') /* 16  RGB-5-5-5     */
+#define V4L2_PIX_FMT_RGB565  v4l2_fourcc('R', 'G', 'B', 'P') /* 16  RGB-5-6-5     */
+#define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16  RGB-5-5-5 BE  */
+#define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16  RGB-5-6-5 BE  */
+#define V4L2_PIX_FMT_BGR666  v4l2_fourcc('B', 'G', 'R', 'H') /* 18  BGR-6-6-6	  */
+#define V4L2_PIX_FMT_BGR24   v4l2_fourcc('B', 'G', 'R', '3') /* 24  BGR-8-8-8     */
+#define V4L2_PIX_FMT_RGB24   v4l2_fourcc('R', 'G', 'B', '3') /* 24  RGB-8-8-8     */
+#define V4L2_PIX_FMT_BGR32   v4l2_fourcc('B', 'G', 'R', '4') /* 32  BGR-8-8-8-8   */
+#define V4L2_PIX_FMT_RGB32   v4l2_fourcc('R', 'G', 'B', '4') /* 32  RGB-8-8-8-8   */
+
+/* Grey formats */
+#define V4L2_PIX_FMT_GREY    v4l2_fourcc('G', 'R', 'E', 'Y') /*  8  Greyscale     */
+#define V4L2_PIX_FMT_Y4      v4l2_fourcc('Y', '0', '4', ' ') /*  4  Greyscale     */
+#define V4L2_PIX_FMT_Y6      v4l2_fourcc('Y', '0', '6', ' ') /*  6  Greyscale     */
+#define V4L2_PIX_FMT_Y10     v4l2_fourcc('Y', '1', '0', ' ') /* 10  Greyscale     */
+#define V4L2_PIX_FMT_Y12     v4l2_fourcc('Y', '1', '2', ' ') /* 12  Greyscale     */
+#define V4L2_PIX_FMT_Y16     v4l2_fourcc('Y', '1', '6', ' ') /* 16  Greyscale     */
+
+/* Grey bit-packed formats */
+#define V4L2_PIX_FMT_Y10BPACK    v4l2_fourcc('Y', '1', '0', 'B') /* 10  Greyscale bit-packed */
+
+/* Palette formats */
+#define V4L2_PIX_FMT_PAL8    v4l2_fourcc('P', 'A', 'L', '8') /*  8  8-bit palette */
+
+/* Luminance+Chrominance formats */
+#define V4L2_PIX_FMT_YVU410  v4l2_fourcc('Y', 'V', 'U', '9') /*  9  YVU 4:1:0     */
+#define V4L2_PIX_FMT_YVU420  v4l2_fourcc('Y', 'V', '1', '2') /* 12  YVU 4:2:0     */
+#define V4L2_PIX_FMT_YUYV    v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16  YUV 4:2:2     */
+#define V4L2_PIX_FMT_YYUV    v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16  YUV 4:2:2     */
+#define V4L2_PIX_FMT_YVYU    v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */
+#define V4L2_PIX_FMT_UYVY    v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16  YUV 4:2:2     */
+#define V4L2_PIX_FMT_VYUY    v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16  YUV 4:2:2     */
+#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16  YVU422 planar */
+#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 16  YVU411 planar */
+#define V4L2_PIX_FMT_Y41P    v4l2_fourcc('Y', '4', '1', 'P') /* 12  YUV 4:1:1     */
+#define V4L2_PIX_FMT_YUV444  v4l2_fourcc('Y', '4', '4', '4') /* 16  xxxxyyyy uuuuvvvv */
+#define V4L2_PIX_FMT_YUV555  v4l2_fourcc('Y', 'U', 'V', 'O') /* 16  YUV-5-5-5     */
+#define V4L2_PIX_FMT_YUV565  v4l2_fourcc('Y', 'U', 'V', 'P') /* 16  YUV-5-6-5     */
+#define V4L2_PIX_FMT_YUV32   v4l2_fourcc('Y', 'U', 'V', '4') /* 32  YUV-8-8-8-8   */
+#define V4L2_PIX_FMT_YUV410  v4l2_fourcc('Y', 'U', 'V', '9') /*  9  YUV 4:1:0     */
+#define V4L2_PIX_FMT_YUV420  v4l2_fourcc('Y', 'U', '1', '2') /* 12  YUV 4:2:0     */
+#define V4L2_PIX_FMT_HI240   v4l2_fourcc('H', 'I', '2', '4') /*  8  8-bit color   */
+#define V4L2_PIX_FMT_HM12    v4l2_fourcc('H', 'M', '1', '2') /*  8  YUV 4:2:0 16x16 macroblocks */
+#define V4L2_PIX_FMT_M420    v4l2_fourcc('M', '4', '2', '0') /* 12  YUV 4:2:0 2 lines y, 1 line uv interleaved */
+
+/* two planes -- one Y, one Cr + Cb interleaved  */
+#define V4L2_PIX_FMT_NV12    v4l2_fourcc('N', 'V', '1', '2') /* 12  Y/CbCr 4:2:0  */
+#define V4L2_PIX_FMT_NV21    v4l2_fourcc('N', 'V', '2', '1') /* 12  Y/CrCb 4:2:0  */
+#define V4L2_PIX_FMT_NV16    v4l2_fourcc('N', 'V', '1', '6') /* 16  Y/CbCr 4:2:2  */
+#define V4L2_PIX_FMT_NV61    v4l2_fourcc('N', 'V', '6', '1') /* 16  Y/CrCb 4:2:2  */
+
+/* two non contiguous planes - one Y, one Cr + Cb interleaved  */
+#define V4L2_PIX_FMT_NV12M        v4l2_fourcc('N', 'M', '1', '2') /* 12  Y/CbCr 4:2:0  */
+#define V4L2_PIX_FMT_NV21M        v4l2_fourcc('N', 'M', '2', '1') /* 21  Y/CrCb 4:2:0  */
+#define V4L2_PIX_FMT_NV12MT       v4l2_fourcc('T', 'M', '1', '2') /* 12  Y/CbCr 4:2:0 64x32 macroblocks */
+#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12  Y/CbCr 4:2:0 16x16 macroblocks */
+
+/* three non contiguous planes - Y, Cb, Cr */
+#define V4L2_PIX_FMT_YUV420M v4l2_fourcc('Y', 'U', 'V', 'M') /* 12  YUV420 planar */
+#define V4L2_PIX_FMT_YVU420M v4l2_fourcc('Y', 'V', 'U', 'M') /* 12  YVU420 planar */
+
+/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */
+#define V4L2_PIX_FMT_SBGGR8  v4l2_fourcc('B', 'A', '8', '1') /*  8  BGBG.. GRGR.. */
+#define V4L2_PIX_FMT_SGBRG8  v4l2_fourcc('G', 'B', 'R', 'G') /*  8  GBGB.. RGRG.. */
+#define V4L2_PIX_FMT_SGRBG8  v4l2_fourcc('G', 'R', 'B', 'G') /*  8  GRGR.. BGBG.. */
+#define V4L2_PIX_FMT_SRGGB8  v4l2_fourcc('R', 'G', 'G', 'B') /*  8  RGRG.. GBGB.. */
+#define V4L2_PIX_FMT_SBGGR10 v4l2_fourcc('B', 'G', '1', '0') /* 10  BGBG.. GRGR.. */
+#define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10  GBGB.. RGRG.. */
+#define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10  GRGR.. BGBG.. */
+#define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10  RGRG.. GBGB.. */
+#define V4L2_PIX_FMT_SBGGR12 v4l2_fourcc('B', 'G', '1', '2') /* 12  BGBG.. GRGR.. */
+#define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12  GBGB.. RGRG.. */
+#define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12  GRGR.. BGBG.. */
+#define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12  RGRG.. GBGB.. */
+	/* 10bit raw bayer DPCM compressed to 8 bits */
+#define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0')
+	/*
+	 * 10bit raw bayer, expanded to 16 bits
+	 * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb...
+	 */
+#define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16  BGBG.. GRGR.. */
+
+/* compressed formats */
+#define V4L2_PIX_FMT_MJPEG    v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG   */
+#define V4L2_PIX_FMT_JPEG     v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG     */
+#define V4L2_PIX_FMT_DV       v4l2_fourcc('d', 'v', 's', 'd') /* 1394          */
+#define V4L2_PIX_FMT_MPEG     v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4    */
+
+
+#define V4L2_PIX_FMT_H264     v4l2_fourcc('H', '2', '6', '4') /* H264    */
+#define V4L2_PIX_FMT_H263     v4l2_fourcc('H', '2', '6', '3') /* H263    */
+#define V4L2_PIX_FMT_MPEG12   v4l2_fourcc('M', 'P', '1', '2') /* MPEG-1/2  */
+#define V4L2_PIX_FMT_MPEG4    v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4  */
+#define V4L2_PIX_FMT_FIMV     v4l2_fourcc('F', 'I', 'M', 'V') /* FIMV  */
+#define V4L2_PIX_FMT_FIMV1    v4l2_fourcc('F', 'I', 'M', '1') /* FIMV1 */
+#define V4L2_PIX_FMT_FIMV2    v4l2_fourcc('F', 'I', 'M', '2') /* FIMV2 */
+#define V4L2_PIX_FMT_FIMV3    v4l2_fourcc('F', 'I', 'M', '3') /* FIMV3 */
+#define V4L2_PIX_FMT_FIMV4    v4l2_fourcc('F', 'I', 'M', '4') /* FIMV4 */
+#define V4L2_PIX_FMT_XVID     v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */
+#define V4L2_PIX_FMT_VC1      v4l2_fourcc('V', 'C', '1', 'A') /* VC-1 */
+#define V4L2_PIX_FMT_VC1_RCV      v4l2_fourcc('V', 'C', '1', 'R') /* VC-1 RCV */
+#define V4L2_PIX_FMT_VP8      v4l2_fourcc('V', 'P', '8', '0') /* VP8 */
+
+
+/*  Vendor-specific formats   */
+#define V4L2_PIX_FMT_CPIA1    v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
+#define V4L2_PIX_FMT_WNVA     v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */
+#define V4L2_PIX_FMT_SN9C10X  v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */
+#define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */
+#define V4L2_PIX_FMT_PWC1     v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */
+#define V4L2_PIX_FMT_PWC2     v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */
+#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */
+#define V4L2_PIX_FMT_SPCA501  v4l2_fourcc('S', '5', '0', '1') /* YUYV per line */
+#define V4L2_PIX_FMT_SPCA505  v4l2_fourcc('S', '5', '0', '5') /* YYUV per line */
+#define V4L2_PIX_FMT_SPCA508  v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */
+#define V4L2_PIX_FMT_SPCA561  v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */
+#define V4L2_PIX_FMT_PAC207   v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */
+#define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */
+#define V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */
+#define V4L2_PIX_FMT_SQ905C   v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */
+#define V4L2_PIX_FMT_PJPG     v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */
+#define V4L2_PIX_FMT_OV511    v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */
+#define V4L2_PIX_FMT_OV518    v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */
+#define V4L2_PIX_FMT_STV0680  v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */
+#define V4L2_PIX_FMT_TM6000   v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */
+#define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */
+#define V4L2_PIX_FMT_KONICA420  v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */
+#define V4L2_PIX_FMT_JPGL	v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */
+
+#define V4L2_PIX_FMT_JPEG_444     v4l2_fourcc('J', 'P', 'G', '4') /* yuv444 of JFIF JPEG     */
+#define V4L2_PIX_FMT_JPEG_422     v4l2_fourcc('J', 'P', 'G', '2') /* yuv422 of JFIF JPEG     */
+#define V4L2_PIX_FMT_JPEG_420     v4l2_fourcc('J', 'P', 'G', '0') /* yuv420 of JFIF JPEG     */
+#define V4L2_PIX_FMT_JPEG_GRAY     v4l2_fourcc('J', 'P', 'G', 'G') /* grey of JFIF JPEG     */
+#define V4L2_PIX_FMT_YUV444_2P  v4l2_fourcc('Y', 'U', '2', 'P') /* 16  xxxxyyyy uuuuvvvv */
+#define V4L2_PIX_FMT_YVU444_2P  v4l2_fourcc('Y', 'V', '2', 'P') /* 16  xxxxyyyy uuuuvvvv */
+#define V4L2_PIX_FMT_YUV444_3P  v4l2_fourcc('Y', 'U', '3', 'P') /* 16  xxxxyyyy uuuuvvvv */
+/*
+ *	F O R M A T   E N U M E R A T I O N
+ */
+struct v4l2_fmtdesc {
+	__u32		    index;             /* Format number      */
+	enum v4l2_buf_type  type;              /* buffer type        */
+	__u32               flags;
+	__u8		    description[32];   /* Description string */
+	__u32		    pixelformat;       /* Format fourcc      */
+	__u32		    reserved[4];
+};
+
+#define V4L2_FMT_FLAG_COMPRESSED 0x0001
+#define V4L2_FMT_FLAG_EMULATED   0x0002
+
+#if 1
+	/* Experimental Frame Size and frame rate enumeration */
+/*
+ *	F R A M E   S I Z E   E N U M E R A T I O N
+ */
+enum v4l2_frmsizetypes {
+	V4L2_FRMSIZE_TYPE_DISCRETE	= 1,
+	V4L2_FRMSIZE_TYPE_CONTINUOUS	= 2,
+	V4L2_FRMSIZE_TYPE_STEPWISE	= 3,
+};
+
+struct v4l2_frmsize_discrete {
+	__u32			width;		/* Frame width [pixel] */
+	__u32			height;		/* Frame height [pixel] */
+};
+
+struct v4l2_frmsize_stepwise {
+	__u32			min_width;	/* Minimum frame width [pixel] */
+	__u32			max_width;	/* Maximum frame width [pixel] */
+	__u32			step_width;	/* Frame width step size [pixel] */
+	__u32			min_height;	/* Minimum frame height [pixel] */
+	__u32			max_height;	/* Maximum frame height [pixel] */
+	__u32			step_height;	/* Frame height step size [pixel] */
+};
+
+struct v4l2_frmsizeenum {
+	__u32			index;		/* Frame size number */
+	__u32			pixel_format;	/* Pixel format */
+	__u32			type;		/* Frame size type the device supports. */
+
+	union {					/* Frame size */
+		struct v4l2_frmsize_discrete	discrete;
+		struct v4l2_frmsize_stepwise	stepwise;
+	};
+
+	__u32   reserved[2];			/* Reserved space for future use */
+};
+
+/*
+ *	F R A M E   R A T E   E N U M E R A T I O N
+ */
+enum v4l2_frmivaltypes {
+	V4L2_FRMIVAL_TYPE_DISCRETE	= 1,
+	V4L2_FRMIVAL_TYPE_CONTINUOUS	= 2,
+	V4L2_FRMIVAL_TYPE_STEPWISE	= 3,
+};
+
+struct v4l2_frmival_stepwise {
+	struct v4l2_fract	min;		/* Minimum frame interval [s] */
+	struct v4l2_fract	max;		/* Maximum frame interval [s] */
+	struct v4l2_fract	step;		/* Frame interval step size [s] */
+};
+
+struct v4l2_frmivalenum {
+	__u32			index;		/* Frame format index */
+	__u32			pixel_format;	/* Pixel format */
+	__u32			width;		/* Frame width */
+	__u32			height;		/* Frame height */
+	__u32			type;		/* Frame interval type the device supports. */
+
+	union {					/* Frame interval */
+		struct v4l2_fract		discrete;
+		struct v4l2_frmival_stepwise	stepwise;
+	};
+
+	__u32	reserved[2];			/* Reserved space for future use */
+};
+#endif
+
+/*
+ *	T I M E C O D E
+ */
+struct v4l2_timecode {
+	__u32	type;
+	__u32	flags;
+	__u8	frames;
+	__u8	seconds;
+	__u8	minutes;
+	__u8	hours;
+	__u8	userbits[4];
+};
+
+/*  Type  */
+#define V4L2_TC_TYPE_24FPS		1
+#define V4L2_TC_TYPE_25FPS		2
+#define V4L2_TC_TYPE_30FPS		3
+#define V4L2_TC_TYPE_50FPS		4
+#define V4L2_TC_TYPE_60FPS		5
+
+/*  Flags  */
+#define V4L2_TC_FLAG_DROPFRAME		0x0001 /* "drop-frame" mode */
+#define V4L2_TC_FLAG_COLORFRAME		0x0002
+#define V4L2_TC_USERBITS_field		0x000C
+#define V4L2_TC_USERBITS_USERDEFINED	0x0000
+#define V4L2_TC_USERBITS_8BITCHARS	0x0008
+/* The above is based on SMPTE timecodes */
+
+struct v4l2_jpegcompression {
+	int quality;
+
+	int  APPn;              /* Number of APP segment to be written,
+				 * must be 0..15 */
+	int  APP_len;           /* Length of data in JPEG APPn segment */
+	char APP_data[60];      /* Data in the JPEG APPn segment. */
+
+	int  COM_len;           /* Length of data in JPEG COM segment */
+	char COM_data[60];      /* Data in JPEG COM segment */
+
+	__u32 jpeg_markers;     /* Which markers should go into the JPEG
+				 * output. Unless you exactly know what
+				 * you do, leave them untouched.
+				 * Inluding less markers will make the
+				 * resulting code smaller, but there will
+				 * be fewer applications which can read it.
+				 * The presence of the APP and COM marker
+				 * is influenced by APP_len and COM_len
+				 * ONLY, not by this property! */
+
+#define V4L2_JPEG_MARKER_DHT (1<<3)    /* Define Huffman Tables */
+#define V4L2_JPEG_MARKER_DQT (1<<4)    /* Define Quantization Tables */
+#define V4L2_JPEG_MARKER_DRI (1<<5)    /* Define Restart Interval */
+#define V4L2_JPEG_MARKER_COM (1<<6)    /* Comment segment */
+#define V4L2_JPEG_MARKER_APP (1<<7)    /* App segment, driver will
+					* allways use APP0 */
+};
+
+/*
+ *	M E M O R Y - M A P P I N G   B U F F E R S
+ */
+struct v4l2_requestbuffers {
+	__u32			count;
+	enum v4l2_buf_type      type;
+	enum v4l2_memory        memory;
+	__u32			reserved[2];
+};
+
+/**
+ * struct v4l2_plane - plane info for multi-planar buffers
+ * @bytesused:		number of bytes occupied by data in the plane (payload)
+ * @length:		size of this plane (NOT the payload) in bytes
+ * @mem_offset:		when memory in the associated struct v4l2_buffer is
+ *			V4L2_MEMORY_MMAP, equals the offset from the start of
+ *			the device memory for this plane (or is a "cookie" that
+ *			should be passed to mmap() called on the video node)
+ * @userptr:		when memory is V4L2_MEMORY_USERPTR, a userspace pointer
+ *			pointing to this plane
+ * @data_offset:	offset in the plane to the start of data; usually 0,
+ *			unless there is a header in front of the data
+ *
+ * Multi-planar buffers consist of one or more planes, e.g. an YCbCr buffer
+ * with two planes can have one plane for Y, and another for interleaved CbCr
+ * components. Each plane can reside in a separate memory buffer, or even in
+ * a completely separate memory node (e.g. in embedded devices).
+ */
+struct v4l2_plane {
+	__u32			bytesused;
+	__u32			length;
+	union {
+		__u32		mem_offset;
+		unsigned long	userptr;
+	} m;
+	__u32			data_offset;
+	void			*cookie;
+	void			*share;
+	__u32			reserved[9];
+};
+
+/**
+ * struct v4l2_buffer - video buffer info
+ * @index:	id number of the buffer
+ * @type:	buffer type (type == *_MPLANE for multiplanar buffers)
+ * @bytesused:	number of bytes occupied by data in the buffer (payload);
+ *		unused (set to 0) for multiplanar buffers
+ * @flags:	buffer informational flags
+ * @field:	field order of the image in the buffer
+ * @timestamp:	frame timestamp
+ * @timecode:	frame timecode
+ * @sequence:	sequence count of this frame
+ * @memory:	the method, in which the actual video data is passed
+ * @offset:	for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;
+ *		offset from the start of the device memory for this plane,
+ *		(or a "cookie" that should be passed to mmap() as offset)
+ * @userptr:	for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;
+ *		a userspace pointer pointing to this buffer
+ * @planes:	for multiplanar buffers; userspace pointer to the array of plane
+ *		info structs for this buffer
+ * @length:	size in bytes of the buffer (NOT its payload) for single-plane
+ *		buffers (when type != *_MPLANE); number of elements in the
+ *		planes array for multi-plane buffers
+ * @input:	input number from which the video data has has been captured
+ *
+ * Contains data exchanged by application and driver using one of the Streaming
+ * I/O methods.
+ */
+struct v4l2_buffer {
+	__u32			index;
+	enum v4l2_buf_type      type;
+	__u32			bytesused;
+	__u32			flags;
+	enum v4l2_field		field;
+	struct timeval		timestamp;
+	struct v4l2_timecode	timecode;
+	__u32			sequence;
+
+	/* memory location */
+	enum v4l2_memory        memory;
+	union {
+		__u32           offset;
+		unsigned long   userptr;
+		struct v4l2_plane *planes;
+	} m;
+	__u32			length;
+	__u32			input;
+	__u32			reserved;
+};
+
+/*  Flags for 'flags' field */
+#define V4L2_BUF_FLAG_MAPPED	0x0001  /* Buffer is mapped (flag) */
+#define V4L2_BUF_FLAG_QUEUED	0x0002	/* Buffer is queued for processing */
+#define V4L2_BUF_FLAG_DONE	0x0004	/* Buffer is ready */
+#define V4L2_BUF_FLAG_KEYFRAME	0x0008	/* Image is a keyframe (I-frame) */
+#define V4L2_BUF_FLAG_PFRAME	0x0010	/* Image is a P-frame */
+#define V4L2_BUF_FLAG_BFRAME	0x0020	/* Image is a B-frame */
+/* Buffer is ready, but the data contained within is corrupted. */
+#define V4L2_BUF_FLAG_ERROR	0x0040
+#define V4L2_BUF_FLAG_TIMECODE	0x0100	/* timecode field is valid */
+#define V4L2_BUF_FLAG_INPUT     0x0200  /* input field is valid */
+
+/*
+ *	O V E R L A Y   P R E V I E W
+ */
+struct v4l2_framebuffer {
+	__u32			capability;
+	__u32			flags;
+/* FIXME: in theory we should pass something like PCI device + memory
+ * region + offset instead of some physical address */
+	void                    *base;
+	struct v4l2_pix_format	fmt;
+};
+/*  Flags for the 'capability' field. Read only */
+#define V4L2_FBUF_CAP_EXTERNOVERLAY	0x0001
+#define V4L2_FBUF_CAP_CHROMAKEY		0x0002
+#define V4L2_FBUF_CAP_LIST_CLIPPING     0x0004
+#define V4L2_FBUF_CAP_BITMAP_CLIPPING	0x0008
+#define V4L2_FBUF_CAP_LOCAL_ALPHA	0x0010
+#define V4L2_FBUF_CAP_GLOBAL_ALPHA	0x0020
+#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA	0x0040
+#define V4L2_FBUF_CAP_SRC_CHROMAKEY	0x0080
+/*  Flags for the 'flags' field. */
+#define V4L2_FBUF_FLAG_PRIMARY		0x0001
+#define V4L2_FBUF_FLAG_OVERLAY		0x0002
+#define V4L2_FBUF_FLAG_CHROMAKEY	0x0004
+#define V4L2_FBUF_FLAG_LOCAL_ALPHA	0x0008
+#define V4L2_FBUF_FLAG_GLOBAL_ALPHA	0x0010
+#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA	0x0020
+#define V4L2_FBUF_FLAG_SRC_CHROMAKEY	0x0040
+
+struct v4l2_clip {
+	struct v4l2_rect        c;
+	struct v4l2_clip	__user *next;
+};
+
+struct v4l2_window {
+	struct v4l2_rect        w;
+	enum v4l2_field  	field;
+	__u32			chromakey;
+	struct v4l2_clip	__user *clips;
+	__u32			clipcount;
+	void			__user *bitmap;
+	__u8                    global_alpha;
+};
+
+/*
+ *	C A P T U R E   P A R A M E T E R S
+ */
+struct v4l2_captureparm {
+	__u32		   capability;	  /*  Supported modes */
+	__u32		   capturemode;	  /*  Current mode */
+	struct v4l2_fract  timeperframe;  /*  Time per frame in .1us units */
+	__u32		   extendedmode;  /*  Driver-specific extensions */
+	__u32              readbuffers;   /*  # of buffers for read */
+	__u32		   reserved[4];
+};
+
+/*  Flags for 'capability' and 'capturemode' fields */
+#define V4L2_MODE_HIGHQUALITY	0x0001	/*  High quality imaging mode */
+#define V4L2_CAP_TIMEPERFRAME	0x1000	/*  timeperframe field is supported */
+
+struct v4l2_outputparm {
+	__u32		   capability;	 /*  Supported modes */
+	__u32		   outputmode;	 /*  Current mode */
+	struct v4l2_fract  timeperframe; /*  Time per frame in seconds */
+	__u32		   extendedmode; /*  Driver-specific extensions */
+	__u32              writebuffers; /*  # of buffers for write */
+	__u32		   reserved[4];
+};
+
+/*
+ *	I N P U T   I M A G E   C R O P P I N G
+ */
+struct v4l2_cropcap {
+	enum v4l2_buf_type      type;
+	struct v4l2_rect        bounds;
+	struct v4l2_rect        defrect;
+	struct v4l2_fract       pixelaspect;
+};
+
+struct v4l2_crop {
+	enum v4l2_buf_type      type;
+	struct v4l2_rect        c;
+};
+
+/*
+ *      A N A L O G   V I D E O   S T A N D A R D
+ */
+
+typedef __u64 v4l2_std_id;
+
+/* one bit for each */
+#define V4L2_STD_PAL_B          ((v4l2_std_id)0x00000001)
+#define V4L2_STD_PAL_B1         ((v4l2_std_id)0x00000002)
+#define V4L2_STD_PAL_G          ((v4l2_std_id)0x00000004)
+#define V4L2_STD_PAL_H          ((v4l2_std_id)0x00000008)
+#define V4L2_STD_PAL_I          ((v4l2_std_id)0x00000010)
+#define V4L2_STD_PAL_D          ((v4l2_std_id)0x00000020)
+#define V4L2_STD_PAL_D1         ((v4l2_std_id)0x00000040)
+#define V4L2_STD_PAL_K          ((v4l2_std_id)0x00000080)
+
+#define V4L2_STD_PAL_M          ((v4l2_std_id)0x00000100)
+#define V4L2_STD_PAL_N          ((v4l2_std_id)0x00000200)
+#define V4L2_STD_PAL_Nc         ((v4l2_std_id)0x00000400)
+#define V4L2_STD_PAL_60         ((v4l2_std_id)0x00000800)
+
+#define V4L2_STD_NTSC_M         ((v4l2_std_id)0x00001000)
+#define V4L2_STD_NTSC_M_JP      ((v4l2_std_id)0x00002000)
+#define V4L2_STD_NTSC_443       ((v4l2_std_id)0x00004000)
+#define V4L2_STD_NTSC_M_KR      ((v4l2_std_id)0x00008000)
+
+#define V4L2_STD_SECAM_B        ((v4l2_std_id)0x00010000)
+#define V4L2_STD_SECAM_D        ((v4l2_std_id)0x00020000)
+#define V4L2_STD_SECAM_G        ((v4l2_std_id)0x00040000)
+#define V4L2_STD_SECAM_H        ((v4l2_std_id)0x00080000)
+#define V4L2_STD_SECAM_K        ((v4l2_std_id)0x00100000)
+#define V4L2_STD_SECAM_K1       ((v4l2_std_id)0x00200000)
+#define V4L2_STD_SECAM_L        ((v4l2_std_id)0x00400000)
+#define V4L2_STD_SECAM_LC       ((v4l2_std_id)0x00800000)
+
+/* ATSC/HDTV */
+#define V4L2_STD_ATSC_8_VSB     ((v4l2_std_id)0x01000000)
+#define V4L2_STD_ATSC_16_VSB    ((v4l2_std_id)0x02000000)
+
+/* FIXME:
+   Although std_id is 64 bits, there is an issue on PPC32 architecture that
+   makes switch(__u64) to break. So, there's a hack on v4l2-common.c rounding
+   this value to 32 bits.
+   As, currently, the max value is for V4L2_STD_ATSC_16_VSB (30 bits wide),
+   it should work fine. However, if needed to add more than two standards,
+   v4l2-common.c should be fixed.
+ */
+
+/* some merged standards */
+#define V4L2_STD_MN	(V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC)
+#define V4L2_STD_B	(V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B)
+#define V4L2_STD_GH	(V4L2_STD_PAL_G|V4L2_STD_PAL_H|V4L2_STD_SECAM_G|V4L2_STD_SECAM_H)
+#define V4L2_STD_DK	(V4L2_STD_PAL_DK|V4L2_STD_SECAM_DK)
+
+/* some common needed stuff */
+#define V4L2_STD_PAL_BG		(V4L2_STD_PAL_B		|\
+				 V4L2_STD_PAL_B1	|\
+				 V4L2_STD_PAL_G)
+#define V4L2_STD_PAL_DK		(V4L2_STD_PAL_D		|\
+				 V4L2_STD_PAL_D1	|\
+				 V4L2_STD_PAL_K)
+#define V4L2_STD_PAL		(V4L2_STD_PAL_BG	|\
+				 V4L2_STD_PAL_DK	|\
+				 V4L2_STD_PAL_H		|\
+				 V4L2_STD_PAL_I)
+#define V4L2_STD_NTSC           (V4L2_STD_NTSC_M	|\
+				 V4L2_STD_NTSC_M_JP     |\
+				 V4L2_STD_NTSC_M_KR)
+#define V4L2_STD_SECAM_DK      	(V4L2_STD_SECAM_D	|\
+				 V4L2_STD_SECAM_K	|\
+				 V4L2_STD_SECAM_K1)
+#define V4L2_STD_SECAM		(V4L2_STD_SECAM_B	|\
+				 V4L2_STD_SECAM_G	|\
+				 V4L2_STD_SECAM_H	|\
+				 V4L2_STD_SECAM_DK	|\
+				 V4L2_STD_SECAM_L       |\
+				 V4L2_STD_SECAM_LC)
+
+#define V4L2_STD_525_60		(V4L2_STD_PAL_M		|\
+				 V4L2_STD_PAL_60	|\
+				 V4L2_STD_NTSC		|\
+				 V4L2_STD_NTSC_443)
+#define V4L2_STD_625_50		(V4L2_STD_PAL		|\
+				 V4L2_STD_PAL_N		|\
+				 V4L2_STD_PAL_Nc	|\
+				 V4L2_STD_SECAM)
+#define V4L2_STD_ATSC           (V4L2_STD_ATSC_8_VSB    |\
+				 V4L2_STD_ATSC_16_VSB)
+
+#define V4L2_STD_UNKNOWN        0
+#define V4L2_STD_ALL            (V4L2_STD_525_60	|\
+				 V4L2_STD_625_50)
+
+struct v4l2_standard {
+	__u32		     index;
+	v4l2_std_id          id;
+	__u8		     name[24];
+	struct v4l2_fract    frameperiod; /* Frames, not fields */
+	__u32		     framelines;
+	__u32		     reserved[4];
+};
+
+/*
+ *	V I D E O	T I M I N G S	D V	P R E S E T
+ */
+struct v4l2_dv_preset {
+	__u32	preset;
+	__u32	reserved[4];
+};
+
+/*
+ *	D V	P R E S E T S	E N U M E R A T I O N
+ */
+struct v4l2_dv_enum_preset {
+	__u32	index;
+	__u32	preset;
+	__u8	name[32]; /* Name of the preset timing */
+	__u32	width;
+	__u32	height;
+	__u32	reserved[4];
+};
+
+/*
+ * 	D V	P R E S E T	V A L U E S
+ */
+#define		V4L2_DV_INVALID		0
+#define		V4L2_DV_480P59_94	1 /* BT.1362 */
+#define		V4L2_DV_576P50		2 /* BT.1362 */
+#define		V4L2_DV_720P24		3 /* SMPTE 296M */
+#define		V4L2_DV_720P25		4 /* SMPTE 296M */
+#define		V4L2_DV_720P30		5 /* SMPTE 296M */
+#define		V4L2_DV_720P50		6 /* SMPTE 296M */
+#define		V4L2_DV_720P59_94	7 /* SMPTE 274M */
+#define		V4L2_DV_720P60		8 /* SMPTE 274M/296M */
+#define		V4L2_DV_1080I29_97	9 /* BT.1120/ SMPTE 274M */
+#define		V4L2_DV_1080I30		10 /* BT.1120/ SMPTE 274M */
+#define		V4L2_DV_1080I25		11 /* BT.1120 */
+#define		V4L2_DV_1080I50		12 /* SMPTE 296M */
+#define		V4L2_DV_1080I60		13 /* SMPTE 296M */
+#define		V4L2_DV_1080P24		14 /* SMPTE 296M */
+#define		V4L2_DV_1080P25		15 /* SMPTE 296M */
+#define		V4L2_DV_1080P30		16 /* SMPTE 296M */
+#define		V4L2_DV_1080P50		17 /* BT.1120 */
+#define		V4L2_DV_1080P60		18 /* BT.1120 */
+
+#define		V4L2_DV_480P60			19
+#define		V4L2_DV_1080I59_94		20
+#define		V4L2_DV_1080P59_94		21
+
+#define		V4L2_DV_720P60_FP		22
+#define		V4L2_DV_720P60_SB_HALF		23
+#define		V4L2_DV_720P60_TB		24
+#define		V4L2_DV_720P59_94_FP		25
+#define		V4L2_DV_720P59_94_SB_HALF	26
+#define		V4L2_DV_720P59_94_TB		27
+#define		V4L2_DV_720P50_FP		28
+#define		V4L2_DV_720P50_SB_HALF		29
+#define		V4L2_DV_720P50_TB		30
+#define		V4L2_DV_1080P24_FP		31
+#define		V4L2_DV_1080P24_SB_HALF		32
+#define		V4L2_DV_1080P24_TB		33
+#define		V4L2_DV_1080P23_98_FP		34
+#define		V4L2_DV_1080P23_98_SB_HALF	35
+#define		V4L2_DV_1080P23_98_TB		36
+#define		V4L2_DV_1080I60_SB_HALF		37
+#define		V4L2_DV_1080I59_94_SB_HALF	38
+#define		V4L2_DV_1080I50_SB_HALF		39
+#define		V4L2_DV_1080P60_SB_HALF		40
+#define		V4L2_DV_1080P60_TB		41
+#define		V4L2_DV_1080P30_FP		42
+#define		V4L2_DV_1080P30_SB_HALF		43
+#define		V4L2_DV_1080P30_TB		44
+
+/*
+ *	D V 	B T	T I M I N G S
+ */
+
+/* BT.656/BT.1120 timing data */
+struct v4l2_bt_timings {
+	__u32	width;		/* width in pixels */
+	__u32	height;		/* height in lines */
+	__u32	interlaced;	/* Interlaced or progressive */
+	__u32	polarities;	/* Positive or negative polarity */
+	__u64	pixelclock;	/* Pixel clock in HZ. Ex. 74.25MHz->74250000 */
+	__u32	hfrontporch;	/* Horizpontal front porch in pixels */
+	__u32	hsync;		/* Horizontal Sync length in pixels */
+	__u32	hbackporch;	/* Horizontal back porch in pixels */
+	__u32	vfrontporch;	/* Vertical front porch in pixels */
+	__u32	vsync;		/* Vertical Sync length in lines */
+	__u32	vbackporch;	/* Vertical back porch in lines */
+	__u32	il_vfrontporch;	/* Vertical front porch for bottom field of
+				 * interlaced field formats
+				 */
+	__u32	il_vsync;	/* Vertical sync length for bottom field of
+				 * interlaced field formats
+				 */
+	__u32	il_vbackporch;	/* Vertical back porch for bottom field of
+				 * interlaced field formats
+				 */
+	__u32	reserved[16];
+} __attribute__ ((packed));
+
+/* Interlaced or progressive format */
+#define	V4L2_DV_PROGRESSIVE	0
+#define	V4L2_DV_INTERLACED	1
+
+/* Polarities. If bit is not set, it is assumed to be negative polarity */
+#define V4L2_DV_VSYNC_POS_POL	0x00000001
+#define V4L2_DV_HSYNC_POS_POL	0x00000002
+
+
+/* DV timings */
+struct v4l2_dv_timings {
+	__u32 type;
+	union {
+		struct v4l2_bt_timings	bt;
+		__u32	reserved[32];
+	};
+} __attribute__ ((packed));
+
+/* Values for the type field */
+#define V4L2_DV_BT_656_1120	0	/* BT.656/1120 timing type */
+
+/*
+ *	V I D E O   I N P U T S
+ */
+struct v4l2_input {
+	__u32	     index;		/*  Which input */
+	__u8	     name[32];		/*  Label */
+	__u32	     type;		/*  Type of input */
+	__u32	     audioset;		/*  Associated audios (bitfield) */
+	__u32        tuner;             /*  Associated tuner */
+	v4l2_std_id  std;
+	__u32	     status;
+	__u32	     capabilities;
+	__u32	     reserved[3];
+};
+
+/*  Values for the 'type' field */
+#define V4L2_INPUT_TYPE_TUNER		1
+#define V4L2_INPUT_TYPE_CAMERA		2
+
+/* field 'status' - general */
+#define V4L2_IN_ST_NO_POWER    0x00000001  /* Attached device is off */
+#define V4L2_IN_ST_NO_SIGNAL   0x00000002
+#define V4L2_IN_ST_NO_COLOR    0x00000004
+
+/* field 'status' - sensor orientation */
+/* If sensor is mounted upside down set both bits */
+#define V4L2_IN_ST_HFLIP       0x00000010 /* Frames are flipped horizontally */
+#define V4L2_IN_ST_VFLIP       0x00000020 /* Frames are flipped vertically */
+
+/* field 'status' - analog */
+#define V4L2_IN_ST_NO_H_LOCK   0x00000100  /* No horizontal sync lock */
+#define V4L2_IN_ST_COLOR_KILL  0x00000200  /* Color killer is active */
+
+/* field 'status' - digital */
+#define V4L2_IN_ST_NO_SYNC     0x00010000  /* No synchronization lock */
+#define V4L2_IN_ST_NO_EQU      0x00020000  /* No equalizer lock */
+#define V4L2_IN_ST_NO_CARRIER  0x00040000  /* Carrier recovery failed */
+
+/* field 'status' - VCR and set-top box */
+#define V4L2_IN_ST_MACROVISION 0x01000000  /* Macrovision detected */
+#define V4L2_IN_ST_NO_ACCESS   0x02000000  /* Conditional access denied */
+#define V4L2_IN_ST_VTR         0x04000000  /* VTR time constant */
+
+/* capabilities flags */
+#define V4L2_IN_CAP_PRESETS		0x00000001 /* Supports S_DV_PRESET */
+#define V4L2_IN_CAP_CUSTOM_TIMINGS	0x00000002 /* Supports S_DV_TIMINGS */
+#define V4L2_IN_CAP_STD			0x00000004 /* Supports S_STD */
+
+/*
+ *	V I D E O   O U T P U T S
+ */
+struct v4l2_output {
+	__u32	     index;		/*  Which output */
+	__u8	     name[32];		/*  Label */
+	__u32	     type;		/*  Type of output */
+	__u32	     audioset;		/*  Associated audios (bitfield) */
+	__u32	     modulator;         /*  Associated modulator */
+	v4l2_std_id  std;
+	__u32	     capabilities;
+	__u32	     reserved[3];
+};
+/*  Values for the 'type' field */
+#define V4L2_OUTPUT_TYPE_MODULATOR		1
+#define V4L2_OUTPUT_TYPE_ANALOG			2
+#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY	3
+
+/* capabilities flags */
+#define V4L2_OUT_CAP_PRESETS		0x00000001 /* Supports S_DV_PRESET */
+#define V4L2_OUT_CAP_CUSTOM_TIMINGS	0x00000002 /* Supports S_DV_TIMINGS */
+#define V4L2_OUT_CAP_STD		0x00000004 /* Supports S_STD */
+
+/*
+ *	C O N T R O L S
+ */
+struct v4l2_control {
+	__u32		     id;
+	__s32		     value;
+};
+
+struct v4l2_ext_control {
+	__u32 id;
+	__u32 size;
+	__u32 reserved2[1];
+	union {
+		__s32 value;
+		__s64 value64;
+		char *string;
+	};
+} __attribute__ ((packed));
+
+struct v4l2_ext_controls {
+	__u32 ctrl_class;
+	__u32 count;
+	__u32 error_idx;
+	__u32 reserved[2];
+	struct v4l2_ext_control *controls;
+};
+
+/*  Values for ctrl_class field */
+#define V4L2_CTRL_CLASS_USER 0x00980000	/* Old-style 'user' controls */
+#define V4L2_CTRL_CLASS_MPEG 0x00990000	/* MPEG-compression controls */
+#define V4L2_CTRL_CLASS_CAMERA 0x009a0000	/* Camera class controls */
+#define V4L2_CTRL_CLASS_FM_TX 0x009b0000	/* FM Modulator control class */
+#define V4L2_CTRL_CLASS_CODEC 0x009c0000	/* Codec control class */
+
+#define V4L2_CTRL_ID_MASK      	  (0x0fffffff)
+#define V4L2_CTRL_ID2CLASS(id)    ((id) & 0x0fff0000UL)
+#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
+
+enum v4l2_ctrl_type {
+	V4L2_CTRL_TYPE_INTEGER	     = 1,
+	V4L2_CTRL_TYPE_BOOLEAN	     = 2,
+	V4L2_CTRL_TYPE_MENU	     = 3,
+	V4L2_CTRL_TYPE_BUTTON	     = 4,
+	V4L2_CTRL_TYPE_INTEGER64     = 5,
+	V4L2_CTRL_TYPE_CTRL_CLASS    = 6,
+	V4L2_CTRL_TYPE_STRING        = 7,
+};
+
+/*  Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
+struct v4l2_queryctrl {
+	__u32		     id;
+	enum v4l2_ctrl_type  type;
+	__u8		     name[32];	/* Whatever */
+	__s32		     minimum;	/* Note signedness */
+	__s32		     maximum;
+	__s32		     step;
+	__s32		     default_value;
+	__u32                flags;
+	__u32		     reserved[2];
+};
+
+/*  Used in the VIDIOC_QUERYMENU ioctl for querying menu items */
+struct v4l2_querymenu {
+	__u32		id;
+	__u32		index;
+	__u8		name[32];	/* Whatever */
+	__u32		reserved;
+};
+
+/*  Control flags  */
+#define V4L2_CTRL_FLAG_DISABLED		0x0001
+#define V4L2_CTRL_FLAG_GRABBED		0x0002
+#define V4L2_CTRL_FLAG_READ_ONLY 	0x0004
+#define V4L2_CTRL_FLAG_UPDATE 		0x0008
+#define V4L2_CTRL_FLAG_INACTIVE 	0x0010
+#define V4L2_CTRL_FLAG_SLIDER 		0x0020
+#define V4L2_CTRL_FLAG_WRITE_ONLY 	0x0040
+
+/*  Query flag, to be ORed with the control ID */
+#define V4L2_CTRL_FLAG_NEXT_CTRL	0x80000000
+
+/*  User-class control IDs defined by V4L2 */
+#define V4L2_CID_BASE			(V4L2_CTRL_CLASS_USER | 0x900)
+#define V4L2_CID_USER_BASE 		V4L2_CID_BASE
+/*  IDs reserved for driver specific controls */
+#define V4L2_CID_PRIVATE_BASE		0x08000000
+
+#define V4L2_CID_USER_CLASS 		(V4L2_CTRL_CLASS_USER | 1)
+#define V4L2_CID_BRIGHTNESS		(V4L2_CID_BASE+0)
+#define V4L2_CID_CONTRAST		(V4L2_CID_BASE+1)
+#define V4L2_CID_SATURATION		(V4L2_CID_BASE+2)
+#define V4L2_CID_HUE			(V4L2_CID_BASE+3)
+#define V4L2_CID_AUDIO_VOLUME		(V4L2_CID_BASE+5)
+#define V4L2_CID_AUDIO_BALANCE		(V4L2_CID_BASE+6)
+#define V4L2_CID_AUDIO_BASS		(V4L2_CID_BASE+7)
+#define V4L2_CID_AUDIO_TREBLE		(V4L2_CID_BASE+8)
+#define V4L2_CID_AUDIO_MUTE		(V4L2_CID_BASE+9)
+#define V4L2_CID_AUDIO_LOUDNESS		(V4L2_CID_BASE+10)
+#define V4L2_CID_BLACK_LEVEL		(V4L2_CID_BASE+11) /* Deprecated */
+#define V4L2_CID_AUTO_WHITE_BALANCE	(V4L2_CID_BASE+12)
+#define V4L2_CID_DO_WHITE_BALANCE	(V4L2_CID_BASE+13)
+#define V4L2_CID_RED_BALANCE		(V4L2_CID_BASE+14)
+#define V4L2_CID_BLUE_BALANCE		(V4L2_CID_BASE+15)
+#define V4L2_CID_GAMMA			(V4L2_CID_BASE+16)
+#define V4L2_CID_WHITENESS		(V4L2_CID_GAMMA) /* Deprecated */
+#define V4L2_CID_EXPOSURE		(V4L2_CID_BASE+17)
+#define V4L2_CID_AUTOGAIN		(V4L2_CID_BASE+18)
+#define V4L2_CID_GAIN			(V4L2_CID_BASE+19)
+#define V4L2_CID_HFLIP			(V4L2_CID_BASE+20)
+#define V4L2_CID_VFLIP			(V4L2_CID_BASE+21)
+
+/* Deprecated; use V4L2_CID_PAN_RESET and V4L2_CID_TILT_RESET */
+#define V4L2_CID_HCENTER		(V4L2_CID_BASE+22)
+#define V4L2_CID_VCENTER		(V4L2_CID_BASE+23)
+
+#define V4L2_CID_POWER_LINE_FREQUENCY	(V4L2_CID_BASE+24)
+enum v4l2_power_line_frequency {
+	V4L2_CID_POWER_LINE_FREQUENCY_DISABLED	= 0,
+	V4L2_CID_POWER_LINE_FREQUENCY_50HZ	= 1,
+	V4L2_CID_POWER_LINE_FREQUENCY_60HZ	= 2,
+};
+#define V4L2_CID_HUE_AUTO			(V4L2_CID_BASE+25)
+#define V4L2_CID_WHITE_BALANCE_TEMPERATURE	(V4L2_CID_BASE+26)
+#define V4L2_CID_SHARPNESS			(V4L2_CID_BASE+27)
+#define V4L2_CID_BACKLIGHT_COMPENSATION 	(V4L2_CID_BASE+28)
+#define V4L2_CID_CHROMA_AGC                     (V4L2_CID_BASE+29)
+#define V4L2_CID_COLOR_KILLER                   (V4L2_CID_BASE+30)
+#define V4L2_CID_COLORFX			(V4L2_CID_BASE+31)
+enum v4l2_colorfx {
+	V4L2_COLORFX_NONE	= 0,
+	V4L2_COLORFX_BW		= 1,
+	V4L2_COLORFX_SEPIA	= 2,
+	V4L2_COLORFX_NEGATIVE = 3,
+	V4L2_COLORFX_EMBOSS = 4,
+	V4L2_COLORFX_SKETCH = 5,
+	V4L2_COLORFX_SKY_BLUE = 6,
+	V4L2_COLORFX_GRASS_GREEN = 7,
+	V4L2_COLORFX_SKIN_WHITEN = 8,
+	V4L2_COLORFX_VIVID = 9,
+};
+#define V4L2_CID_AUTOBRIGHTNESS			(V4L2_CID_BASE+32)
+#define V4L2_CID_BAND_STOP_FILTER		(V4L2_CID_BASE+33)
+
+#define V4L2_CID_ROTATE				(V4L2_CID_BASE+34)
+#define V4L2_CID_BG_COLOR			(V4L2_CID_BASE+35)
+
+#define V4L2_CID_CHROMA_GAIN                    (V4L2_CID_BASE+36)
+
+#define V4L2_CID_ILLUMINATORS_1			(V4L2_CID_BASE+37)
+#define V4L2_CID_ILLUMINATORS_2			(V4L2_CID_BASE+38)
+
+/*
+ * This is custom CID
+ */
+/* for rgb alpha function */
+#define V4L2_CID_GLOBAL_ALPHA			(V4L2_CID_BASE+39)
+
+/* cacheable configuration */
+#define V4L2_CID_CACHEABLE			(V4L2_CID_BASE+40)
+
+/* jpeg captured size */
+#define V4L2_CID_CAM_JPEG_MEMSIZE		(V4L2_CID_BASE+41)
+#define V4L2_CID_CAM_JPEG_ENCODEDSIZE		(V4L2_CID_BASE+42)
+
+#define V4L2_CID_SET_SHAREABLE			(V4L2_CID_BASE+43)
+
+/* TV configuration */
+#define V4L2_CID_TV_LAYER_BLEND_ENABLE		(V4L2_CID_BASE+44)
+#define V4L2_CID_TV_LAYER_BLEND_ALPHA		(V4L2_CID_BASE+45)
+#define V4L2_CID_TV_PIXEL_BLEND_ENABLE		(V4L2_CID_BASE+46)
+#define V4L2_CID_TV_CHROMA_ENABLE		(V4L2_CID_BASE+47)
+#define V4L2_CID_TV_CHROMA_VALUE		(V4L2_CID_BASE+48)
+#define V4L2_CID_TV_HPD_STATUS			(V4L2_CID_BASE+49)
+
+/* last CID + 1 */
+#define V4L2_CID_LASTP1				(V4L2_CID_BASE+50)
+
+/*  MPEG-class control IDs defined by V4L2 */
+#define V4L2_CID_MPEG_BASE 			(V4L2_CTRL_CLASS_MPEG | 0x900)
+#define V4L2_CID_MPEG_CLASS 			(V4L2_CTRL_CLASS_MPEG | 1)
+
+/*  MPEG streams */
+#define V4L2_CID_MPEG_STREAM_TYPE 		(V4L2_CID_MPEG_BASE+0)
+enum v4l2_mpeg_stream_type {
+	V4L2_MPEG_STREAM_TYPE_MPEG2_PS   = 0, /* MPEG-2 program stream */
+	V4L2_MPEG_STREAM_TYPE_MPEG2_TS   = 1, /* MPEG-2 transport stream */
+	V4L2_MPEG_STREAM_TYPE_MPEG1_SS   = 2, /* MPEG-1 system stream */
+	V4L2_MPEG_STREAM_TYPE_MPEG2_DVD  = 3, /* MPEG-2 DVD-compatible stream */
+	V4L2_MPEG_STREAM_TYPE_MPEG1_VCD  = 4, /* MPEG-1 VCD-compatible stream */
+	V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */
+};
+#define V4L2_CID_MPEG_STREAM_PID_PMT 		(V4L2_CID_MPEG_BASE+1)
+#define V4L2_CID_MPEG_STREAM_PID_AUDIO 		(V4L2_CID_MPEG_BASE+2)
+#define V4L2_CID_MPEG_STREAM_PID_VIDEO 		(V4L2_CID_MPEG_BASE+3)
+#define V4L2_CID_MPEG_STREAM_PID_PCR 		(V4L2_CID_MPEG_BASE+4)
+#define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO 	(V4L2_CID_MPEG_BASE+5)
+#define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO 	(V4L2_CID_MPEG_BASE+6)
+#define V4L2_CID_MPEG_STREAM_VBI_FMT 		(V4L2_CID_MPEG_BASE+7)
+enum v4l2_mpeg_stream_vbi_fmt {
+	V4L2_MPEG_STREAM_VBI_FMT_NONE = 0,  /* No VBI in the MPEG stream */
+	V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1,  /* VBI in private packets, IVTV format */
+};
+
+/*  MPEG audio */
+#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ 	(V4L2_CID_MPEG_BASE+100)
+enum v4l2_mpeg_audio_sampling_freq {
+	V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,
+	V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1,
+	V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2,
+};
+#define V4L2_CID_MPEG_AUDIO_ENCODING 		(V4L2_CID_MPEG_BASE+101)
+enum v4l2_mpeg_audio_encoding {
+	V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,
+	V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,
+	V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2,
+	V4L2_MPEG_AUDIO_ENCODING_AAC     = 3,
+	V4L2_MPEG_AUDIO_ENCODING_AC3     = 4,
+};
+#define V4L2_CID_MPEG_AUDIO_L1_BITRATE 		(V4L2_CID_MPEG_BASE+102)
+enum v4l2_mpeg_audio_l1_bitrate {
+	V4L2_MPEG_AUDIO_L1_BITRATE_32K  = 0,
+	V4L2_MPEG_AUDIO_L1_BITRATE_64K  = 1,
+	V4L2_MPEG_AUDIO_L1_BITRATE_96K  = 2,
+	V4L2_MPEG_AUDIO_L1_BITRATE_128K = 3,
+	V4L2_MPEG_AUDIO_L1_BITRATE_160K = 4,
+	V4L2_MPEG_AUDIO_L1_BITRATE_192K = 5,
+	V4L2_MPEG_AUDIO_L1_BITRATE_224K = 6,
+	V4L2_MPEG_AUDIO_L1_BITRATE_256K = 7,
+	V4L2_MPEG_AUDIO_L1_BITRATE_288K = 8,
+	V4L2_MPEG_AUDIO_L1_BITRATE_320K = 9,
+	V4L2_MPEG_AUDIO_L1_BITRATE_352K = 10,
+	V4L2_MPEG_AUDIO_L1_BITRATE_384K = 11,
+	V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12,
+	V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13,
+};
+#define V4L2_CID_MPEG_AUDIO_L2_BITRATE 		(V4L2_CID_MPEG_BASE+103)
+enum v4l2_mpeg_audio_l2_bitrate {
+	V4L2_MPEG_AUDIO_L2_BITRATE_32K  = 0,
+	V4L2_MPEG_AUDIO_L2_BITRATE_48K  = 1,
+	V4L2_MPEG_AUDIO_L2_BITRATE_56K  = 2,
+	V4L2_MPEG_AUDIO_L2_BITRATE_64K  = 3,
+	V4L2_MPEG_AUDIO_L2_BITRATE_80K  = 4,
+	V4L2_MPEG_AUDIO_L2_BITRATE_96K  = 5,
+	V4L2_MPEG_AUDIO_L2_BITRATE_112K = 6,
+	V4L2_MPEG_AUDIO_L2_BITRATE_128K = 7,
+	V4L2_MPEG_AUDIO_L2_BITRATE_160K = 8,
+	V4L2_MPEG_AUDIO_L2_BITRATE_192K = 9,
+	V4L2_MPEG_AUDIO_L2_BITRATE_224K = 10,
+	V4L2_MPEG_AUDIO_L2_BITRATE_256K = 11,
+	V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12,
+	V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13,
+};
+#define V4L2_CID_MPEG_AUDIO_L3_BITRATE 		(V4L2_CID_MPEG_BASE+104)
+enum v4l2_mpeg_audio_l3_bitrate {
+	V4L2_MPEG_AUDIO_L3_BITRATE_32K  = 0,
+	V4L2_MPEG_AUDIO_L3_BITRATE_40K  = 1,
+	V4L2_MPEG_AUDIO_L3_BITRATE_48K  = 2,
+	V4L2_MPEG_AUDIO_L3_BITRATE_56K  = 3,
+	V4L2_MPEG_AUDIO_L3_BITRATE_64K  = 4,
+	V4L2_MPEG_AUDIO_L3_BITRATE_80K  = 5,
+	V4L2_MPEG_AUDIO_L3_BITRATE_96K  = 6,
+	V4L2_MPEG_AUDIO_L3_BITRATE_112K = 7,
+	V4L2_MPEG_AUDIO_L3_BITRATE_128K = 8,
+	V4L2_MPEG_AUDIO_L3_BITRATE_160K = 9,
+	V4L2_MPEG_AUDIO_L3_BITRATE_192K = 10,
+	V4L2_MPEG_AUDIO_L3_BITRATE_224K = 11,
+	V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12,
+	V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13,
+};
+#define V4L2_CID_MPEG_AUDIO_MODE 		(V4L2_CID_MPEG_BASE+105)
+enum v4l2_mpeg_audio_mode {
+	V4L2_MPEG_AUDIO_MODE_STEREO       = 0,
+	V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1,
+	V4L2_MPEG_AUDIO_MODE_DUAL         = 2,
+	V4L2_MPEG_AUDIO_MODE_MONO         = 3,
+};
+#define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION 	(V4L2_CID_MPEG_BASE+106)
+enum v4l2_mpeg_audio_mode_extension {
+	V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4  = 0,
+	V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8  = 1,
+	V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2,
+	V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3,
+};
+#define V4L2_CID_MPEG_AUDIO_EMPHASIS 		(V4L2_CID_MPEG_BASE+107)
+enum v4l2_mpeg_audio_emphasis {
+	V4L2_MPEG_AUDIO_EMPHASIS_NONE         = 0,
+	V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1,
+	V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17    = 2,
+};
+#define V4L2_CID_MPEG_AUDIO_CRC 		(V4L2_CID_MPEG_BASE+108)
+enum v4l2_mpeg_audio_crc {
+	V4L2_MPEG_AUDIO_CRC_NONE  = 0,
+	V4L2_MPEG_AUDIO_CRC_CRC16 = 1,
+};
+#define V4L2_CID_MPEG_AUDIO_MUTE 		(V4L2_CID_MPEG_BASE+109)
+#define V4L2_CID_MPEG_AUDIO_AAC_BITRATE		(V4L2_CID_MPEG_BASE+110)
+#define V4L2_CID_MPEG_AUDIO_AC3_BITRATE		(V4L2_CID_MPEG_BASE+111)
+enum v4l2_mpeg_audio_ac3_bitrate {
+	V4L2_MPEG_AUDIO_AC3_BITRATE_32K  = 0,
+	V4L2_MPEG_AUDIO_AC3_BITRATE_40K  = 1,
+	V4L2_MPEG_AUDIO_AC3_BITRATE_48K  = 2,
+	V4L2_MPEG_AUDIO_AC3_BITRATE_56K  = 3,
+	V4L2_MPEG_AUDIO_AC3_BITRATE_64K  = 4,
+	V4L2_MPEG_AUDIO_AC3_BITRATE_80K  = 5,
+	V4L2_MPEG_AUDIO_AC3_BITRATE_96K  = 6,
+	V4L2_MPEG_AUDIO_AC3_BITRATE_112K = 7,
+	V4L2_MPEG_AUDIO_AC3_BITRATE_128K = 8,
+	V4L2_MPEG_AUDIO_AC3_BITRATE_160K = 9,
+	V4L2_MPEG_AUDIO_AC3_BITRATE_192K = 10,
+	V4L2_MPEG_AUDIO_AC3_BITRATE_224K = 11,
+	V4L2_MPEG_AUDIO_AC3_BITRATE_256K = 12,
+	V4L2_MPEG_AUDIO_AC3_BITRATE_320K = 13,
+	V4L2_MPEG_AUDIO_AC3_BITRATE_384K = 14,
+	V4L2_MPEG_AUDIO_AC3_BITRATE_448K = 15,
+	V4L2_MPEG_AUDIO_AC3_BITRATE_512K = 16,
+	V4L2_MPEG_AUDIO_AC3_BITRATE_576K = 17,
+	V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18,
+};
+
+/*  MPEG video */
+#define V4L2_CID_MPEG_VIDEO_ENCODING 		(V4L2_CID_MPEG_BASE+200)
+enum v4l2_mpeg_video_encoding {
+	V4L2_MPEG_VIDEO_ENCODING_MPEG_1     = 0,
+	V4L2_MPEG_VIDEO_ENCODING_MPEG_2     = 1,
+	V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC = 2,
+};
+#define V4L2_CID_MPEG_VIDEO_ASPECT 		(V4L2_CID_MPEG_BASE+201)
+enum v4l2_mpeg_video_aspect {
+	V4L2_MPEG_VIDEO_ASPECT_1x1     = 0,
+	V4L2_MPEG_VIDEO_ASPECT_4x3     = 1,
+	V4L2_MPEG_VIDEO_ASPECT_16x9    = 2,
+	V4L2_MPEG_VIDEO_ASPECT_221x100 = 3,
+};
+#define V4L2_CID_MPEG_VIDEO_B_FRAMES 		(V4L2_CID_MPEG_BASE+202)
+#define V4L2_CID_MPEG_VIDEO_GOP_SIZE 		(V4L2_CID_MPEG_BASE+203)
+#define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE 	(V4L2_CID_MPEG_BASE+204)
+#define V4L2_CID_MPEG_VIDEO_PULLDOWN 		(V4L2_CID_MPEG_BASE+205)
+#define V4L2_CID_MPEG_VIDEO_BITRATE_MODE 	(V4L2_CID_MPEG_BASE+206)
+enum v4l2_mpeg_video_bitrate_mode {
+	V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0,
+	V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1,
+};
+#define V4L2_CID_MPEG_VIDEO_BITRATE 		(V4L2_CID_MPEG_BASE+207)
+#define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK 	(V4L2_CID_MPEG_BASE+208)
+#define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209)
+#define V4L2_CID_MPEG_VIDEO_MUTE 		(V4L2_CID_MPEG_BASE+210)
+#define V4L2_CID_MPEG_VIDEO_MUTE_YUV 		(V4L2_CID_MPEG_BASE+211)
+
+/*  MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */
+#define V4L2_CID_MPEG_CX2341X_BASE 				(V4L2_CTRL_CLASS_MPEG | 0x1000)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE 	(V4L2_CID_MPEG_CX2341X_BASE+0)
+enum v4l2_mpeg_cx2341x_video_spatial_filter_mode {
+	V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0,
+	V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO   = 1,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER 		(V4L2_CID_MPEG_CX2341X_BASE+1)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE 	(V4L2_CID_MPEG_CX2341X_BASE+2)
+enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type {
+	V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF                  = 0,
+	V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR               = 1,
+	V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT              = 2,
+	V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE      = 3,
+	V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE 	(V4L2_CID_MPEG_CX2341X_BASE+3)
+enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type {
+	V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF    = 0,
+	V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE 	(V4L2_CID_MPEG_CX2341X_BASE+4)
+enum v4l2_mpeg_cx2341x_video_temporal_filter_mode {
+	V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0,
+	V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO   = 1,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER 		(V4L2_CID_MPEG_CX2341X_BASE+5)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE 		(V4L2_CID_MPEG_CX2341X_BASE+6)
+enum v4l2_mpeg_cx2341x_video_median_filter_type {
+	V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF      = 0,
+	V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR      = 1,
+	V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT     = 2,
+	V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3,
+	V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG     = 4,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM 	(V4L2_CID_MPEG_CX2341X_BASE+7)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP 	(V4L2_CID_MPEG_CX2341X_BASE+8)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM	(V4L2_CID_MPEG_CX2341X_BASE+9)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP 	(V4L2_CID_MPEG_CX2341X_BASE+10)
+#define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS 	(V4L2_CID_MPEG_CX2341X_BASE+11)
+
+/* For codecs */
+
+#define V4L2_CID_CODEC_BASE 			(V4L2_CTRL_CLASS_CODEC | 0x900)
+#define V4L2_CID_CODEC_CLASS 			(V4L2_CTRL_CLASS_CODEC | 1)
+
+/* Codec class control IDs specific to the MFC5X driver */
+#define V4L2_CID_CODEC_MFC5X_BASE		(V4L2_CTRL_CLASS_CODEC | 0x1000)
+
+/* For both decoding and encoding */
+
+/* For decoding */
+
+#define V4L2_CID_CODEC_LOOP_FILTER_MPEG4_ENABLE	(V4L2_CID_CODEC_BASE + 110)
+#define V4L2_CID_CODEC_DISPLAY_DELAY		(V4L2_CID_CODEC_BASE + 137)
+#define V4L2_CID_CODEC_REQ_NUM_BUFS		(V4L2_CID_CODEC_BASE + 140)
+#define V4L2_CID_CODEC_SLICE_INTERFACE		(V4L2_CID_CODEC_BASE + 141)
+#define V4L2_CID_CODEC_PACKED_PB		(V4L2_CID_CODEC_BASE + 142)
+#define V4L2_CID_CODEC_FRAME_TAG		(V4L2_CID_CODEC_BASE + 143)
+#define V4L2_CID_CODEC_CRC_ENABLE		(V4L2_CID_CODEC_BASE + 144)
+#define V4L2_CID_CODEC_CRC_DATA_LUMA		(V4L2_CID_CODEC_BASE + 145)
+#define V4L2_CID_CODEC_CRC_DATA_CHROMA		(V4L2_CID_CODEC_BASE + 146)
+#define V4L2_CID_CODEC_CRC_DATA_LUMA_BOT	(V4L2_CID_CODEC_BASE + 147)
+#define V4L2_CID_CODEC_CRC_DATA_CHROMA_BOT	(V4L2_CID_CODEC_BASE + 148)
+#define V4L2_CID_CODEC_CRC_GENERATED		(V4L2_CID_CODEC_BASE + 149)
+#define V4L2_CID_CODEC_FRAME_TYPE		(V4L2_CID_CODEC_BASE + 154)
+#define V4L2_CID_CODEC_CHECK_STATE		(V4L2_CID_CODEC_BASE + 155)
+#define V4L2_CID_CODEC_DISPLAY_STATUS		(V4L2_CID_CODEC_BASE + 156)
+#define V4L2_CID_CODEC_FRAME_PACK_SEI_PARSE	(V4L2_CID_CODEC_BASE + 157)
+#define V4L2_CID_CODEC_FRAME_PACK_SEI_AVAIL	(V4L2_CID_CODEC_BASE + 158)
+#define V4L2_CID_CODEC_FRAME_PACK_ARRGMENT_ID	(V4L2_CID_CODEC_BASE + 159)
+#define V4L2_CID_CODEC_FRAME_PACK_SEI_INFO	(V4L2_CID_CODEC_BASE + 160)
+#define V4L2_CID_CODEC_FRAME_PACK_GRID_POS	(V4L2_CID_CODEC_BASE + 161)
+
+/* For encoding */
+#define V4L2_CID_CODEC_LOOP_FILTER_H264		(V4L2_CID_CODEC_BASE + 9)
+enum v4l2_cid_codec_loop_filter_h264 {
+	V4L2_CID_CODEC_LOOP_FILTER_H264_ENABLE = 0,
+	V4L2_CID_CODEC_LOOP_FILTER_H264_DISABLE = 1,
+	V4L2_CID_CODEC_LOOP_FILTER_H264_DISABLE_AT_BOUNDARY = 2,
+};
+
+#define V4L2_CID_CODEC_FRAME_INSERTION		(V4L2_CID_CODEC_BASE + 10)
+enum v4l2_cid_codec_frame_insertion {
+	V4L2_CID_CODEC_FRAME_INSERT_NONE = 0x0,
+	V4L2_CID_CODEC_FRAME_INSERT_I_FRAME = 0x1,
+	V4L2_CID_CODEC_FRAME_INSERT_NOT_CODED = 0x2,
+};
+
+#define V4L2_CID_CODEC_ENCODED_LUMA_ADDR	(V4L2_CID_CODEC_BASE + 11)
+#define V4L2_CID_CODEC_ENCODED_CHROMA_ADDR	(V4L2_CID_CODEC_BASE + 12)
+
+#define V4L2_CID_CODEC_ENCODED_I_PERIOD_CH	V4L2_CID_CODEC_MFC5X_ENC_GOP_SIZE
+#define V4L2_CID_CODEC_ENCODED_FRAME_RATE_CH 	V4L2_CID_CODEC_MFC5X_ENC_H264_RC_FRAME_RATE
+#define V4L2_CID_CODEC_ENCODED_BIT_RATE_CH 	V4L2_CID_CODEC_MFC5X_ENC_RC_BIT_RATE
+
+#define V4L2_CID_CODEC_FRAME_PACK_SEI_GEN	(V4L2_CID_CODEC_BASE + 13)
+#define V4L2_CID_CODEC_FRAME_PACK_FRM0_FLAG	(V4L2_CID_CODEC_BASE + 14)
+enum v4l2_codec_mfc5x_enc_flag {
+	V4L2_CODEC_MFC5X_ENC_FLAG_DISABLE = 0,
+	V4L2_CODEC_MFC5X_ENC_FLAG_ENABLE = 1,
+};
+#define V4L2_CID_CODEC_FRAME_PACK_ARRGMENT_TYPE	(V4L2_CID_CODEC_BASE + 15)
+enum v4l2_codec_mfc5x_enc_frame_pack_arrgment_type {
+	V4L2_CODEC_MFC5X_ENC_FRAME_PACK_SIDE_BY_SIDE = 0,
+	V4L2_CODEC_MFC5X_ENC_FRAME_PACK_TOP_AND_BOT = 1,
+	V4L2_CODEC_MFC5X_ENC_FRAME_PACK_TMP_INTER = 2,
+};
+
+/* common */
+enum v4l2_codec_mfc5x_enc_switch {
+	V4L2_CODEC_MFC5X_ENC_SW_DISABLE	= 0,
+	V4L2_CODEC_MFC5X_ENC_SW_ENABLE	= 1,
+};
+enum v4l2_codec_mfc5x_enc_switch_inv {
+	V4L2_CODEC_MFC5X_ENC_SW_INV_ENABLE	= 0,
+	V4L2_CODEC_MFC5X_ENC_SW_INV_DISABLE	= 1,
+};
+#define V4L2_CID_CODEC_MFC5X_ENC_GOP_SIZE		(V4L2_CID_CODEC_MFC5X_BASE+300)
+#define V4L2_CID_CODEC_MFC5X_ENC_MULTI_SLICE_MODE	(V4L2_CID_CODEC_MFC5X_BASE+301)
+enum v4l2_codec_mfc5x_enc_multi_slice_mode {
+	V4L2_CODEC_MFC5X_ENC_MULTI_SLICE_MODE_DISABLE		= 0,
+	V4L2_CODEC_MFC5X_ENC_MULTI_SLICE_MODE_MACROBLOCK_COUNT	= 1,
+	V4L2_CODEC_MFC5X_ENC_MULTI_SLICE_MODE_BIT_COUNT		= 3,
+};
+#define V4L2_CID_CODEC_MFC5X_ENC_MULTI_SLICE_MB		(V4L2_CID_CODEC_MFC5X_BASE+302)
+#define V4L2_CID_CODEC_MFC5X_ENC_MULTI_SLICE_BIT	(V4L2_CID_CODEC_MFC5X_BASE+303)
+#define V4L2_CID_CODEC_MFC5X_ENC_INTRA_REFRESH_MB	(V4L2_CID_CODEC_MFC5X_BASE+304)
+#define V4L2_CID_CODEC_MFC5X_ENC_PAD_CTRL_ENABLE	(V4L2_CID_CODEC_MFC5X_BASE+305)
+#define V4L2_CID_CODEC_MFC5X_ENC_PAD_LUMA_VALUE		(V4L2_CID_CODEC_MFC5X_BASE+306)
+#define V4L2_CID_CODEC_MFC5X_ENC_PAD_CB_VALUE		(V4L2_CID_CODEC_MFC5X_BASE+307)
+#define V4L2_CID_CODEC_MFC5X_ENC_PAD_CR_VALUE		(V4L2_CID_CODEC_MFC5X_BASE+308)
+#define V4L2_CID_CODEC_MFC5X_ENC_RC_FRAME_ENABLE	(V4L2_CID_CODEC_MFC5X_BASE+309)
+#define V4L2_CID_CODEC_MFC5X_ENC_RC_BIT_RATE		(V4L2_CID_CODEC_MFC5X_BASE+310)
+#define V4L2_CID_CODEC_MFC5X_ENC_RC_REACTION_COEFF	(V4L2_CID_CODEC_MFC5X_BASE+311)
+#define V4L2_CID_CODEC_MFC5X_ENC_STREAM_SIZE		(V4L2_CID_CODEC_MFC5X_BASE+312)
+#define V4L2_CID_CODEC_MFC5X_ENC_FRAME_COUNT		(V4L2_CID_CODEC_MFC5X_BASE+313)
+#define V4L2_CID_CODEC_MFC5X_ENC_FRAME_TYPE		(V4L2_CID_CODEC_MFC5X_BASE+314)
+enum v4l2_codec_mfc5x_enc_frame_type {
+	V4L2_CODEC_MFC5X_ENC_FRAME_TYPE_NOT_CODED	= 0,
+	V4L2_CODEC_MFC5X_ENC_FRAME_TYPE_I_FRAME		= 1,
+	V4L2_CODEC_MFC5X_ENC_FRAME_TYPE_P_FRAME		= 2,
+	V4L2_CODEC_MFC5X_ENC_FRAME_TYPE_B_FRAME		= 3,
+	V4L2_CODEC_MFC5X_ENC_FRAME_TYPE_SKIPPED		= 4,
+	V4L2_CODEC_MFC5X_ENC_FRAME_TYPE_OTHERS		= 5,
+};
+#define V4L2_CID_CODEC_MFC5X_ENC_FORCE_FRAME_TYPE	(V4L2_CID_CODEC_MFC5X_BASE+315)
+enum v4l2_codec_mfc5x_enc_force_frame_type {
+	V4L2_CODEC_MFC5X_ENC_FORCE_FRAME_TYPE_I_FRAME	= 1,
+	V4L2_CODEC_MFC5X_ENC_FORCE_FRAME_TYPE_NOT_CODED	= 2,
+};
+#define V4L2_CID_CODEC_MFC5X_ENC_VBV_BUF_SIZE		(V4L2_CID_CODEC_MFC5X_BASE+316)
+#define V4L2_CID_CODEC_MFC5X_ENC_SEQ_HDR_MODE		(V4L2_CID_CODEC_MFC5X_BASE+317)
+enum v4l2_codec_mfc5x_enc_seq_hdr_mode {
+	V4L2_CODEC_MFC5X_ENC_SEQ_HDR_MODE_SEQ		= 0,
+	V4L2_CODEC_MFC5X_ENC_SEQ_HDR_MODE_SEQ_FRAME	= 1,
+};
+#define V4L2_CID_CODEC_MFC5X_ENC_FRAME_SKIP_MODE	(V4L2_CID_CODEC_MFC5X_BASE+318)
+enum v4l2_codec_mfc5x_enc_frame_skip_mode {
+	V4L2_CODEC_MFC5X_ENC_FRAME_SKIP_MODE_DISABLE		= 0,
+	V4L2_CODEC_MFC5X_ENC_FRAME_SKIP_MODE_LEVEL		= 1,
+	V4L2_CODEC_MFC5X_ENC_FRAME_SKIP_MODE_VBV_BUF_SIZE	= 2,
+};
+#define V4L2_CID_CODEC_MFC5X_ENC_RC_FIXED_TARGET_BIT	(V4L2_CID_CODEC_MFC5X_BASE+319)
+#define V4L2_CID_CODEC_MFC5X_ENC_FRAME_DELTA		(V4L2_CID_CODEC_MFC5X_BASE+320)
+
+/* codec specific */
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_B_FRAMES		(V4L2_CID_CODEC_MFC5X_BASE+400)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_PROFILE		(V4L2_CID_CODEC_MFC5X_BASE+401)
+enum v4l2_codec_mfc5x_enc_h264_profile {
+	V4L2_CODEC_MFC5X_ENC_H264_PROFILE_MAIN		= 0,
+	V4L2_CODEC_MFC5X_ENC_H264_PROFILE_HIGH		= 1,
+	V4L2_CODEC_MFC5X_ENC_H264_PROFILE_BASELINE	= 2,
+};
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_LEVEL		(V4L2_CID_CODEC_MFC5X_BASE+402)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_INTERLACE		(V4L2_CID_CODEC_MFC5X_BASE+403)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_LOOP_FILTER_MODE	(V4L2_CID_CODEC_MFC5X_BASE+404)
+enum v4l2_codec_mfc5x_enc_h264_loop_filter {
+	V4L2_CODEC_MFC5X_ENC_H264_LOOP_FILTER_ENABLE			= 0,
+	V4L2_CODEC_MFC5X_ENC_H264_LOOP_FILTER_DISABLE			= 1,
+	V4L2_CODEC_MFC5X_ENC_H264_LOOP_FILTER_DISABLE_AT_BOUNDARY	= 2,
+};
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_LOOP_FILTER_ALPHA	(V4L2_CID_CODEC_MFC5X_BASE+405)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_LOOP_FILTER_BETA	(V4L2_CID_CODEC_MFC5X_BASE+406)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_ENTROPY_MODE	(V4L2_CID_CODEC_MFC5X_BASE+407)
+enum v4l2_codec_mfc5x_enc_h264_entropy_mode {
+	V4L2_CODEC_MFC5X_ENC_H264_ENTROPY_MODE_CAVLC	= 0,
+	V4L2_CODEC_MFC5X_ENC_H264_ENTROPY_MODE_CABAC	= 1,
+};
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_MAX_REF_PIC	(V4L2_CID_CODEC_MFC5X_BASE+408)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_NUM_REF_PIC_4P	(V4L2_CID_CODEC_MFC5X_BASE+409)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_8X8_TRANSFORM	(V4L2_CID_CODEC_MFC5X_BASE+410)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_MB_ENABLE	(V4L2_CID_CODEC_MFC5X_BASE+411)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_FRAME_RATE	(V4L2_CID_CODEC_MFC5X_BASE+412)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_FRAME_QP	(V4L2_CID_CODEC_MFC5X_BASE+413)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_MIN_QP		(V4L2_CID_CODEC_MFC5X_BASE+414)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_MAX_QP		(V4L2_CID_CODEC_MFC5X_BASE+415)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_MB_DARK	(V4L2_CID_CODEC_MFC5X_BASE+416)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_MB_SMOOTH	(V4L2_CID_CODEC_MFC5X_BASE+417)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_MB_STATIC	(V4L2_CID_CODEC_MFC5X_BASE+418)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_MB_ACTIVITY	(V4L2_CID_CODEC_MFC5X_BASE+419)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_P_FRAME_QP	(V4L2_CID_CODEC_MFC5X_BASE+420)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_RC_B_FRAME_QP	(V4L2_CID_CODEC_MFC5X_BASE+421)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_AR_VUI_ENABLE	(V4L2_CID_CODEC_MFC5X_BASE+422)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_AR_VUI_IDC	(V4L2_CID_CODEC_MFC5X_BASE+423)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_EXT_SAR_WIDTH	(V4L2_CID_CODEC_MFC5X_BASE+424)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_EXT_SAR_HEIGHT	(V4L2_CID_CODEC_MFC5X_BASE+425)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_OPEN_GOP		(V4L2_CID_CODEC_MFC5X_BASE+426)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_I_PERIOD		(V4L2_CID_CODEC_MFC5X_BASE+427)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_HIER_P_ENABLE	(V4L2_CID_CODEC_MFC5X_BASE+428)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_LAYER0_QP		(V4L2_CID_CODEC_MFC5X_BASE+429)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_LAYER1_QP		(V4L2_CID_CODEC_MFC5X_BASE+430)
+#define V4L2_CID_CODEC_MFC5X_ENC_H264_LAYER2_QP		(V4L2_CID_CODEC_MFC5X_BASE+431)
+
+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_B_FRAMES		(V4L2_CID_CODEC_MFC5X_BASE+440)
+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_PROFILE		(V4L2_CID_CODEC_MFC5X_BASE+441)
+enum v4l2_codec_mfc5x_enc_mpeg4_profile {
+	V4L2_CODEC_MFC5X_ENC_MPEG4_PROFILE_SIMPLE		= 0,
+	V4L2_CODEC_MFC5X_ENC_MPEG4_PROFILE_ADVANCED_SIMPLE	= 1,
+};
+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_LEVEL		(V4L2_CID_CODEC_MFC5X_BASE+442)
+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_RC_FRAME_QP	(V4L2_CID_CODEC_MFC5X_BASE+443)
+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_RC_MIN_QP	(V4L2_CID_CODEC_MFC5X_BASE+444)
+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_RC_MAX_QP	(V4L2_CID_CODEC_MFC5X_BASE+445)
+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_QUARTER_PIXEL	(V4L2_CID_CODEC_MFC5X_BASE+446)
+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_RC_P_FRAME_QP	(V4L2_CID_CODEC_MFC5X_BASE+447)
+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_RC_B_FRAME_QP	(V4L2_CID_CODEC_MFC5X_BASE+448)
+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_VOP_TIME_RES	(V4L2_CID_CODEC_MFC5X_BASE+449)
+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_VOP_FRM_DELTA	(V4L2_CID_CODEC_MFC5X_BASE+450)
+#define V4L2_CID_CODEC_MFC5X_ENC_MPEG4_RC_MB_ENABLE	(V4L2_CID_CODEC_MFC5X_BASE+451)
+
+#define V4L2_CID_CODEC_MFC5X_ENC_H263_RC_FRAME_RATE	(V4L2_CID_CODEC_MFC5X_BASE+460)
+#define V4L2_CID_CODEC_MFC5X_ENC_H263_RC_FRAME_QP	(V4L2_CID_CODEC_MFC5X_BASE+461)
+#define V4L2_CID_CODEC_MFC5X_ENC_H263_RC_MIN_QP		(V4L2_CID_CODEC_MFC5X_BASE+462)
+#define V4L2_CID_CODEC_MFC5X_ENC_H263_RC_MAX_QP		(V4L2_CID_CODEC_MFC5X_BASE+463)
+#define V4L2_CID_CODEC_MFC5X_ENC_H263_RC_P_FRAME_QP	(V4L2_CID_CODEC_MFC5X_BASE+464)
+#define V4L2_CID_CODEC_MFC5X_ENC_H263_RC_MB_ENABLE	(V4L2_CID_CODEC_MFC5X_BASE+465)
+
+/*  Camera class control IDs */
+#define V4L2_CID_CAMERA_CLASS_BASE 	(V4L2_CTRL_CLASS_CAMERA | 0x900)
+#define V4L2_CID_CAMERA_CLASS 		(V4L2_CTRL_CLASS_CAMERA | 1)
+
+#define V4L2_CID_EXPOSURE_AUTO			(V4L2_CID_CAMERA_CLASS_BASE+1)
+enum  v4l2_exposure_auto_type {
+	V4L2_EXPOSURE_AUTO = 0,
+	V4L2_EXPOSURE_MANUAL = 1,
+	V4L2_EXPOSURE_SHUTTER_PRIORITY = 2,
+	V4L2_EXPOSURE_APERTURE_PRIORITY = 3
+};
+#define V4L2_CID_EXPOSURE_ABSOLUTE		(V4L2_CID_CAMERA_CLASS_BASE+2)
+#define V4L2_CID_EXPOSURE_AUTO_PRIORITY		(V4L2_CID_CAMERA_CLASS_BASE+3)
+
+#define V4L2_CID_PAN_RELATIVE			(V4L2_CID_CAMERA_CLASS_BASE+4)
+#define V4L2_CID_TILT_RELATIVE			(V4L2_CID_CAMERA_CLASS_BASE+5)
+#define V4L2_CID_PAN_RESET			(V4L2_CID_CAMERA_CLASS_BASE+6)
+#define V4L2_CID_TILT_RESET			(V4L2_CID_CAMERA_CLASS_BASE+7)
+
+#define V4L2_CID_PAN_ABSOLUTE			(V4L2_CID_CAMERA_CLASS_BASE+8)
+#define V4L2_CID_TILT_ABSOLUTE			(V4L2_CID_CAMERA_CLASS_BASE+9)
+
+#define V4L2_CID_FOCUS_ABSOLUTE			(V4L2_CID_CAMERA_CLASS_BASE+10)
+#define V4L2_CID_FOCUS_RELATIVE			(V4L2_CID_CAMERA_CLASS_BASE+11)
+#define V4L2_CID_FOCUS_AUTO			(V4L2_CID_CAMERA_CLASS_BASE+12)
+
+#define V4L2_CID_ZOOM_ABSOLUTE			(V4L2_CID_CAMERA_CLASS_BASE+13)
+#define V4L2_CID_ZOOM_RELATIVE			(V4L2_CID_CAMERA_CLASS_BASE+14)
+#define V4L2_CID_ZOOM_CONTINUOUS		(V4L2_CID_CAMERA_CLASS_BASE+15)
+
+#define V4L2_CID_PRIVACY			(V4L2_CID_CAMERA_CLASS_BASE+16)
+
+#define V4L2_CID_IRIS_ABSOLUTE			(V4L2_CID_CAMERA_CLASS_BASE+17)
+#define V4L2_CID_IRIS_RELATIVE			(V4L2_CID_CAMERA_CLASS_BASE+18)
+
+/* FM Modulator class control IDs */
+#define V4L2_CID_FM_TX_CLASS_BASE		(V4L2_CTRL_CLASS_FM_TX | 0x900)
+#define V4L2_CID_FM_TX_CLASS			(V4L2_CTRL_CLASS_FM_TX | 1)
+
+#define V4L2_CID_RDS_TX_DEVIATION		(V4L2_CID_FM_TX_CLASS_BASE + 1)
+#define V4L2_CID_RDS_TX_PI			(V4L2_CID_FM_TX_CLASS_BASE + 2)
+#define V4L2_CID_RDS_TX_PTY			(V4L2_CID_FM_TX_CLASS_BASE + 3)
+#define V4L2_CID_RDS_TX_PS_NAME			(V4L2_CID_FM_TX_CLASS_BASE + 5)
+#define V4L2_CID_RDS_TX_RADIO_TEXT		(V4L2_CID_FM_TX_CLASS_BASE + 6)
+
+#define V4L2_CID_AUDIO_LIMITER_ENABLED		(V4L2_CID_FM_TX_CLASS_BASE + 64)
+#define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME	(V4L2_CID_FM_TX_CLASS_BASE + 65)
+#define V4L2_CID_AUDIO_LIMITER_DEVIATION	(V4L2_CID_FM_TX_CLASS_BASE + 66)
+
+#define V4L2_CID_AUDIO_COMPRESSION_ENABLED	(V4L2_CID_FM_TX_CLASS_BASE + 80)
+#define V4L2_CID_AUDIO_COMPRESSION_GAIN		(V4L2_CID_FM_TX_CLASS_BASE + 81)
+#define V4L2_CID_AUDIO_COMPRESSION_THRESHOLD	(V4L2_CID_FM_TX_CLASS_BASE + 82)
+#define V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME	(V4L2_CID_FM_TX_CLASS_BASE + 83)
+#define V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME	(V4L2_CID_FM_TX_CLASS_BASE + 84)
+
+#define V4L2_CID_PILOT_TONE_ENABLED		(V4L2_CID_FM_TX_CLASS_BASE + 96)
+#define V4L2_CID_PILOT_TONE_DEVIATION		(V4L2_CID_FM_TX_CLASS_BASE + 97)
+#define V4L2_CID_PILOT_TONE_FREQUENCY		(V4L2_CID_FM_TX_CLASS_BASE + 98)
+
+#define V4L2_CID_TUNE_PREEMPHASIS		(V4L2_CID_FM_TX_CLASS_BASE + 112)
+enum v4l2_preemphasis {
+	V4L2_PREEMPHASIS_DISABLED	= 0,
+	V4L2_PREEMPHASIS_50_uS		= 1,
+	V4L2_PREEMPHASIS_75_uS		= 2,
+};
+#define V4L2_CID_TUNE_POWER_LEVEL		(V4L2_CID_FM_TX_CLASS_BASE + 113)
+#define V4L2_CID_TUNE_ANTENNA_CAPACITOR		(V4L2_CID_FM_TX_CLASS_BASE + 114)
+
+/*
+ *	T U N I N G
+ */
+struct v4l2_tuner {
+	__u32                   index;
+	__u8			name[32];
+	enum v4l2_tuner_type    type;
+	__u32			capability;
+	__u32			rangelow;
+	__u32			rangehigh;
+	__u32			rxsubchans;
+	__u32			audmode;
+	__s32			signal;
+	__s32			afc;
+	__u32			reserved[4];
+};
+
+struct v4l2_modulator {
+	__u32			index;
+	__u8			name[32];
+	__u32			capability;
+	__u32			rangelow;
+	__u32			rangehigh;
+	__u32			txsubchans;
+	__u32			reserved[4];
+};
+
+/*  Flags for the 'capability' field */
+#define V4L2_TUNER_CAP_LOW		0x0001
+#define V4L2_TUNER_CAP_NORM		0x0002
+#define V4L2_TUNER_CAP_STEREO		0x0010
+#define V4L2_TUNER_CAP_LANG2		0x0020
+#define V4L2_TUNER_CAP_SAP		0x0020
+#define V4L2_TUNER_CAP_LANG1		0x0040
+#define V4L2_TUNER_CAP_RDS		0x0080
+#define V4L2_TUNER_CAP_RDS_BLOCK_IO	0x0100
+#define V4L2_TUNER_CAP_RDS_CONTROLS	0x0200
+
+/*  Flags for the 'rxsubchans' field */
+#define V4L2_TUNER_SUB_MONO		0x0001
+#define V4L2_TUNER_SUB_STEREO		0x0002
+#define V4L2_TUNER_SUB_LANG2		0x0004
+#define V4L2_TUNER_SUB_SAP		0x0004
+#define V4L2_TUNER_SUB_LANG1		0x0008
+#define V4L2_TUNER_SUB_RDS		0x0010
+
+/*  Values for the 'audmode' field */
+#define V4L2_TUNER_MODE_MONO		0x0000
+#define V4L2_TUNER_MODE_STEREO		0x0001
+#define V4L2_TUNER_MODE_LANG2		0x0002
+#define V4L2_TUNER_MODE_SAP		0x0002
+#define V4L2_TUNER_MODE_LANG1		0x0003
+#define V4L2_TUNER_MODE_LANG1_LANG2	0x0004
+
+struct v4l2_frequency {
+	__u32		      tuner;
+	enum v4l2_tuner_type  type;
+	__u32		      frequency;
+	__u32		      reserved[8];
+};
+
+struct v4l2_hw_freq_seek {
+	__u32		      tuner;
+	enum v4l2_tuner_type  type;
+	__u32		      seek_upward;
+	__u32		      wrap_around;
+	__u32		      spacing;
+	__u32		      reserved[7];
+};
+
+/*
+ *	R D S
+ */
+
+struct v4l2_rds_data {
+	__u8 	lsb;
+	__u8 	msb;
+	__u8 	block;
+} __attribute__ ((packed));
+
+#define V4L2_RDS_BLOCK_MSK 	 0x7
+#define V4L2_RDS_BLOCK_A 	 0
+#define V4L2_RDS_BLOCK_B 	 1
+#define V4L2_RDS_BLOCK_C 	 2
+#define V4L2_RDS_BLOCK_D 	 3
+#define V4L2_RDS_BLOCK_C_ALT 	 4
+#define V4L2_RDS_BLOCK_INVALID 	 7
+
+#define V4L2_RDS_BLOCK_CORRECTED 0x40
+#define V4L2_RDS_BLOCK_ERROR 	 0x80
+
+/*
+ *	A U D I O
+ */
+struct v4l2_audio {
+	__u32	index;
+	__u8	name[32];
+	__u32	capability;
+	__u32	mode;
+	__u32	reserved[2];
+};
+
+/*  Flags for the 'capability' field */
+#define V4L2_AUDCAP_STEREO		0x00001
+#define V4L2_AUDCAP_AVL			0x00002
+
+/*  Flags for the 'mode' field */
+#define V4L2_AUDMODE_AVL		0x00001
+
+struct v4l2_audioout {
+	__u32	index;
+	__u8	name[32];
+	__u32	capability;
+	__u32	mode;
+	__u32	reserved[2];
+};
+
+/*
+ *	M P E G   S E R V I C E S
+ *
+ *	NOTE: EXPERIMENTAL API
+ */
+#if 1
+#define V4L2_ENC_IDX_FRAME_I    (0)
+#define V4L2_ENC_IDX_FRAME_P    (1)
+#define V4L2_ENC_IDX_FRAME_B    (2)
+#define V4L2_ENC_IDX_FRAME_MASK (0xf)
+
+struct v4l2_enc_idx_entry {
+	__u64 offset;
+	__u64 pts;
+	__u32 length;
+	__u32 flags;
+	__u32 reserved[2];
+};
+
+#define V4L2_ENC_IDX_ENTRIES (64)
+struct v4l2_enc_idx {
+	__u32 entries;
+	__u32 entries_cap;
+	__u32 reserved[4];
+	struct v4l2_enc_idx_entry entry[V4L2_ENC_IDX_ENTRIES];
+};
+
+
+#define V4L2_ENC_CMD_START      (0)
+#define V4L2_ENC_CMD_STOP       (1)
+#define V4L2_ENC_CMD_PAUSE      (2)
+#define V4L2_ENC_CMD_RESUME     (3)
+
+/* Flags for V4L2_ENC_CMD_STOP */
+#define V4L2_ENC_CMD_STOP_AT_GOP_END    (1 << 0)
+
+struct v4l2_encoder_cmd {
+	__u32 cmd;
+	__u32 flags;
+	union {
+		struct {
+			__u32 data[8];
+		} raw;
+	};
+};
+
+#endif
+
+
+/*
+ *	D A T A   S E R V I C E S   ( V B I )
+ *
+ *	Data services API by Michael Schimek
+ */
+
+/* Raw VBI */
+struct v4l2_vbi_format {
+	__u32	sampling_rate;		/* in 1 Hz */
+	__u32	offset;
+	__u32	samples_per_line;
+	__u32	sample_format;		/* V4L2_PIX_FMT_* */
+	__s32	start[2];
+	__u32	count[2];
+	__u32	flags;			/* V4L2_VBI_* */
+	__u32	reserved[2];		/* must be zero */
+};
+
+/*  VBI flags  */
+#define V4L2_VBI_UNSYNC		(1 << 0)
+#define V4L2_VBI_INTERLACED	(1 << 1)
+
+/* Sliced VBI
+ *
+ *    This implements is a proposal V4L2 API to allow SLICED VBI
+ * required for some hardware encoders. It should change without
+ * notice in the definitive implementation.
+ */
+
+struct v4l2_sliced_vbi_format {
+	__u16   service_set;
+	/* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
+	   service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
+				 (equals frame lines 313-336 for 625 line video
+				  standards, 263-286 for 525 line standards) */
+	__u16   service_lines[2][24];
+	__u32   io_size;
+	__u32   reserved[2];            /* must be zero */
+};
+
+/* Teletext World System Teletext
+   (WST), defined on ITU-R BT.653-2 */
+#define V4L2_SLICED_TELETEXT_B          (0x0001)
+/* Video Program System, defined on ETS 300 231*/
+#define V4L2_SLICED_VPS                 (0x0400)
+/* Closed Caption, defined on EIA-608 */
+#define V4L2_SLICED_CAPTION_525         (0x1000)
+/* Wide Screen System, defined on ITU-R BT1119.1 */
+#define V4L2_SLICED_WSS_625             (0x4000)
+
+#define V4L2_SLICED_VBI_525             (V4L2_SLICED_CAPTION_525)
+#define V4L2_SLICED_VBI_625             (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625)
+
+struct v4l2_sliced_vbi_cap {
+	__u16   service_set;
+	/* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
+	   service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
+				 (equals frame lines 313-336 for 625 line video
+				  standards, 263-286 for 525 line standards) */
+	__u16   service_lines[2][24];
+	enum v4l2_buf_type type;
+	__u32   reserved[3];    /* must be 0 */
+};
+
+struct v4l2_sliced_vbi_data {
+	__u32   id;
+	__u32   field;          /* 0: first field, 1: second field */
+	__u32   line;           /* 1-23 */
+	__u32   reserved;       /* must be 0 */
+	__u8    data[48];
+};
+
+/*
+ * Sliced VBI data inserted into MPEG Streams
+ */
+
+/*
+ * V4L2_MPEG_STREAM_VBI_FMT_IVTV:
+ *
+ * Structure of payload contained in an MPEG 2 Private Stream 1 PES Packet in an
+ * MPEG-2 Program Pack that contains V4L2_MPEG_STREAM_VBI_FMT_IVTV Sliced VBI
+ * data
+ *
+ * Note, the MPEG-2 Program Pack and Private Stream 1 PES packet header
+ * definitions are not included here.  See the MPEG-2 specifications for details
+ * on these headers.
+ */
+
+/* Line type IDs */
+#define V4L2_MPEG_VBI_IVTV_TELETEXT_B     (1)
+#define V4L2_MPEG_VBI_IVTV_CAPTION_525    (4)
+#define V4L2_MPEG_VBI_IVTV_WSS_625        (5)
+#define V4L2_MPEG_VBI_IVTV_VPS            (7)
+
+struct v4l2_mpeg_vbi_itv0_line {
+	__u8 id;	/* One of V4L2_MPEG_VBI_IVTV_* above */
+	__u8 data[42];	/* Sliced VBI data for the line */
+} __attribute__ ((packed));
+
+struct v4l2_mpeg_vbi_itv0 {
+	__le32 linemask[2]; /* Bitmasks of VBI service lines present */
+	struct v4l2_mpeg_vbi_itv0_line line[35];
+} __attribute__ ((packed));
+
+struct v4l2_mpeg_vbi_ITV0 {
+	struct v4l2_mpeg_vbi_itv0_line line[36];
+} __attribute__ ((packed));
+
+#define V4L2_MPEG_VBI_IVTV_MAGIC0	"itv0"
+#define V4L2_MPEG_VBI_IVTV_MAGIC1	"ITV0"
+
+struct v4l2_mpeg_vbi_fmt_ivtv {
+	__u8 magic[4];
+	union {
+		struct v4l2_mpeg_vbi_itv0 itv0;
+		struct v4l2_mpeg_vbi_ITV0 ITV0;
+	};
+} __attribute__ ((packed));
+
+/*
+ *	A G G R E G A T E   S T R U C T U R E S
+ */
+
+/**
+ * struct v4l2_plane_pix_format - additional, per-plane format definition
+ * @sizeimage:		maximum size in bytes required for data, for which
+ *			this plane will be used
+ * @bytesperline:	distance in bytes between the leftmost pixels in two
+ *			adjacent lines
+ */
+struct v4l2_plane_pix_format {
+	__u32		sizeimage;
+	__u16		bytesperline;
+	__u16		reserved[7];
+} __attribute__ ((packed));
+
+/**
+ * struct v4l2_pix_format_mplane - multiplanar format definition
+ * @width:		image width in pixels
+ * @height:		image height in pixels
+ * @pixelformat:	little endian four character code (fourcc)
+ * @field:		field order (for interlaced video)
+ * @colorspace:		supplemental to pixelformat
+ * @plane_fmt:		per-plane information
+ * @num_planes:		number of planes for this format
+ */
+struct v4l2_pix_format_mplane {
+	__u32				width;
+	__u32				height;
+	__u32				pixelformat;
+	enum v4l2_field			field;
+	enum v4l2_colorspace		colorspace;
+
+	struct v4l2_plane_pix_format	plane_fmt[VIDEO_MAX_PLANES];
+	__u8				num_planes;
+	__u8				reserved[11];
+} __attribute__ ((packed));
+
+/**
+ * struct v4l2_format - stream data format
+ * @type:	type of the data stream
+ * @pix:	definition of an image format
+ * @pix_mp:	definition of a multiplanar image format
+ * @win:	definition of an overlaid image
+ * @vbi:	raw VBI capture or output parameters
+ * @sliced:	sliced VBI capture or output parameters
+ * @raw_data:	placeholder for future extensions and custom formats
+ */
+struct v4l2_format {
+	enum v4l2_buf_type type;
+	union {
+		struct v4l2_pix_format		pix;     /* V4L2_BUF_TYPE_VIDEO_CAPTURE */
+		struct v4l2_pix_format_mplane	pix_mp;  /* V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE */
+		struct v4l2_window		win;     /* V4L2_BUF_TYPE_VIDEO_OVERLAY */
+		struct v4l2_vbi_format		vbi;     /* V4L2_BUF_TYPE_VBI_CAPTURE */
+		struct v4l2_sliced_vbi_format	sliced;  /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */
+		__u8	raw_data[200];                   /* user-defined */
+	} fmt;
+};
+
+/*	Stream type-dependent parameters
+ */
+struct v4l2_streamparm {
+	enum v4l2_buf_type type;
+	union {
+		struct v4l2_captureparm	capture;
+		struct v4l2_outputparm	output;
+		__u8	raw_data[200];  /* user-defined */
+	} parm;
+};
+
+/*
+ *	E V E N T S
+ */
+
+#define V4L2_EVENT_ALL				0
+#define V4L2_EVENT_VSYNC			1
+#define V4L2_EVENT_EOS				2
+#define V4L2_EVENT_PRIVATE_START		0x08000000
+
+/* Payload for V4L2_EVENT_VSYNC */
+struct v4l2_event_vsync {
+	/* Can be V4L2_FIELD_ANY, _NONE, _TOP or _BOTTOM */
+	__u8 field;
+} __attribute__ ((packed));
+
+struct v4l2_event {
+	__u32				type;
+	union {
+		struct v4l2_event_vsync vsync;
+		__u8			data[64];
+	} u;
+	__u32				pending;
+	__u32				sequence;
+	struct timespec			timestamp;
+	__u32				reserved[9];
+};
+
+struct v4l2_event_subscription {
+	__u32				type;
+	__u32				reserved[7];
+};
+
+/*
+ *	A D V A N C E D   D E B U G G I N G
+ *
+ *	NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS!
+ *	FOR DEBUGGING, TESTING AND INTERNAL USE ONLY!
+ */
+
+/* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */
+
+#define V4L2_CHIP_MATCH_HOST       0  /* Match against chip ID on host (0 for the host) */
+#define V4L2_CHIP_MATCH_I2C_DRIVER 1  /* Match against I2C driver name */
+#define V4L2_CHIP_MATCH_I2C_ADDR   2  /* Match against I2C 7-bit address */
+#define V4L2_CHIP_MATCH_AC97       3  /* Match against anciliary AC97 chip */
+
+struct v4l2_dbg_match {
+	__u32 type; /* Match type */
+	union {     /* Match this chip, meaning determined by type */
+		__u32 addr;
+		char name[32];
+	};
+} __attribute__ ((packed));
+
+struct v4l2_dbg_register {
+	struct v4l2_dbg_match match;
+	__u32 size;	/* register size in bytes */
+	__u64 reg;
+	__u64 val;
+} __attribute__ ((packed));
+
+/* VIDIOC_DBG_G_CHIP_IDENT */
+struct v4l2_dbg_chip_ident {
+	struct v4l2_dbg_match match;
+	__u32 ident;       /* chip identifier as specified in <media/v4l2-chip-ident.h> */
+	__u32 revision;    /* chip revision, chip specific */
+} __attribute__ ((packed));
+
+/*
+ *	I O C T L   C O D E S   F O R   V I D E O   D E V I C E S
+ *
+ */
+#define VIDIOC_QUERYCAP		 _IOR('V',  0, struct v4l2_capability)
+#define VIDIOC_RESERVED		  _IO('V',  1)
+#define VIDIOC_ENUM_FMT         _IOWR('V',  2, struct v4l2_fmtdesc)
+#define VIDIOC_G_FMT		_IOWR('V',  4, struct v4l2_format)
+#define VIDIOC_S_FMT		_IOWR('V',  5, struct v4l2_format)
+#define VIDIOC_REQBUFS		_IOWR('V',  8, struct v4l2_requestbuffers)
+#define VIDIOC_QUERYBUF		_IOWR('V',  9, struct v4l2_buffer)
+#define VIDIOC_G_FBUF		 _IOR('V', 10, struct v4l2_framebuffer)
+#define VIDIOC_S_FBUF		 _IOW('V', 11, struct v4l2_framebuffer)
+#define VIDIOC_OVERLAY		 _IOW('V', 14, int)
+#define VIDIOC_QBUF		_IOWR('V', 15, struct v4l2_buffer)
+#define VIDIOC_DQBUF		_IOWR('V', 17, struct v4l2_buffer)
+#define VIDIOC_STREAMON		 _IOW('V', 18, int)
+#define VIDIOC_STREAMOFF	 _IOW('V', 19, int)
+#define VIDIOC_G_PARM		_IOWR('V', 21, struct v4l2_streamparm)
+#define VIDIOC_S_PARM		_IOWR('V', 22, struct v4l2_streamparm)
+#define VIDIOC_G_STD		 _IOR('V', 23, v4l2_std_id)
+#define VIDIOC_S_STD		 _IOW('V', 24, v4l2_std_id)
+#define VIDIOC_ENUMSTD		_IOWR('V', 25, struct v4l2_standard)
+#define VIDIOC_ENUMINPUT	_IOWR('V', 26, struct v4l2_input)
+#define VIDIOC_G_CTRL		_IOWR('V', 27, struct v4l2_control)
+#define VIDIOC_S_CTRL		_IOWR('V', 28, struct v4l2_control)
+#define VIDIOC_G_TUNER		_IOWR('V', 29, struct v4l2_tuner)
+#define VIDIOC_S_TUNER		 _IOW('V', 30, struct v4l2_tuner)
+#define VIDIOC_G_AUDIO		 _IOR('V', 33, struct v4l2_audio)
+#define VIDIOC_S_AUDIO		 _IOW('V', 34, struct v4l2_audio)
+#define VIDIOC_QUERYCTRL	_IOWR('V', 36, struct v4l2_queryctrl)
+#define VIDIOC_QUERYMENU	_IOWR('V', 37, struct v4l2_querymenu)
+#define VIDIOC_G_INPUT		 _IOR('V', 38, int)
+#define VIDIOC_S_INPUT		_IOWR('V', 39, int)
+#define VIDIOC_G_OUTPUT		 _IOR('V', 46, int)
+#define VIDIOC_S_OUTPUT		_IOWR('V', 47, int)
+#define VIDIOC_ENUMOUTPUT	_IOWR('V', 48, struct v4l2_output)
+#define VIDIOC_G_AUDOUT		 _IOR('V', 49, struct v4l2_audioout)
+#define VIDIOC_S_AUDOUT		 _IOW('V', 50, struct v4l2_audioout)
+#define VIDIOC_G_MODULATOR	_IOWR('V', 54, struct v4l2_modulator)
+#define VIDIOC_S_MODULATOR	 _IOW('V', 55, struct v4l2_modulator)
+#define VIDIOC_G_FREQUENCY	_IOWR('V', 56, struct v4l2_frequency)
+#define VIDIOC_S_FREQUENCY	 _IOW('V', 57, struct v4l2_frequency)
+#define VIDIOC_CROPCAP		_IOWR('V', 58, struct v4l2_cropcap)
+#define VIDIOC_G_CROP		_IOWR('V', 59, struct v4l2_crop)
+#define VIDIOC_S_CROP		 _IOW('V', 60, struct v4l2_crop)
+#define VIDIOC_G_JPEGCOMP	 _IOR('V', 61, struct v4l2_jpegcompression)
+#define VIDIOC_S_JPEGCOMP	 _IOW('V', 62, struct v4l2_jpegcompression)
+#define VIDIOC_QUERYSTD      	 _IOR('V', 63, v4l2_std_id)
+#define VIDIOC_TRY_FMT      	_IOWR('V', 64, struct v4l2_format)
+#define VIDIOC_ENUMAUDIO	_IOWR('V', 65, struct v4l2_audio)
+#define VIDIOC_ENUMAUDOUT	_IOWR('V', 66, struct v4l2_audioout)
+#define VIDIOC_G_PRIORITY        _IOR('V', 67, enum v4l2_priority)
+#define VIDIOC_S_PRIORITY        _IOW('V', 68, enum v4l2_priority)
+#define VIDIOC_G_SLICED_VBI_CAP _IOWR('V', 69, struct v4l2_sliced_vbi_cap)
+#define VIDIOC_LOG_STATUS         _IO('V', 70)
+#define VIDIOC_G_EXT_CTRLS	_IOWR('V', 71, struct v4l2_ext_controls)
+#define VIDIOC_S_EXT_CTRLS	_IOWR('V', 72, struct v4l2_ext_controls)
+#define VIDIOC_TRY_EXT_CTRLS	_IOWR('V', 73, struct v4l2_ext_controls)
+#if 1
+#define VIDIOC_ENUM_FRAMESIZES	_IOWR('V', 74, struct v4l2_frmsizeenum)
+#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum)
+#define VIDIOC_G_ENC_INDEX       _IOR('V', 76, struct v4l2_enc_idx)
+#define VIDIOC_ENCODER_CMD      _IOWR('V', 77, struct v4l2_encoder_cmd)
+#define VIDIOC_TRY_ENCODER_CMD  _IOWR('V', 78, struct v4l2_encoder_cmd)
+#endif
+
+#if 1
+/* Experimental, meant for debugging, testing and internal use.
+   Only implemented if CONFIG_VIDEO_ADV_DEBUG is defined.
+   You must be root to use these ioctls. Never use these in applications! */
+#define	VIDIOC_DBG_S_REGISTER 	 _IOW('V', 79, struct v4l2_dbg_register)
+#define	VIDIOC_DBG_G_REGISTER 	_IOWR('V', 80, struct v4l2_dbg_register)
+
+/* Experimental, meant for debugging, testing and internal use.
+   Never use this ioctl in applications! */
+#define VIDIOC_DBG_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_dbg_chip_ident)
+#endif
+
+#define VIDIOC_S_HW_FREQ_SEEK	 _IOW('V', 82, struct v4l2_hw_freq_seek)
+#define	VIDIOC_ENUM_DV_PRESETS	_IOWR('V', 83, struct v4l2_dv_enum_preset)
+#define	VIDIOC_S_DV_PRESET	_IOWR('V', 84, struct v4l2_dv_preset)
+#define	VIDIOC_G_DV_PRESET	_IOWR('V', 85, struct v4l2_dv_preset)
+#define	VIDIOC_QUERY_DV_PRESET	_IOR('V',  86, struct v4l2_dv_preset)
+#define	VIDIOC_S_DV_TIMINGS	_IOWR('V', 87, struct v4l2_dv_timings)
+#define	VIDIOC_G_DV_TIMINGS	_IOWR('V', 88, struct v4l2_dv_timings)
+#define	VIDIOC_DQEVENT		 _IOR('V', 89, struct v4l2_event)
+#define	VIDIOC_SUBSCRIBE_EVENT	 _IOW('V', 90, struct v4l2_event_subscription)
+#define	VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription)
+
+/* Reminder: when adding new ioctls please add support for them to
+   drivers/media/video/v4l2-compat-ioctl32.c as well! */
+
+#define BASE_VIDIOC_PRIVATE	192		/* 192-255 are private */
+
+#endif /* __LINUX_VIDEODEV2_H */
diff --git a/exynos4/hal/include/videodev2_samsung.h b/exynos4/hal/include/videodev2_samsung.h
new file mode 100644
index 0000000..41f8338
--- /dev/null
+++ b/exynos4/hal/include/videodev2_samsung.h
@@ -0,0 +1,1115 @@
+/*
+ * Video for Linux Two header file for samsung
+ *
+ * Copyright (C) 2009, Dongsoo Nathaniel Kim<dongsoo45.kim@samsung.com>
+ *
+ * This header file contains several v4l2 APIs to be proposed to v4l2
+ * community and until bein accepted, will be used restrictly in Samsung's
+ * camera interface driver FIMC.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Alternatively, Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __LINUX_VIDEODEV2_SAMSUNG_H
+#define __LINUX_VIDEODEV2_SAMSUNG_H
+
+/* Values for 'capabilities' field */
+/* Object detection device */
+#define V4L2_CAP_OBJ_RECOGNITION    0x10000000
+/* strobe control */
+#define V4L2_CAP_STROBE         0x20000000
+
+#define V4L2_CID_FOCUS_MODE     (V4L2_CID_CAMERA_CLASS_BASE+17)
+/* Focus Methods */
+enum v4l2_focus_mode {
+    V4L2_FOCUS_MODE_AUTO        = 0,
+    V4L2_FOCUS_MODE_MACRO       = 1,
+    V4L2_FOCUS_MODE_MANUAL      = 2,
+    V4L2_FOCUS_MODE_LASTP       = 2,
+};
+
+#define V4L2_CID_ZOOM_MODE      (V4L2_CID_CAMERA_CLASS_BASE+18)
+/* Zoom Methods */
+enum v4l2_zoom_mode {
+    V4L2_ZOOM_MODE_CONTINUOUS   = 0,
+    V4L2_ZOOM_MODE_OPTICAL      = 1,
+    V4L2_ZOOM_MODE_DIGITAL      = 2,
+    V4L2_ZOOM_MODE_LASTP        = 2,
+};
+
+/* Exposure Methods */
+#define V4L2_CID_PHOTOMETRY     (V4L2_CID_CAMERA_CLASS_BASE+19)
+enum v4l2_photometry_mode {
+    V4L2_PHOTOMETRY_MULTISEG    = 0, /*Multi Segment*/
+    V4L2_PHOTOMETRY_CWA     = 1, /*Centre Weighted Average*/
+    V4L2_PHOTOMETRY_SPOT        = 2,
+    V4L2_PHOTOMETRY_AFSPOT      = 3, /*Spot metering on focused point*/
+    V4L2_PHOTOMETRY_LASTP       = V4L2_PHOTOMETRY_AFSPOT,
+};
+
+/* Manual exposure control items menu type: iris, shutter, iso */
+#define V4L2_CID_CAM_APERTURE   (V4L2_CID_CAMERA_CLASS_BASE+20)
+#define V4L2_CID_CAM_SHUTTER    (V4L2_CID_CAMERA_CLASS_BASE+21)
+#define V4L2_CID_CAM_ISO    (V4L2_CID_CAMERA_CLASS_BASE+22)
+
+/* Following CIDs are menu type */
+#define V4L2_CID_SCENEMODE  (V4L2_CID_CAMERA_CLASS_BASE+23)
+#define V4L2_CID_CAM_STABILIZE  (V4L2_CID_CAMERA_CLASS_BASE+24)
+#define V4L2_CID_CAM_MULTISHOT  (V4L2_CID_CAMERA_CLASS_BASE+25)
+
+/* Control dynamic range */
+#define V4L2_CID_CAM_DR     (V4L2_CID_CAMERA_CLASS_BASE+26)
+
+/* White balance preset control */
+#define V4L2_CID_WHITE_BALANCE_PRESET   (V4L2_CID_CAMERA_CLASS_BASE+27)
+
+/* CID extensions */
+#define V4L2_CID_ROTATION       (V4L2_CID_PRIVATE_BASE + 0)
+#define V4L2_CID_PADDR_Y        (V4L2_CID_PRIVATE_BASE + 1)
+#define V4L2_CID_PADDR_CB       (V4L2_CID_PRIVATE_BASE + 2)
+#define V4L2_CID_PADDR_CR       (V4L2_CID_PRIVATE_BASE + 3)
+#define V4L2_CID_PADDR_CBCR     (V4L2_CID_PRIVATE_BASE + 4)
+#define V4L2_CID_OVERLAY_AUTO       (V4L2_CID_PRIVATE_BASE + 5)
+#define V4L2_CID_OVERLAY_VADDR0     (V4L2_CID_PRIVATE_BASE + 6)
+#define V4L2_CID_OVERLAY_VADDR1     (V4L2_CID_PRIVATE_BASE + 7)
+#define V4L2_CID_OVERLAY_VADDR2     (V4L2_CID_PRIVATE_BASE + 8)
+#define V4L2_CID_OVLY_MODE      (V4L2_CID_PRIVATE_BASE + 9)
+#define V4L2_CID_DST_INFO       (V4L2_CID_PRIVATE_BASE + 10)
+/* UMP secure id control */
+#define V4L2_CID_GET_UMP_SECURE_ID  (V4L2_CID_PRIVATE_BASE + 11)
+#define V4L2_CID_IMAGE_EFFECT_FN    (V4L2_CID_PRIVATE_BASE + 16)
+#define V4L2_CID_IMAGE_EFFECT_APPLY (V4L2_CID_PRIVATE_BASE + 17)
+#define V4L2_CID_IMAGE_EFFECT_CB    (V4L2_CID_PRIVATE_BASE + 18)
+#define V4L2_CID_IMAGE_EFFECT_CR    (V4L2_CID_PRIVATE_BASE + 19)
+#define V4L2_CID_RESERVED_MEM_BASE_ADDR (V4L2_CID_PRIVATE_BASE + 20)
+#define V4L2_CID_FIMC_VERSION       (V4L2_CID_PRIVATE_BASE + 21)
+
+#define V4L2_CID_STREAM_PAUSE           (V4L2_CID_PRIVATE_BASE + 53)
+
+/* CID Extensions for camera sensor operations */
+#define V4L2_CID_CAM_PREVIEW_ONOFF      (V4L2_CID_PRIVATE_BASE + 64)
+#define V4L2_CID_CAM_CAPTURE            (V4L2_CID_PRIVATE_BASE + 65)
+#define V4L2_CID_CAM_JPEG_MEMSIZE       (V4L2_CID_PRIVATE_BASE + 66)
+
+#define V4L2_CID_CAM_DATE_INFO_YEAR             (V4L2_CID_PRIVATE_BASE + 14)
+#define V4L2_CID_CAM_DATE_INFO_MONTH            (V4L2_CID_PRIVATE_BASE + 15)
+#define V4L2_CID_CAM_DATE_INFO_DATE             (V4L2_CID_PRIVATE_BASE + 22)
+#define V4L2_CID_CAM_SENSOR_VER                 (V4L2_CID_PRIVATE_BASE + 23)
+#define V4L2_CID_CAM_FW_MINOR_VER               (V4L2_CID_PRIVATE_BASE + 24)
+#define V4L2_CID_CAM_FW_MAJOR_VER               (V4L2_CID_PRIVATE_BASE + 25)
+#define V4L2_CID_CAM_PRM_MINOR_VER              (V4L2_CID_PRIVATE_BASE + 26)
+#define V4L2_CID_CAM_PRM_MAJOR_VER              (V4L2_CID_PRIVATE_BASE + 27)
+#define V4L2_CID_CAM_FW_VER                     (V4L2_CID_PRIVATE_BASE + 28)
+#define V4L2_CID_CAM_SET_FW_ADDR                (V4L2_CID_PRIVATE_BASE + 29)
+#define V4L2_CID_CAM_SET_FW_SIZE                (V4L2_CID_PRIVATE_BASE + 30)
+#define V4L2_CID_CAM_UPDATE_FW  (V4L2_CID_PRIVATE_BASE + 31)
+#define V4L2_CID_CAM_JPEG_MAIN_SIZE     (V4L2_CID_PRIVATE_BASE + 32)
+#define V4L2_CID_CAM_JPEG_MAIN_OFFSET       (V4L2_CID_PRIVATE_BASE + 33)
+#define V4L2_CID_CAM_JPEG_THUMB_SIZE        (V4L2_CID_PRIVATE_BASE + 34)
+#define V4L2_CID_CAM_JPEG_THUMB_OFFSET      (V4L2_CID_PRIVATE_BASE + 35)
+#define V4L2_CID_CAM_JPEG_POSTVIEW_OFFSET   (V4L2_CID_PRIVATE_BASE + 36)
+#define V4L2_CID_CAM_JPEG_QUALITY   (V4L2_CID_PRIVATE_BASE + 37)
+#define V4L2_CID_CAM_SENSOR_MAKER   (V4L2_CID_PRIVATE_BASE + 38)
+#define V4L2_CID_CAM_SENSOR_OPTICAL (V4L2_CID_PRIVATE_BASE + 39)
+#define V4L2_CID_CAM_AF_VER_LOW     (V4L2_CID_PRIVATE_BASE + 40)
+#define V4L2_CID_CAM_AF_VER_HIGH    (V4L2_CID_PRIVATE_BASE + 41)
+#define V4L2_CID_CAM_GAMMA_RG_LOW   (V4L2_CID_PRIVATE_BASE + 42)
+#define V4L2_CID_CAM_GAMMA_RG_HIGH  (V4L2_CID_PRIVATE_BASE + 43)
+#define V4L2_CID_CAM_GAMMA_BG_LOW   (V4L2_CID_PRIVATE_BASE + 44)
+#define V4L2_CID_CAM_GAMMA_BG_HIGH  (V4L2_CID_PRIVATE_BASE + 45)
+#define V4L2_CID_CAM_DUMP_FW        (V4L2_CID_PRIVATE_BASE + 46)
+#define V4L2_CID_CAM_GET_DUMP_SIZE  (V4L2_CID_PRIVATE_BASE + 47)
+#define V4L2_CID_CAMERA_VT_MODE         (V4L2_CID_PRIVATE_BASE + 48)
+#define V4L2_CID_CAMERA_VGA_BLUR    (V4L2_CID_PRIVATE_BASE + 49)
+#define V4L2_CID_CAMERA_CAPTURE     (V4L2_CID_PRIVATE_BASE + 50)
+
+#define V4L2_CID_MAIN_SW_DATE_INFO_YEAR     (V4L2_CID_PRIVATE_BASE + 54)
+#define V4L2_CID_MAIN_SW_DATE_INFO_MONTH    (V4L2_CID_PRIVATE_BASE + 55)
+#define V4L2_CID_MAIN_SW_DATE_INFO_DATE     (V4L2_CID_PRIVATE_BASE + 56)
+#define V4L2_CID_MAIN_SW_FW_MINOR_VER       (V4L2_CID_PRIVATE_BASE + 57)
+#define V4L2_CID_MAIN_SW_FW_MAJOR_VER       (V4L2_CID_PRIVATE_BASE + 58)
+#define V4L2_CID_MAIN_SW_PRM_MINOR_VER      (V4L2_CID_PRIVATE_BASE + 59)
+#define V4L2_CID_MAIN_SW_PRM_MAJOR_VER      (V4L2_CID_PRIVATE_BASE + 60)
+
+/* SLIM IS control */
+#define V4L2_CID_FIMC_IS_BASE               (V4L2_CTRL_CLASS_CAMERA | 0x1000)
+
+#define V4L2_CID_IS_LOAD_FW                 (V4L2_CID_FIMC_IS_BASE + 10)
+#define V4L2_CID_IS_INIT_PARAM              (V4L2_CID_FIMC_IS_BASE + 11)
+#define V4L2_CID_IS_RESETi                  (V4L2_CID_FIMC_IS_BASE + 12)
+#define V4L2_CID_IS_S_POWER                 (V4L2_CID_FIMC_IS_BASE + 13)
+enum is_set_power {
+    IS_POWER_OFF,
+    IS_POWER_ON
+};
+
+#define V4L2_CID_IS_S_STREAM                (V4L2_CID_FIMC_IS_BASE + 14)
+enum is_set_stream {
+    IS_DISABLE_STREAM,
+    IS_ENABLE_STREAM
+};
+
+#define V4L2_CID_IS_S_SCENARIO_MODE         (V4L2_CID_FIMC_IS_BASE + 15)
+#define V4L2_CID_IS_S_FORMAT_SCENARIO       (V4L2_CID_FIMC_IS_BASE + 16)
+enum scenario_mode {
+    IS_MODE_PREVIEW_STILL,
+    IS_MODE_PREVIEW_VIDEO,
+    IS_MODE_CAPTURE_STILL,
+    IS_MODE_CAPTURE_VIDEO,
+    IS_MODE_MAX
+};
+
+/* global */
+#define V4L2_CID_IS_CAMERA_SHOT_MODE_NORMAL      (V4L2_CID_FIMC_IS_BASE + 101)
+/* value : 1 : single shot , >=2 : continuous shot */
+
+#define V4L2_CID_IS_CAMERA_SENSOR_NUM       (V4L2_CID_FIMC_IS_BASE + 201)
+
+#define V4L2_CID_IS_CAMERA_FOCUS_MODE       (V4L2_CID_FIMC_IS_BASE + 401)
+enum is_focus_mode {
+    IS_FOCUS_MODE_AUTO,
+    IS_FOCUS_MODE_MACRO,
+    IS_FOCUS_MODE_INFINITY,
+    IS_FOCUS_MODE_CONTINUOUS,
+    IS_FOCUS_MODE_TOUCH,
+    IS_FOCUS_MODE_FACEDETECT,
+    IS_FOCUS_MODE_MAX,
+};
+
+#define V4L2_CID_IS_CAMERA_FLASH_MODE        (V4L2_CID_FIMC_IS_BASE + 402)
+enum is_flash_mode {
+    IS_FLASH_MODE_OFF,
+    IS_FLASH_MODE_AUTO,
+    IS_FLASH_MODE_AUTO_REDEYE,
+    IS_FLASH_MODE_ON,
+    IS_FLASH_MODE_TORCH,
+    IS_FLASH_MODE_MAX
+};
+
+#define V4L2_CID_IS_CAMERA_AWB_MODE        (V4L2_CID_FIMC_IS_BASE + 403)
+enum is_awb_mode {
+    IS_AWB_AUTO,
+    IS_AWB_DAYLIGHT,
+    IS_AWB_CLOUDY,
+    IS_AWB_TUNGSTEN,
+    IS_AWB_FLUORESCENT,
+    IS_AWB_MAX
+};
+
+#define V4L2_CID_IS_CAMERA_IMAGE_EFFECT        (V4L2_CID_FIMC_IS_BASE + 404)
+enum is_image_effect {
+    IS_IMAGE_EFFECT_DISABLE,
+    IS_IMAGE_EFFECT_MONOCHROME,
+    IS_IMAGE_EFFECT_NEGATIVE_MONO,
+    IS_IMAGE_EFFECT_NEGATIVE_COLOR,
+    IS_IMAGE_EFFECT_SEPIA,
+    IS_IMAGE_EFFECT_SEPIA_CB,
+    IS_IMAGE_EFFECT_SEPIA_CR,
+    IS_IMAGE_EFFECT_NEGATIVE,
+    IS_IMAGE_EFFECT_ARTFREEZE,
+    IS_IMAGE_EFFECT_EMBOSSING,
+    IS_IMAGE_EFFECT_SILHOUETTE,
+    IS_IMAGE_EFFECT_MAX
+};
+
+#define V4L2_CID_IS_CAMERA_ISO            (V4L2_CID_FIMC_IS_BASE + 405)
+enum is_iso {
+    IS_ISO_AUTO,
+    IS_ISO_50,
+    IS_ISO_100,
+    IS_ISO_200,
+    IS_ISO_400,
+    IS_ISO_800,
+    IS_ISO_1600,
+    IS_ISO_MAX
+};
+
+#define V4L2_CID_IS_CAMERA_CONTRAST        (V4L2_CID_FIMC_IS_BASE + 406)
+enum is_contrast {
+    IS_CONTRAST_AUTO,
+    IS_CONTRAST_MINUS_2,
+    IS_CONTRAST_MINUS_1,
+    IS_CONTRAST_DEFAULT,
+    IS_CONTRAST_PLUS_1,
+    IS_CONTRAST_PLUS_2,
+    IS_CONTRAST_MAX
+};
+
+#define V4L2_CID_IS_CAMERA_SATURATION        (V4L2_CID_FIMC_IS_BASE + 407)
+enum is_saturation {
+    IS_SATURATION_MINUS_2,
+    IS_SATURATION_MINUS_1,
+    IS_SATURATION_DEFAULT,
+    IS_SATURATION_PLUS_1,
+    IS_SATURATION_PLUS_2,
+    IS_SATURATION_MAX
+};
+
+#define V4L2_CID_IS_CAMERA_SHARPNESS        (V4L2_CID_FIMC_IS_BASE + 408)
+enum is_sharpness {
+    IS_SHARPNESS_MINUS_2,
+    IS_SHARPNESS_MINUS_1,
+    IS_SHARPNESS_DEFAULT,
+    IS_SHARPNESS_PLUS_1,
+    IS_SHARPNESS_PLUS_2,
+    IS_SHARPNESS_MAX
+};
+
+#define V4L2_CID_IS_CAMERA_EXPOSURE        (V4L2_CID_FIMC_IS_BASE + 409)
+enum is_exposure {
+    IS_EXPOSURE_MINUS_4,
+    IS_EXPOSURE_MINUS_3,
+    IS_EXPOSURE_MINUS_2,
+    IS_EXPOSURE_MINUS_1,
+    IS_EXPOSURE_DEFAULT,
+    IS_EXPOSURE_PLUS_1,
+    IS_EXPOSURE_PLUS_2,
+    IS_EXPOSURE_PLUS_3,
+    IS_EXPOSURE_PLUS_4,
+    IS_EXPOSURE_MAX
+};
+
+#define V4L2_CID_IS_CAMERA_BRIGHTNESS        (V4L2_CID_FIMC_IS_BASE + 410)
+enum is_brightness {
+    IS_BRIGHTNESS_MINUS_2,
+    IS_BRIGHTNESS_MINUS_1,
+    IS_BRIGHTNESS_DEFAULT,
+    IS_BRIGHTNESS_PLUS_1,
+    IS_BRIGHTNESS_PLUS_2,
+    IS_BRIGHTNESS_MAX
+};
+
+#define V4L2_CID_IS_CAMERA_HUE            (V4L2_CID_FIMC_IS_BASE + 411)
+enum is_hue {
+    IS_HUE_MINUS_2,
+    IS_HUE_MINUS_1,
+    IS_HUE_DEFAULT,
+    IS_HUE_PLUS_1,
+    IS_HUE_PLUS_2,
+    IS_HUE_MAX
+};
+
+#define V4L2_CID_IS_CAMERA_METERING        (V4L2_CID_FIMC_IS_BASE + 412)
+enum is_metering {
+    IS_METERING_CENTER,
+    IS_METERING_SPOT,
+    IS_METERING_MATRIX,
+    IS_METERING_MAX
+};
+#define V4L2_CID_IS_CAMERA_METERING_POSITION_X  (V4L2_CID_FIMC_IS_BASE + 500)
+#define V4L2_CID_IS_CAMERA_METERING_POSITION_Y  (V4L2_CID_FIMC_IS_BASE + 501)
+#define V4L2_CID_IS_CAMERA_METERING_WINDOW_X    (V4L2_CID_FIMC_IS_BASE + 502)
+#define V4L2_CID_IS_CAMERA_METERING_WINDOW_Y    (V4L2_CID_FIMC_IS_BASE + 503)
+
+#define V4L2_CID_IS_CAMERA_AFC_MODE        (V4L2_CID_FIMC_IS_BASE + 413)
+enum is_afc_mode {
+    IS_AFC_DISABLE,
+    IS_AFC_AUTO,
+    IS_AFC_MANUAL_50HZ,
+    IS_AFC_MANUAL_60HZ,
+    IS_AFC_MAX
+};
+
+#define V4L2_CID_IS_FD_GET_FACE_COUNT               (V4L2_CID_FIMC_IS_BASE + 600)
+#define V4L2_CID_IS_FD_GET_FACE_FRAME_NUMBER        (V4L2_CID_FIMC_IS_BASE + 601)
+#define V4L2_CID_IS_FD_GET_FACE_CONFIDENCE          (V4L2_CID_FIMC_IS_BASE + 602)
+#define V4L2_CID_IS_FD_GET_FACE_SMILE_LEVEL         (V4L2_CID_FIMC_IS_BASE + 603)
+#define V4L2_CID_IS_FD_GET_FACE_BLINK_LEVEL         (V4L2_CID_FIMC_IS_BASE + 604)
+#define V4L2_CID_IS_FD_GET_FACE_TOPLEFT_X           (V4L2_CID_FIMC_IS_BASE + 605)
+#define V4L2_CID_IS_FD_GET_FACE_TOPLEFT_Y           (V4L2_CID_FIMC_IS_BASE + 606)
+#define V4L2_CID_IS_FD_GET_FACE_BOTTOMRIGHT_X       (V4L2_CID_FIMC_IS_BASE + 607)
+#define V4L2_CID_IS_FD_GET_FACE_BOTTOMRIGHT_Y       (V4L2_CID_FIMC_IS_BASE + 608)
+#define V4L2_CID_IS_FD_GET_LEFT_EYE_TOPLEFT_X       (V4L2_CID_FIMC_IS_BASE + 609)
+#define V4L2_CID_IS_FD_GET_LEFT_EYE_TOPLEFT_Y       (V4L2_CID_FIMC_IS_BASE + 610)
+#define V4L2_CID_IS_FD_GET_LEFT_EYE_BOTTOMRIGHT_X   (V4L2_CID_FIMC_IS_BASE + 611)
+#define V4L2_CID_IS_FD_GET_LEFT_EYE_BOTTOMRIGHT_Y   (V4L2_CID_FIMC_IS_BASE + 612)
+#define V4L2_CID_IS_FD_GET_RIGHT_EYE_TOPLEFT_X      (V4L2_CID_FIMC_IS_BASE + 613)
+#define V4L2_CID_IS_FD_GET_RIGHT_EYE_TOPLEFT_Y      (V4L2_CID_FIMC_IS_BASE + 614)
+#define V4L2_CID_IS_FD_GET_RIGHT_EYE_BOTTOMRIGHT_X  (V4L2_CID_FIMC_IS_BASE + 615)
+#define V4L2_CID_IS_FD_GET_RIGHT_EYE_BOTTOMRIGHT_Y  (V4L2_CID_FIMC_IS_BASE + 616)
+#define V4L2_CID_IS_FD_GET_MOUTH_TOPLEFT_X          (V4L2_CID_FIMC_IS_BASE + 617)
+#define V4L2_CID_IS_FD_GET_MOUTH_TOPLEFT_Y          (V4L2_CID_FIMC_IS_BASE + 618)
+#define V4L2_CID_IS_FD_GET_MOUTH_BOTTOMRIGHT_X      (V4L2_CID_FIMC_IS_BASE + 619)
+#define V4L2_CID_IS_FD_GET_MOUTH_BOTTOMRIGHT_Y      (V4L2_CID_FIMC_IS_BASE + 620)
+#define V4L2_CID_IS_FD_GET_ANGLE                    (V4L2_CID_FIMC_IS_BASE + 621)
+#define V4L2_CID_IS_FD_GET_NEXT                     (V4L2_CID_FIMC_IS_BASE + 622)
+#define V4L2_CID_IS_FD_GET_DATA                     (V4L2_CID_FIMC_IS_BASE + 623)
+
+#define V4L2_CID_IS_FD_SET_MAX_FACE_NUMBER          (V4L2_CID_FIMC_IS_BASE + 650)
+#define V4L2_CID_IS_FD_SET_ROLL_ANGLE               (V4L2_CID_FIMC_IS_BASE + 651)
+enum is_fd_roll_angle {
+    /* 0, 45, 0, -45 */
+    IS_FD_ROLL_ANGLE_BASIC = 0,
+    /* 0, 30, 0, -30, 0, 45, 0, -45 */
+    IS_FD_ROLL_ANGLE_PRECISE_BASIC = 1,
+    /* 0, 90, 0, -90 */
+    IS_FD_ROLL_ANGLE_SIDES = 2,
+    /* 0, 90, 0, -90 0, 45, 0, -45 */
+    IS_FD_ROLL_ANGLE_PRECISE_SIDES = 3,
+    /* 0, 90, 0, -90, 0, 180 */
+    IS_FD_ROLL_ANGLE_FULL = 4,
+    /* 0, 90, 0, -90, 0, 180, 0, 135, 0, -135 */
+    IS_FD_ROLL_ANGLE_PRECISE_FULL = 5,
+};
+
+#define V4L2_CID_IS_FD_SET_YAW_ANGLE            (V4L2_CID_FIMC_IS_BASE + 652)
+enum is_fd_yaw_angle {
+    IS_FD_YAW_ANGLE_0    = 0,
+    IS_FD_YAW_ANGLE_45    = 1,
+    IS_FD_YAW_ANGLE_90    = 2,
+    IS_FD_YAW_ANGLE_45_90    = 3,
+};
+
+#define V4L2_CID_IS_FD_SET_SMILE_MODE           (V4L2_CID_FIMC_IS_BASE + 653)
+enum is_fd_smile_mode {
+    IS_FD_SMILE_MODE_DISABLE    = 0,
+    IS_FD_SMILE_MODE_ENABLE        = 1,
+};
+
+#define V4L2_CID_IS_FD_SET_BLINK_MODE           (V4L2_CID_FIMC_IS_BASE + 654)
+enum is_fd_blink_mode {
+    IS_FD_BLINK_MODE_DISABLE    = 0,
+    IS_FD_BLINK_MODE_ENABLE        = 1,
+};
+
+#define V4L2_CID_IS_FD_SET_EYE_DETECT_MODE      (V4L2_CID_FIMC_IS_BASE + 655)
+enum is_fd_eye_detect_mode {
+    IS_FD_EYE_DETECT_DISABLE    = 0,
+    IS_FD_EYE_DETECT_ENABLE        = 1,
+};
+
+#define V4L2_CID_IS_FD_SET_MOUTH_DETECT_MODE    (V4L2_CID_FIMC_IS_BASE + 656)
+enum is_fd_mouth_detect_mode {
+    IS_FD_MOUTH_DETECT_DISABLE    = 0,
+    IS_FD_MOUTH_DETECT_ENABLE    = 1,
+};
+
+#define V4L2_CID_IS_FD_SET_ORIENTATION_MODE     (V4L2_CID_FIMC_IS_BASE + 657)
+enum is_fd_orientation_mode {
+    IS_FD_ORIENTATION_DISABLE    = 0,
+    IS_FD_ORIENTATION_ENABLE    = 1,
+};
+
+#define V4L2_CID_IS_FD_SET_ORIENTATION          (V4L2_CID_FIMC_IS_BASE + 658)
+#define V4L2_CID_IS_FD_SET_DATA_ADDRESS         (V4L2_CID_FIMC_IS_BASE + 659)
+
+#define V4L2_CID_IS_SET_ISP            (V4L2_CID_FIMC_IS_BASE + 440)
+enum is_isp_bypass_mode {
+    IS_ISP_BYPASS_DISABLE,
+    IS_ISP_BYPASS_ENABLE,
+    IS_ISP_BYPASS_MAX
+};
+
+#define V4L2_CID_IS_SET_DRC            (V4L2_CID_FIMC_IS_BASE + 441)
+enum is_drc_bypass_mode {
+    IS_DRC_BYPASS_DISABLE,
+    IS_DRC_BYPASS_ENABLE,
+    IS_DRC_BYPASS_MAX
+};
+
+#define V4L2_CID_IS_SET_FD            (V4L2_CID_FIMC_IS_BASE + 442)
+enum is_fd_bypass_mode {
+    IS_FD_BYPASS_DISABLE,
+    IS_FD_BYPASS_ENABLE,
+    IS_FD_BYPASS_MAX
+};
+
+#define V4L2_CID_IS_SET_ODC            (V4L2_CID_FIMC_IS_BASE + 443)
+enum is_odc_bypass_mode {
+    IS_ODC_BYPASS_DISABLE,
+    IS_ODC_BYPASS_ENABLE,
+    IS_ODC_BYPASS_MAX
+};
+
+#define V4L2_CID_IS_SET_DIS            (V4L2_CID_FIMC_IS_BASE + 444)
+enum is_dis_bypass_mode {
+    IS_DIS_BYPASS_DISABLE,
+    IS_DIS_BYPASS_ENABLE,
+    IS_DIS_BYPASS_MAX
+};
+
+#define V4L2_CID_IS_SET_3DNR            (V4L2_CID_FIMC_IS_BASE + 445)
+enum is_tdnr_bypass_mode {
+    IS_TDNR_BYPASS_DISABLE,
+    IS_TDNR_BYPASS_ENABLE,
+    IS_TDNR_BYPASS_MAX
+};
+
+#define V4L2_CID_IS_SET_SCALERC            (V4L2_CID_FIMC_IS_BASE + 446)
+enum is_scalerc_bypass_mode {
+    IS_SCALERC_BYPASS_DISABLE,
+    IS_SCALERC_BYPASS_ENABLE,
+    IS_SCALERC_BYPASS_MAX
+};
+
+#define V4L2_CID_IS_SET_SCALERP            (V4L2_CID_FIMC_IS_BASE + 446)
+enum is_scalerp_bypass_mode {
+    IS_SCALERP_BYPASS_DISABLE,
+    IS_SCALERP_BYPASS_ENABLE,
+    IS_SCALERP_BYPASS_MAX
+};
+
+#define V4L2_CID_IS_ROTATION_MODE        (V4L2_CID_FIMC_IS_BASE + 450)
+enum is_rotation_mode {
+    IS_ROTATION_0,
+    IS_ROTATION_90,
+    IS_ROTATION_180,
+    IS_ROTATION_270,
+    IS_ROTATION_MAX
+};
+
+#define V4L2_CID_IS_3DNR_1ST_FRAME_MODE        (V4L2_CID_FIMC_IS_BASE + 451)
+enum is_tdnr_1st_frame_mode {
+    IS_TDNR_1ST_FRAME_NOPROCESSING,
+    IS_TDNR_1ST_FRAME_2DNR,
+    IS_TDNR_MAX
+};
+
+#define V4L2_CID_IS_CAMERA_OBJECT_POSITION_X    (V4L2_CID_FIMC_IS_BASE + 452)
+#define V4L2_CID_IS_CAMERA_OBJECT_POSITION_Y    (V4L2_CID_FIMC_IS_BASE + 453)
+#define V4L2_CID_IS_CAMERA_WINDOW_SIZE_X        (V4L2_CID_FIMC_IS_BASE + 454)
+#define V4L2_CID_IS_CAMERA_WINDOW_SIZE_Y        (V4L2_CID_FIMC_IS_BASE + 455)
+
+#define V4L2_CID_IS_CAMERA_EXIF_EXPTIME         (V4L2_CID_FIMC_IS_BASE + 456)
+#define V4L2_CID_IS_CAMERA_EXIF_FLASH           (V4L2_CID_FIMC_IS_BASE + 457)
+#define V4L2_CID_IS_CAMERA_EXIF_ISO             (V4L2_CID_FIMC_IS_BASE + 458)
+#define V4L2_CID_IS_CAMERA_EXIF_SHUTTERSPEED    (V4L2_CID_FIMC_IS_BASE + 459)
+#define V4L2_CID_IS_CAMERA_EXIF_BRIGHTNESS      (V4L2_CID_FIMC_IS_BASE + 460)
+
+#define V4L2_CID_IS_CAMERA_ISP_SEL_INPUT        (V4L2_CID_FIMC_IS_BASE + 461)
+enum is_isp_sel_input {
+    IS_ISP_INPUT_OTF,
+    IS_ISP_INPUT_DMA1,
+    IS_ISP_INPUT_DMA2,
+    IS_ISP_INPUT_DMA12,
+    IS_ISP_INPUT_MAX
+};
+
+#define V4L2_CID_IS_CAMERA_ISP_SEL_OUTPUT    (V4L2_CID_FIMC_IS_BASE + 462)
+enum is_isp_sel_output {
+    IS_ISP_OUTPUT_OTF,
+    IS_ISP_OUTPUT_DMA1,
+    IS_ISP_OUTPUT_DMA2,
+    IS_ISP_OUTPUT_DMA12,
+    IS_ISP_OUTPUT_OTF_DMA1,
+    IS_ISP_OUTPUT_OTF_DMA2,
+    IS_ISP_OUTPUT_OTF_DMA12,
+    IS_ISP_OUTPUT_MAX
+};
+
+#define V4L2_CID_IS_CAMERA_DRC_SEL_INPUT    (V4L2_CID_FIMC_IS_BASE + 463)
+enum is_drc_sel_input {
+    IS_DRC_INPUT_OTF,
+    IS_DRC_INPUT_DMA,
+    IS_DRC_INPUT_MAX
+};
+
+#define V4L2_CID_IS_CAMERA_FD_SEL_INPUT        (V4L2_CID_FIMC_IS_BASE + 464)
+enum is_fd_sel_input {
+    IS_FD_INPUT_OTF,
+    IS_FD_INPUT_DMA,
+    IS_FD_INPUT_MAX
+};
+
+#define V4L2_CID_IS_CAMERA_INIT_WIDTH        (V4L2_CID_FIMC_IS_BASE + 465)
+#define V4L2_CID_IS_CAMERA_INIT_HEIGHT       (V4L2_CID_FIMC_IS_BASE + 466)
+
+#define V4L2_CID_IS_CMD_ISP            (V4L2_CID_FIMC_IS_BASE + 467)
+enum is_isp_cmd_mode {
+    IS_ISP_COMMAND_STOP,
+    IS_ISP_COMMAND_START,
+    IS_ISP_COMMAND_MAX
+};
+
+#define V4L2_CID_IS_CMD_DRC            (V4L2_CID_FIMC_IS_BASE + 468)
+enum is_drc_cmd_mode {
+    IS_DRC_COMMAND_STOP,
+    IS_DRC_COMMAND_START,
+    IS_DRC_COMMAND_MAX
+};
+
+#define V4L2_CID_IS_CMD_FD            (V4L2_CID_FIMC_IS_BASE + 469)
+enum is_fd_cmd_mode {
+    IS_FD_COMMAND_STOP,
+    IS_FD_COMMAND_START,
+    IS_FD_COMMAND_MAX
+};
+
+#define V4L2_CID_IS_CMD_ODC            (V4L2_CID_FIMC_IS_BASE + 470)
+enum is_odc_cmd_mode {
+    IS_ODC_COMMAND_STOP,
+    IS_ODC_COMMAND_START,
+    IS_ODC_COMMAND_MAX
+};
+
+#define V4L2_CID_IS_CMD_DIS            (V4L2_CID_FIMC_IS_BASE + 471)
+enum is_dis_cmd_mode {
+    IS_DIS_COMMAND_STOP,
+    IS_DIS_COMMAND_START,
+    IS_DIS_COMMAND_MAX
+};
+
+#define V4L2_CID_IS_CMD_TDNR           (V4L2_CID_FIMC_IS_BASE + 472)
+enum is_tdnr_cmd_mode {
+    IS_TDNR_COMMAND_STOP,
+    IS_TDNR_COMMAND_START,
+    IS_TDNR_COMMAND_MAX
+};
+
+#define V4L2_CID_IS_CMD_SCALERC        (V4L2_CID_FIMC_IS_BASE + 473)
+enum is_scalerc_cmd_mode {
+    IS_SCALERC_COMMAND_STOP,
+    IS_SCALERC_COMMAND_START,
+    IS_SCALERC_COMMAND_MAX
+};
+
+#define V4L2_CID_IS_CMD_SCALERP        (V4L2_CID_FIMC_IS_BASE + 474)
+enum is_scalerp_cmd_mode {
+    IS_SCALERP_COMMAND_STOP,
+    IS_SCALERP_COMMAND_START,
+    IS_SCALERP_COMMAND_MAX
+};
+
+#define V4L2_CID_IS_GET_SENSOR_OFFSET_X        (V4L2_CID_FIMC_IS_BASE + 480)
+#define V4L2_CID_IS_GET_SENSOR_OFFSET_Y        (V4L2_CID_FIMC_IS_BASE + 481)
+#define V4L2_CID_IS_GET_SENSOR_WIDTH           (V4L2_CID_FIMC_IS_BASE + 482)
+#define V4L2_CID_IS_GET_SENSOR_HEIGHT          (V4L2_CID_FIMC_IS_BASE + 483)
+
+#define V4L2_CID_IS_GET_FRAME_VALID            (V4L2_CID_FIMC_IS_BASE + 484)
+#define V4L2_CID_IS_SET_FRAME_VALID            (V4L2_CID_FIMC_IS_BASE + 485)
+#define V4L2_CID_IS_GET_FRAME_BADMARK          (V4L2_CID_FIMC_IS_BASE + 486)
+#define V4L2_CID_IS_SET_FRAME_BADMARK          (V4L2_CID_FIMC_IS_BASE + 487)
+#define V4L2_CID_IS_GET_FRAME_CAPTURED         (V4L2_CID_FIMC_IS_BASE + 488)
+#define V4L2_CID_IS_SET_FRAME_CAPTURED         (V4L2_CID_FIMC_IS_BASE + 489)
+#define V4L2_CID_IS_SET_FRAME_NUMBER           (V4L2_CID_FIMC_IS_BASE + 490)
+#define V4L2_CID_IS_GET_FRAME_NUMBER           (V4L2_CID_FIMC_IS_BASE + 491)
+#define V4L2_CID_IS_CLEAR_FRAME_NUMBER         (V4L2_CID_FIMC_IS_BASE + 492)
+#define V4L2_CID_IS_GET_LOSTED_FRAME_NUMBER    (V4L2_CID_FIMC_IS_BASE + 493)
+#define V4L2_CID_IS_ISP_DMA_BUFFER_NUM         (V4L2_CID_FIMC_IS_BASE + 494)
+#define V4L2_CID_IS_ISP_DMA_BUFFER_ADDRESS     (V4L2_CID_FIMC_IS_BASE + 495)
+
+#define V4L2_CID_IS_ZOOM_STATE                 (V4L2_CID_FIMC_IS_BASE + 660)
+#define V4L2_CID_IS_ZOOM_MAX_LEVEL             (V4L2_CID_FIMC_IS_BASE + 661)
+#define V4L2_CID_IS_ZOOM                       (V4L2_CID_FIMC_IS_BASE + 662)
+#define V4L2_CID_IS_FW_DEBUG_REGION_ADDR       (V4L2_CID_FIMC_IS_BASE + 663)
+
+enum v4l2_blur {
+    BLUR_LEVEL_0 = 0,
+    BLUR_LEVEL_1,
+    BLUR_LEVEL_2,
+    BLUR_LEVEL_3,
+    BLUR_LEVEL_MAX,
+};
+
+#if 1
+#define V4L2_CID_CAMERA_SCENE_MODE      (V4L2_CID_PRIVATE_BASE+70)
+enum v4l2_scene_mode {
+    SCENE_MODE_BASE,
+    SCENE_MODE_NONE,
+    SCENE_MODE_PORTRAIT,
+    SCENE_MODE_NIGHTSHOT,
+    SCENE_MODE_BACK_LIGHT,
+    SCENE_MODE_LANDSCAPE,
+    SCENE_MODE_SPORTS,
+    SCENE_MODE_PARTY_INDOOR,
+    SCENE_MODE_BEACH_SNOW,
+    SCENE_MODE_SUNSET,
+    SCENE_MODE_DUST_DAWN,
+    SCENE_MODE_FALL_COLOR,
+    SCENE_MODE_FIREWORKS,
+    SCENE_MODE_TEXT,
+    SCENE_MODE_CANDLE_LIGHT,
+    SCENE_MODE_MAX,
+};
+
+#define V4L2_CID_CAMERA_FLASH_MODE      (V4L2_CID_PRIVATE_BASE+71)
+enum v4l2_flash_mode {
+    FLASH_MODE_BASE,
+    FLASH_MODE_OFF,
+    FLASH_MODE_AUTO,
+    FLASH_MODE_ON,
+    FLASH_MODE_TORCH,
+    FLASH_MODE_MAX,
+};
+
+#define V4L2_CID_CAMERA_BRIGHTNESS      (V4L2_CID_PRIVATE_BASE+72)
+enum v4l2_ev_mode {
+    EV_MINUS_4  = -4,
+    EV_MINUS_3  = -3,
+    EV_MINUS_2  = -2,
+    EV_MINUS_1  = -1,
+    EV_DEFAULT  = 0,
+    EV_PLUS_1   = 1,
+    EV_PLUS_2   = 2,
+    EV_PLUS_3   = 3,
+    EV_PLUS_4   = 4,
+    EV_MAX,
+};
+
+#define V4L2_CID_CAMERA_WHITE_BALANCE   (V4L2_CID_PRIVATE_BASE+73)
+enum v4l2_wb_mode {
+    WHITE_BALANCE_BASE = 0,
+    WHITE_BALANCE_AUTO,
+    WHITE_BALANCE_SUNNY,
+    WHITE_BALANCE_CLOUDY,
+    WHITE_BALANCE_TUNGSTEN,
+    WHITE_BALANCE_FLUORESCENT,
+    WHITE_BALANCE_MAX,
+};
+
+#define V4L2_CID_CAMERA_EFFECT          (V4L2_CID_PRIVATE_BASE+74)
+enum v4l2_effect_mode {
+    IMAGE_EFFECT_BASE = 0,
+    IMAGE_EFFECT_NONE,
+    IMAGE_EFFECT_BNW,
+    IMAGE_EFFECT_SEPIA,
+    IMAGE_EFFECT_AQUA,
+    IMAGE_EFFECT_ANTIQUE,
+    IMAGE_EFFECT_NEGATIVE,
+    IMAGE_EFFECT_SHARPEN,
+    IMAGE_EFFECT_MAX,
+};
+
+#define V4L2_CID_CAMERA_ISO             (V4L2_CID_PRIVATE_BASE+75)
+enum v4l2_iso_mode {
+    ISO_AUTO = 0,
+    ISO_50,
+    ISO_100,
+    ISO_200,
+    ISO_400,
+    ISO_800,
+    ISO_1600,
+    ISO_SPORTS,
+    ISO_NIGHT,
+    ISO_MOVIE,
+    ISO_MAX,
+};
+
+#define V4L2_CID_CAMERA_METERING            (V4L2_CID_PRIVATE_BASE+76)
+enum v4l2_metering_mode {
+    METERING_BASE = 0,
+    METERING_MATRIX,
+    METERING_CENTER,
+    METERING_SPOT,
+    METERING_MAX,
+};
+
+#define V4L2_CID_CAMERA_CONTRAST            (V4L2_CID_PRIVATE_BASE+77)
+enum v4l2_contrast_mode {
+    CONTRAST_MINUS_2 = 0,
+    CONTRAST_MINUS_1,
+    CONTRAST_DEFAULT,
+    CONTRAST_PLUS_1,
+    CONTRAST_PLUS_2,
+    CONTRAST_MAX,
+};
+
+#define V4L2_CID_CAMERA_SATURATION      (V4L2_CID_PRIVATE_BASE+78)
+enum v4l2_saturation_mode {
+    SATURATION_MINUS_2 = 0,
+    SATURATION_MINUS_1,
+    SATURATION_DEFAULT,
+    SATURATION_PLUS_1,
+    SATURATION_PLUS_2,
+    SATURATION_MAX,
+};
+
+#define V4L2_CID_CAMERA_SHARPNESS       (V4L2_CID_PRIVATE_BASE+79)
+enum v4l2_sharpness_mode {
+    SHARPNESS_MINUS_2 = 0,
+    SHARPNESS_MINUS_1,
+    SHARPNESS_DEFAULT,
+    SHARPNESS_PLUS_1,
+    SHARPNESS_PLUS_2,
+    SHARPNESS_MAX,
+};
+
+#define V4L2_CID_CAMERA_WDR             (V4L2_CID_PRIVATE_BASE+80)
+enum v4l2_wdr_mode {
+    WDR_OFF,
+    WDR_ON,
+    WDR_MAX,
+};
+
+#define V4L2_CID_CAMERA_ANTI_SHAKE      (V4L2_CID_PRIVATE_BASE+81)
+enum v4l2_anti_shake_mode {
+    ANTI_SHAKE_OFF,
+    ANTI_SHAKE_STILL_ON,
+    ANTI_SHAKE_MOVIE_ON,
+    ANTI_SHAKE_MAX,
+};
+
+#define V4L2_CID_CAMERA_TOUCH_AF_START_STOP     (V4L2_CID_PRIVATE_BASE+82)
+enum v4l2_touch_af {
+    TOUCH_AF_STOP = 0,
+    TOUCH_AF_START,
+    TOUCH_AF_MAX,
+};
+
+#define V4L2_CID_CAMERA_SMART_AUTO      (V4L2_CID_PRIVATE_BASE+83)
+enum v4l2_smart_auto {
+    SMART_AUTO_OFF = 0,
+    SMART_AUTO_ON,
+    SMART_AUTO_MAX,
+};
+
+#define V4L2_CID_CAMERA_VINTAGE_MODE        (V4L2_CID_PRIVATE_BASE+84)
+enum v4l2_vintage_mode {
+    VINTAGE_MODE_BASE,
+    VINTAGE_MODE_OFF,
+    VINTAGE_MODE_NORMAL,
+    VINTAGE_MODE_WARM,
+    VINTAGE_MODE_COOL,
+    VINTAGE_MODE_BNW,
+    VINTAGE_MODE_MAX,
+};
+
+#define V4L2_CID_CAMERA_JPEG_QUALITY        (V4L2_CID_PRIVATE_BASE+85)
+#define V4L2_CID_CAMERA_GPS_LATITUDE        (V4L2_CID_CAMERA_CLASS_BASE + 30)//(V4L2_CID_PRIVATE_BASE+86)
+#define V4L2_CID_CAMERA_GPS_LONGITUDE   (V4L2_CID_CAMERA_CLASS_BASE + 31)//(V4L2_CID_PRIVATE_BASE+87)
+#define V4L2_CID_CAMERA_GPS_TIMESTAMP   (V4L2_CID_CAMERA_CLASS_BASE + 32)//(V4L2_CID_PRIVATE_BASE+88)
+#define V4L2_CID_CAMERA_GPS_ALTITUDE        (V4L2_CID_CAMERA_CLASS_BASE + 33)//(V4L2_CID_PRIVATE_BASE+89)
+#define V4L2_CID_CAMERA_EXIF_TIME_INFO  (V4L2_CID_CAMERA_CLASS_BASE + 34)
+#define V4L2_CID_CAMERA_GPS_PROCESSINGMETHOD                     (V4L2_CID_CAMERA_CLASS_BASE+35)
+#define V4L2_CID_CAMERA_ZOOM                (V4L2_CID_PRIVATE_BASE+90)
+enum v4l2_zoom_level {
+    ZOOM_LEVEL_0 = 0,
+    ZOOM_LEVEL_1,
+    ZOOM_LEVEL_2,
+    ZOOM_LEVEL_3,
+    ZOOM_LEVEL_4,
+    ZOOM_LEVEL_5,
+    ZOOM_LEVEL_6,
+    ZOOM_LEVEL_7,
+    ZOOM_LEVEL_8,
+    ZOOM_LEVEL_9,
+    ZOOM_LEVEL_10,
+    ZOOM_LEVEL_11,
+    ZOOM_LEVEL_12,
+    ZOOM_LEVEL_MAX = 31,
+};
+
+#define V4L2_CID_CAMERA_FACE_DETECTION      (V4L2_CID_PRIVATE_BASE+91)
+enum v4l2_face_detection {
+    FACE_DETECTION_OFF = 0,
+    FACE_DETECTION_ON,
+    FACE_DETECTION_NOLINE,
+    FACE_DETECTION_ON_BEAUTY,
+    FACE_DETECTION_MAX,
+};
+
+#define V4L2_CID_CAMERA_SMART_AUTO_STATUS       (V4L2_CID_PRIVATE_BASE+92)
+enum v4l2_smart_auto_status {
+    SMART_AUTO_STATUS_AUTO = 0,
+    SMART_AUTO_STATUS_LANDSCAPE,
+    SMART_AUTO_STATUS_PORTRAIT,
+    SMART_AUTO_STATUS_MACRO,
+    SMART_AUTO_STATUS_NIGHT,
+    SMART_AUTO_STATUS_PORTRAIT_NIGHT,
+    SMART_AUTO_STATUS_BACKLIT,
+    SMART_AUTO_STATUS_PORTRAIT_BACKLIT,
+    SMART_AUTO_STATUS_ANTISHAKE,
+    SMART_AUTO_STATUS_PORTRAIT_ANTISHAKE,
+    SMART_AUTO_STATUS_MAX,
+};
+
+#define V4L2_CID_CAMERA_SET_AUTO_FOCUS      (V4L2_CID_PRIVATE_BASE+93)
+enum v4l2_auto_focus {
+    AUTO_FOCUS_OFF = 0,
+    AUTO_FOCUS_ON,
+    AUTO_FOCUS_MAX,
+};
+
+#define V4L2_CID_CAMERA_BEAUTY_SHOT     (V4L2_CID_PRIVATE_BASE+94)
+enum v4l2_beauty_shot {
+    BEAUTY_SHOT_OFF = 0,
+    BEAUTY_SHOT_ON,
+    BEAUTY_SHOT_MAX,
+};
+
+#define V4L2_CID_CAMERA_AEAWB_LOCK_UNLOCK       (V4L2_CID_PRIVATE_BASE+95)
+enum v4l2_ae_awb_lockunlock {
+    AE_UNLOCK_AWB_UNLOCK = 0,
+    AE_LOCK_AWB_UNLOCK,
+    AE_UNLOCK_AWB_LOCK,
+    AE_LOCK_AWB_LOCK,
+    AE_AWB_MAX
+};
+
+#define V4L2_CID_CAMERA_FACEDETECT_LOCKUNLOCK   (V4L2_CID_PRIVATE_BASE+96)
+enum v4l2_face_lock {
+    FACE_LOCK_OFF = 0,
+    FACE_LOCK_ON,
+    FIRST_FACE_TRACKING,
+    FACE_LOCK_MAX,
+};
+
+#define V4L2_CID_CAMERA_OBJECT_POSITION_X   (V4L2_CID_PRIVATE_BASE+97)
+#define V4L2_CID_CAMERA_OBJECT_POSITION_Y   (V4L2_CID_PRIVATE_BASE+98)
+#define V4L2_CID_CAMERA_FOCUS_MODE      (V4L2_CID_PRIVATE_BASE+99)
+enum v4l2_focusmode {
+    FOCUS_MODE_AUTO = 0,
+    FOCUS_MODE_MACRO,
+    FOCUS_MODE_FACEDETECT,
+    FOCUS_MODE_INFINITY,
+    FOCUS_MODE_CONTINOUS,
+    FOCUS_MODE_TOUCH,
+    FOCUS_MODE_MAX,
+    FOCUS_MODE_DEFAULT = (1 << 8),
+};
+
+#define V4L2_CID_CAMERA_OBJ_TRACKING_STATUS (V4L2_CID_PRIVATE_BASE+100)
+enum v4l2_obj_tracking_status {
+    OBJECT_TRACKING_STATUS_BASE,
+    OBJECT_TRACKING_STATUS_PROGRESSING,
+    OBJECT_TRACKING_STATUS_SUCCESS,
+    OBJECT_TRACKING_STATUS_FAIL,
+    OBJECT_TRACKING_STATUS_MISSING,
+    OBJECT_TRACKING_STATUS_MAX,
+};
+
+#define V4L2_CID_CAMERA_OBJ_TRACKING_START_STOP (V4L2_CID_PRIVATE_BASE+101)
+enum v4l2_ot_start_stop {
+    OT_STOP = 0,
+    OT_START,
+    OT_MAX,
+};
+
+#define V4L2_CID_CAMERA_CAF_START_STOP  (V4L2_CID_PRIVATE_BASE+102)
+enum v4l2_caf_start_stop {
+    CAF_STOP = 0,
+    CAF_START,
+    CAF_MAX,
+};
+
+#define V4L2_CID_CAMERA_AUTO_FOCUS_RESULT           (V4L2_CID_PRIVATE_BASE+103)
+#define V4L2_CID_CAMERA_FRAME_RATE          (V4L2_CID_PRIVATE_BASE+104)
+enum v4l2_frame_rate {
+    FRAME_RATE_AUTO = 0,
+    FRAME_RATE_7 = 7,
+    FRAME_RATE_15 = 15,
+    FRAME_RATE_30 = 30,
+    FRAME_RATE_60 = 60,
+    FRAME_RATE_120 = 120,
+    FRAME_RATE_MAX
+};
+
+#define V4L2_CID_CAMERA_ANTI_BANDING                    (V4L2_CID_PRIVATE_BASE+105)
+enum v4l2_anti_banding {
+    ANTI_BANDING_AUTO = 0,
+    ANTI_BANDING_50HZ = 1,
+    ANTI_BANDING_60HZ = 2,
+    ANTI_BANDING_OFF = 3,
+};
+
+#define V4L2_CID_CAMERA_SET_GAMMA   (V4L2_CID_PRIVATE_BASE+106)
+enum v4l2_gamma_mode {
+    GAMMA_OFF = 0,
+    GAMMA_ON = 1,
+    GAMMA_MAX,
+};
+
+#define V4L2_CID_CAMERA_SET_SLOW_AE (V4L2_CID_PRIVATE_BASE+107)
+enum v4l2_slow_ae_mode {
+    SLOW_AE_OFF,
+    SLOW_AE_ON,
+    SLOW_AE_MAX,
+};
+
+#define V4L2_CID_CAMERA_BATCH_REFLECTION                    (V4L2_CID_PRIVATE_BASE+108)
+#define V4L2_CID_CAMERA_EXIF_ORIENTATION                    (V4L2_CID_PRIVATE_BASE+109)
+
+#define V4L2_CID_CAMERA_RESET                               (V4L2_CID_PRIVATE_BASE+111) //s1_camera [ Defense process by ESD input ]
+#define V4L2_CID_CAMERA_CHECK_DATALINE                      (V4L2_CID_PRIVATE_BASE+112)
+#define V4L2_CID_CAMERA_CHECK_DATALINE_STOP                 (V4L2_CID_PRIVATE_BASE+113)
+
+#endif
+
+#if defined(CONFIG_ARIES_NTT) // Modify NTTS1
+#define V4L2_CID_CAMERA_AE_AWB_DISABLE_LOCK                 (V4L2_CID_PRIVATE_BASE+114)
+#endif
+#define V4L2_CID_CAMERA_THUMBNAIL_NULL                                  (V4L2_CID_PRIVATE_BASE+115)
+#define V4L2_CID_CAMERA_SENSOR_MODE                 (V4L2_CID_PRIVATE_BASE+116)
+
+#define V4L2_CID_CAMERA_EXIF_EXPTIME                (V4L2_CID_PRIVATE_BASE+117)
+#define V4L2_CID_CAMERA_EXIF_FLASH                  (V4L2_CID_PRIVATE_BASE+118)
+#define V4L2_CID_CAMERA_EXIF_ISO                    (V4L2_CID_PRIVATE_BASE+119)
+#define V4L2_CID_CAMERA_EXIF_TV                     (V4L2_CID_PRIVATE_BASE+120)
+#define V4L2_CID_CAMERA_EXIF_BV                     (V4L2_CID_PRIVATE_BASE+121)
+#define V4L2_CID_CAMERA_EXIF_EBV                    (V4L2_CID_PRIVATE_BASE+122)
+
+#define V4L2_CID_CAMERA_BUSFREQ_LOCK                (V4L2_CID_PRIVATE_BASE+125)
+#define V4L2_CID_CAMERA_BUSFREQ_UNLOCK              (V4L2_CID_PRIVATE_BASE+126)
+
+/*      Pixel format FOURCC depth  Description  */
+/* 12  Y/CbCr 4:2:0 64x32 macroblocks */
+#define V4L2_PIX_FMT_NV12T    v4l2_fourcc('T', 'V', '1', '2')
+
+/*
+ *  * V4L2 extention for digital camera
+ *   */
+/* Strobe flash light */
+enum v4l2_strobe_control {
+    /* turn off the flash light */
+    V4L2_STROBE_CONTROL_OFF     = 0,
+    /* turn on the flash light */
+    V4L2_STROBE_CONTROL_ON      = 1,
+    /* act guide light before splash */
+    V4L2_STROBE_CONTROL_AFGUIDE = 2,
+    /* charge the flash light */
+    V4L2_STROBE_CONTROL_CHARGE  = 3,
+};
+
+enum v4l2_strobe_conf {
+    V4L2_STROBE_OFF         = 0,    /* Always off */
+    V4L2_STROBE_ON          = 1,    /* Always splashes */
+    /* Auto control presets */
+    V4L2_STROBE_AUTO        = 2,
+    V4L2_STROBE_REDEYE_REDUCTION    = 3,
+    V4L2_STROBE_SLOW_SYNC       = 4,
+    V4L2_STROBE_FRONT_CURTAIN   = 5,
+    V4L2_STROBE_REAR_CURTAIN    = 6,
+    /* Extra manual control presets */
+    /* keep turned on until turning off */
+    V4L2_STROBE_PERMANENT       = 7,
+    V4L2_STROBE_EXTERNAL        = 8,
+};
+
+enum v4l2_strobe_status {
+    V4L2_STROBE_STATUS_OFF      = 0,
+    /* while processing configurations */
+    V4L2_STROBE_STATUS_BUSY     = 1,
+    V4L2_STROBE_STATUS_ERR      = 2,
+    V4L2_STROBE_STATUS_CHARGING = 3,
+    V4L2_STROBE_STATUS_CHARGED  = 4,
+};
+
+/* capabilities field */
+/* No strobe supported */
+#define V4L2_STROBE_CAP_NONE        0x0000
+/* Always flash off mode */
+#define V4L2_STROBE_CAP_OFF     0x0001
+/* Always use flash light mode */
+#define V4L2_STROBE_CAP_ON      0x0002
+/* Flashlight works automatic */
+#define V4L2_STROBE_CAP_AUTO        0x0004
+/* Red-eye reduction */
+#define V4L2_STROBE_CAP_REDEYE      0x0008
+/* Slow sync */
+#define V4L2_STROBE_CAP_SLOWSYNC    0x0010
+/* Front curtain */
+#define V4L2_STROBE_CAP_FRONT_CURTAIN   0x0020
+/* Rear curtain */
+#define V4L2_STROBE_CAP_REAR_CURTAIN    0x0040
+/* keep turned on until turning off */
+#define V4L2_STROBE_CAP_PERMANENT   0x0080
+/* use external strobe */
+#define V4L2_STROBE_CAP_EXTERNAL    0x0100
+
+/* Set mode and Get status */
+struct v4l2_strobe {
+    /* off/on/charge:0/1/2 */
+    enum    v4l2_strobe_control control;
+    /* supported strobe capabilities */
+    __u32   capabilities;
+    enum    v4l2_strobe_conf mode;
+    enum    v4l2_strobe_status status;  /* read only */
+    /* default is 0 and range of value varies from each models */
+    __u32   flash_ev;
+    __u32   reserved[4];
+};
+
+#define VIDIOC_S_STROBE     _IOWR('V', 83, struct v4l2_strobe)
+#define VIDIOC_G_STROBE     _IOR('V', 84, struct v4l2_strobe)
+
+/* Object recognition and collateral actions */
+enum v4l2_recog_mode {
+    V4L2_RECOGNITION_MODE_OFF   = 0,
+    V4L2_RECOGNITION_MODE_ON    = 1,
+    V4L2_RECOGNITION_MODE_LOCK  = 2,
+};
+
+enum v4l2_recog_action {
+    V4L2_RECOGNITION_ACTION_NONE    = 0,    /* only recognition */
+    V4L2_RECOGNITION_ACTION_BLINK   = 1,    /* Capture on blinking */
+    V4L2_RECOGNITION_ACTION_SMILE   = 2,    /* Capture on smiling */
+};
+
+enum v4l2_recog_pattern {
+    V4L2_RECOG_PATTERN_FACE     = 0, /* Face */
+    V4L2_RECOG_PATTERN_HUMAN    = 1, /* Human */
+    V4L2_RECOG_PATTERN_CHAR     = 2, /* Character */
+};
+
+struct v4l2_recog_rect {
+    enum    v4l2_recog_pattern  p;  /* detected pattern */
+    struct  v4l2_rect  o;   /* detected area */
+    __u32   reserved[4];
+};
+
+struct v4l2_recog_data {
+    __u8    detect_cnt;     /* detected object counter */
+    struct  v4l2_rect   o;  /* detected area */
+    __u32   reserved[4];
+};
+
+struct v4l2_recognition {
+    enum v4l2_recog_mode    mode;
+
+    /* Which pattern to detect */
+    enum v4l2_recog_pattern  pattern;
+
+    /* How many object to detect */
+    __u8    obj_num;
+
+    /* select detected object */
+    __u32   detect_idx;
+
+    /* read only :Get object coordination */
+    struct v4l2_recog_data  data;
+
+    enum v4l2_recog_action  action;
+    __u32   reserved[4];
+};
+
+#define VIDIOC_S_RECOGNITION    _IOWR('V', 85, struct v4l2_recognition)
+#define VIDIOC_G_RECOGNITION    _IOR('V', 86, struct v4l2_recognition)
+
+/* We use this struct as the v4l2_streamparm raw_data for
+ * VIDIOC_G_PARM and VIDIOC_S_PARM
+ */
+struct sec_cam_parm {
+    struct v4l2_captureparm capture;
+    int contrast;
+    int effects;
+    int brightness;
+    int exposure;
+    int flash_mode;
+    int focus_mode;
+    int aeawb_mode;
+    int iso;
+    int metering;
+    int saturation;
+    int scene_mode;
+    int sharpness;
+    int hue;
+    int white_balance;
+    int anti_banding;
+};
+
+#endif /* __LINUX_VIDEODEV2_SAMSUNG_H */