linux/drivers/staging/media/davinci_vpfe/dm365_ipipeif_user.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0 */
   2/*
   3 * Copyright (C) 2012 Texas Instruments Inc
   4 *
   5 * This program is free software; you can redistribute it and/or
   6 * modify it under the terms of the GNU General Public License as
   7 * published by the Free Software Foundation version 2.
   8 *
   9 * This program is distributed in the hope that it will be useful,
  10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12 * GNU General Public License for more details.
  13 *
  14 * Contributors:
  15 *      Manjunath Hadli <manjunath.hadli@ti.com>
  16 *      Prabhakar Lad <prabhakar.lad@ti.com>
  17 */
  18
  19#ifndef _DAVINCI_VPFE_DM365_IPIPEIF_USER_H
  20#define _DAVINCI_VPFE_DM365_IPIPEIF_USER_H
  21
  22/* clockdiv for IPIPE 5.1 */
  23struct ipipeif_5_1_clkdiv {
  24        unsigned char m;
  25        unsigned char n;
  26};
  27
  28enum ipipeif_decimation {
  29        IPIPEIF_DECIMATION_OFF,
  30        IPIPEIF_DECIMATION_ON
  31};
  32
  33/* DPC at the if for IPIPE 5.1 */
  34struct ipipeif_dpc {
  35        /* 0 - disable, 1 - enable */
  36        unsigned char en;
  37        /* threshold */
  38        unsigned short thr;
  39};
  40
  41enum ipipeif_clock {
  42        IPIPEIF_PIXCEL_CLK,
  43        IPIPEIF_SDRAM_CLK
  44};
  45
  46enum  ipipeif_avg_filter {
  47        IPIPEIF_AVG_OFF,
  48        IPIPEIF_AVG_ON
  49};
  50
  51struct ipipeif_5_1 {
  52        struct ipipeif_5_1_clkdiv clk_div;
  53        /* Defect pixel correction */
  54        struct ipipeif_dpc dpc;
  55        /* clipped to this value */
  56        unsigned short clip;
  57        /* Align HSync and VSync to rsz_start */
  58        unsigned char align_sync;
  59        /* resizer start position */
  60        unsigned int rsz_start;
  61        /* DF gain enable */
  62        unsigned char df_gain_en;
  63        /* DF gain value */
  64        unsigned short df_gain;
  65        /* DF gain threshold value */
  66        unsigned short df_gain_thr;
  67};
  68
  69struct ipipeif_params {
  70        enum ipipeif_clock clock_select;
  71        unsigned int ppln;
  72        unsigned int lpfr;
  73        unsigned char rsz;
  74        enum ipipeif_decimation decimation;
  75        enum ipipeif_avg_filter avg_filter;
  76        /* IPIPE 5.1 */
  77        struct ipipeif_5_1 if_5_1;
  78};
  79
  80/*
  81 * Private IOCTL
  82 * VIDIOC_VPFE_IPIPEIF_S_CONFIG: Set IPIEIF configuration
  83 * VIDIOC_VPFE_IPIPEIF_G_CONFIG: Get IPIEIF configuration
  84 */
  85#define VIDIOC_VPFE_IPIPEIF_S_CONFIG \
  86        _IOWR('I', BASE_VIDIOC_PRIVATE + 1, struct ipipeif_params)
  87#define VIDIOC_VPFE_IPIPEIF_G_CONFIG \
  88        _IOWR('I', BASE_VIDIOC_PRIVATE + 2, struct ipipeif_params)
  89
  90#endif          /* _DAVINCI_VPFE_DM365_IPIPEIF_USER_H */
  91