Path: blob/master/drivers/media/video/davinci/ccdc_hw_device.h
17653 views
/*1* Copyright (C) 2008-2009 Texas Instruments Inc2*3* This program is free software; you can redistribute it and/or modify4* it under the terms of the GNU General Public License as published by5* the Free Software Foundation; either version 2 of the License, or6* (at your option) any later version.7*8* This program is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11* GNU General Public License for more details.12*13* You should have received a copy of the GNU General Public License14* along with this program; if not, write to the Free Software15* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA16*17* ccdc device API18*/19#ifndef _CCDC_HW_DEVICE_H20#define _CCDC_HW_DEVICE_H2122#ifdef __KERNEL__23#include <linux/videodev2.h>24#include <linux/device.h>25#include <media/davinci/vpfe_types.h>26#include <media/davinci/ccdc_types.h>2728/*29* ccdc hw operations30*/31struct ccdc_hw_ops {32/* Pointer to initialize function to initialize ccdc device */33int (*open) (struct device *dev);34/* Pointer to deinitialize function */35int (*close) (struct device *dev);36/* set ccdc base address */37void (*set_ccdc_base)(void *base, int size);38/* Pointer to function to enable or disable ccdc */39void (*enable) (int en);40/* reset sbl. only for 6446 */41void (*reset) (void);42/* enable output to sdram */43void (*enable_out_to_sdram) (int en);44/* Pointer to function to set hw parameters */45int (*set_hw_if_params) (struct vpfe_hw_if_param *param);46/* get interface parameters */47int (*get_hw_if_params) (struct vpfe_hw_if_param *param);48/*49* Pointer to function to set parameters. Used50* for implementing VPFE_S_CCDC_PARAMS51*/52int (*set_params) (void *params);53/*54* Pointer to function to get parameter. Used55* for implementing VPFE_G_CCDC_PARAMS56*/57int (*get_params) (void *params);58/* Pointer to function to configure ccdc */59int (*configure) (void);6061/* Pointer to function to set buffer type */62int (*set_buftype) (enum ccdc_buftype buf_type);63/* Pointer to function to get buffer type */64enum ccdc_buftype (*get_buftype) (void);65/* Pointer to function to set frame format */66int (*set_frame_format) (enum ccdc_frmfmt frm_fmt);67/* Pointer to function to get frame format */68enum ccdc_frmfmt (*get_frame_format) (void);69/* enumerate hw pix formats */70int (*enum_pix)(u32 *hw_pix, int i);71/* Pointer to function to set buffer type */72u32 (*get_pixel_format) (void);73/* Pointer to function to get pixel format. */74int (*set_pixel_format) (u32 pixfmt);75/* Pointer to function to set image window */76int (*set_image_window) (struct v4l2_rect *win);77/* Pointer to function to set image window */78void (*get_image_window) (struct v4l2_rect *win);79/* Pointer to function to get line length */80unsigned int (*get_line_length) (void);8182/* Query CCDC control IDs */83int (*queryctrl)(struct v4l2_queryctrl *qctrl);84/* Set CCDC control */85int (*set_control)(struct v4l2_control *ctrl);86/* Get CCDC control */87int (*get_control)(struct v4l2_control *ctrl);8889/* Pointer to function to set frame buffer address */90void (*setfbaddr) (unsigned long addr);91/* Pointer to function to get field id */92int (*getfid) (void);93};9495struct ccdc_hw_device {96/* ccdc device name */97char name[32];98/* module owner */99struct module *owner;100/* hw ops */101struct ccdc_hw_ops hw_ops;102};103104/* Used by CCDC module to register & unregister with vpfe capture driver */105int vpfe_register_ccdc_device(struct ccdc_hw_device *dev);106void vpfe_unregister_ccdc_device(struct ccdc_hw_device *dev);107108#endif109#endif110111112