/*
 * 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__ */
