Quellcode-Bibliothek saa7127.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * saa7127 - Philips SAA7127/SAA7129 video encoder driver
 *
 * Copyright (C) 2003 Roy Bulter <rbulter@hetnet.nl>
 *
 * Based on SAA7126 video encoder driver by Gillem & Andreas Oberritter
 *
 * Copyright (C) 2000-2001 Gillem <htoa@gmx.net>
 * Copyright (C) 2002 Andreas Oberritter <obi@saftware.de>
 *
 * Based on Stadis 4:2:2 MPEG-2 Decoder Driver by Nathan Laredo
 *
 * Copyright (C) 1999 Nathan Laredo <laredo@gnu.org>
 *
 * This driver is designed for the Hauppauge 250/350 Linux driver
 * from the ivtv Project
 *
 * Copyright (C) 2003 Kevin Thayer <nufan_wfk@yahoo.com>
 *
 * Dual output support:
 * Copyright (C) 2004 Eric Varsanyi
 *
 * NTSC Tuning and 7.5 IRE Setup
 * Copyright (C) 2004  Chris Kennedy <c@groovy.org>
 *
 * VBI additions & cleanup:
 * Copyright (C) 2004, 2005 Hans Verkuil <hverkuil@xs4all.nl>
 *
 * Note: the saa7126 is identical to the saa7127, and the saa7128 is
 * identical to the saa7129, except that the saa7126 and saa7128 have
 * macrovision anti-taping support. This driver will almost certainly
 * work fine for those chips, except of course for the missing anti-taping
 * support.
 */



#include <linux#include<linux/.h>
includemodule
#include <linux linux.>
# </.
/.h
#include  ebug;
#include <media/i2c/saa7127.h>

static 
MODULEDESCRIPTION" /9 video encoder driver")java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61

MODULE_DESCRIPTION(               
(Kevin java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
MODULE_LICENSE                     
0
module_param(test_imagejava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
(,0;
MODULE_PARM_DESC0


/*
 * SAA7127 registers
 */


#define SAA7127_REG_STATUS                           0x00
#define SAA7127_REG_WIDESCREEN_CONFIG                0x26
#define SAA7127_REG_WIDESCREEN_ENABLE                0x27
#define SAA7127_REG_BURST_START                      0x28
#define SAA7127_REG_BURST_END                        0x29
define0java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
                        
#define                   java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
#define SAA7127_REG_OUTPUT_PORT_CONTROL              0x2d
#efine                x38
#define SAA7127_REG_GAIN_COLORDIFF_RGB               0x39
#defineSAA7127_REG_INPUT_PORT_CONTROL_10
#define SAA7129_REG_FADE_KEY_COL2 0java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
#define #                  x71
define                            
#define SAA7127_REG_GAINV                            0x5c
#define SAA7127_REG_BLACK_LEVEL                      0x5d
#define SAA7127_REG_BLANKING_LEVEL                   0#efineSAA7127_REG_TTX_ODD_REQ_VERT_END0x77
#define SAA7127_REG_VBI_BLANKING                     0x5f
#define SAA7127_REG_DAC_CONTROL                      0x61define                     x7a
#define SAA7127_REG_BURST_AMP                        0x62
0x63
#define SAA7127_REG_SUBC2                            0x64
#define SAA7127_REG_SUBC1                            0x65
#define SAA7127_REG_SUBC00x66
#define SAA7127_REG_LINE_21_ODD_0                    0x67
#define SAA7127_REG_LINE_21_ODD_1                    0x68
                   0x69
#define SAA7127_REG_LINE_21_EVEN_1                   0x6a
#define SAA7127_REG_RCV_PORT_CONTROL                 0x6b
#define  * *********java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#define;
 consti2c_reg_value[]=
#define SAA7127_REG_CLOSED_CAPTION                   0 ,  x38
define0
#define SAA7127_REG_RCV2_OUTPUT_END                  0x71
SAA7127_REG_RCV2_OUTPUT_MSBS
#define SAA7127_REG_TTX_REQUEST_H_START              0x73
# SAA7127_REG_TTX_REQUEST_H_DELAY_LENGTH
SAA7127_REG_CSYNC_ADVANCE_VSYNC_SHIFT
#define SAA7127_REG_TTX_ODD_REQ_VERT_START            , 0 }java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
#{,  xbf
 SAA7127_REG_GAIN_LUMINANCE_RGB ,
            x79
define                     
                       java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
#define{,   ,
#define             
#define            x7f


 ***************************
 
*Arrays    the
 *
 ** SAA7127_REG_TTX_ODD_REQ_VERT_END }
/

struct i2c_reg_value {
 unsigned char reg;
 unsigned char value;
;

static const struct i2c_reg_valueSAA7127_REG_LAST_ACTIVE ,
,
 { SAA7127_REG_VTRIG , 0 ,
{, 
};

static const struct i2c_reg_value const  [  java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
 { SAA7127_REG_BLACK_LEVEL x39
{,00,
 { SAA7127_REG_COPYGEN_0,   0x77 },
{, x41
  , x15
, xbf
{,  x00
 ,  x00
{, x80/* for color bars */
  , x90
{, x11,
{, 0 }
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{,   x12
  /* BURST_END is also used as a chip ID in saa7127_probe */
{, 0 ,
 { SAA7127_REG_RCV2_OUTPUT_START,  0x41 },
  ,  xc3
  ,  00}java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
 , 0 }
 ,xb8
{SAA7127_REG_CSYNC_ADVANCE_VSYNC_SHIFT ,
 { SAA7127_REG_TTX_ODD_REQ_VERT_START,  0x15  ,  x09
{,  x16
 {,  0 }
 { ,0}
 { SAA7127_REG_FIRST_ACTIVE,   0x1a },

{ ,  x },
 { java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
 {  }
}
};

{, x81
g_value[ java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
, x19
 /* BURST_END is also used as a chip ID in saa7127_probe */
 , x1d
 { , 0 }
 {, 0x90}java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
 { java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 2
 { SAA7127_REG_BLACK_LEVEL,   0x39 },
 { SAA7127_REG_BLANKING_LEVEL *
 { SAA7127_REG_VBI_BLANKING,   0x2e  
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 {  SAA7129
 { SAA7127_REG_SUBC3
 { SAA7127_REG_SUBC2,  0 },
 {  struct sd
 { SAA7127_REG_SUBC0 std
 {  enum ident
   saa7127_input_type ;
 { 0 enum output_type
};

#wss_enable;
u16 w
 {  cc_enable
 /* BURST_END is also used as a chip ID in saa7127_probe */;
 { SAA7127_REG_BURST_ENDu16;
 { SAA7127_REG_CHROMA_PHASE vps_enable;
 { SAA7127_REG_GAINU vps_data;
 { SAA7127_REG_GAINV reg_2d
 {SAA7127_REG_BLACK_LEVEL
G_BLANKING_LEVEL x35
u reg_61;
 {java.lang.StringIndexOutOfBoundsException: Range [0, 3) out of bounds for length 2
 { SAA7127_REG_BURST_AMP,   0x2f },
{
 { SAA7127_REG_SUBC2,    0x8a },
 { SAA7127_REG_SUBC1,    0x09 },
{ SAA7127_REG_SUBC0  0x2a
 { SAA7127_REG_MULTI
 { SAA7127_REG_CLOSED_CAPTION,   0x00 
staticconst *const[] 
};

#efine SAA7127_50HZ_SECAM_DAC_CONTROL
static ""java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
  ,  x21

{ SAA7127_REG_BURST_END, 0x1d },
{ SAA7127_REG_CHROMA_PHASE, 0x3f },
{ SAA7127_REG_GAINU, 0x6a },
{ SAA7127_REG_GAINV, 0x81 },
{ SAA7127_REG_BLACK_LEVEL, 0x33 },
{ SAA7127_REG_BLANKING_LEVEL, 0x35 },
{ SAA7127_REG_VBI_BLANKING, 0x35 },
{ SAA7127_REG_DAC_CONTROL, 0x08 },
{ SAA7127_REG_BURST_AMP, 0x2f },
{ SAA7127_REG_SUBC3, 0xb2 },
{ SAA7127_REG_SUBC2, 0x3b },
{ SAA7127_REG_SUBC1, 0xa3 },
{ SAA7127_REG_SUBC0, 0x28 },
{ SAA7127_REG_MULTI, 0x90 },
{ SAA7127_REG_CLOSED_CAPTION, 0x00 },
{ 0, 0 }
};

/*
 **********************************************************************
 *
 *  Encoder Struct, holds the configuration state of the encoder
 *
 **********************************************************************
 */


enum java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  struct* =();
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
};

struct
 java.lang.StringIndexOutOfBoundsException: Range [77, 78) out of bounds for length 77
 v4l2_std_id std;
 enum saa712x_model ident;
 enum saa7127_input_type input_type;
 enum saa7127_output_type output_type;
 int  i2c_client* = (sd
 int ijava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
 u16 wss_mode;
 int  ((client, ) =0
 u16 cc_data  0
 int
 u16v4l2_err(,I2CProblemn";
 int vps_enable;
 u8 vps_data[5];
 u8 reg_2d;
 u8return1
 u8 reg_3a_cb;   
 u8 reg_61
java.lang.StringIndexOutOfBoundsException: Range [77, 2) out of bounds for length 2

static inline struct   struct *egs
{
 return container_of(sd, struct saa7127_state, sd);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

static
{
 "java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 "Composite",
 " struct state=to_state(sd);
 "RGB",
 "YUV C",
 "YUV V"
;

static f( && data- ! 0| >line 1)
 "invalid"java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
 "letterbox 14:9 (1 , sd, TurnVPS Signal %s\n,enable?"n  off
 "letterbox 14:9 top" (sd x54 << 7;
"
 "letterboxjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 state-[  >[2;
 "invalid",
 "16:9 full format anamorphic">1=>[]
"3 ",
 >[3 data-;
 " state-[] data->data1;
 "letterbox 16:9 center",
 invalid
 19java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
19full
 "invalid",(, ,>vps_data4)
};

/* ----------------------------------------------------------------------- */

staticjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
{
 struct i2c_client 

return(,);
}



static int saa7127_write enable(>line
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  v4l2_dbg,,
 Turn  ?o""")java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42

 for (state-  ;
  }
   return)
r ;

;
}( ,cc);

/* ----------------------------------------------------------------------- */

  (sd
     const struct i2c_reg_value;
{
  (>reg)
  saa7127_write(

 }
 return  * = (sd
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

/* ----------------------------------------------------------------------- */

static( , ," sn, enable on : off"java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
{
 struct saa7127_state *state = to_state(sd);
 int enable = (data->line != 0);

 if (enable && (data->field != 0 || data->line !=  }
   EINVAL
 if (state- 0;
  v4l2_dbg
  (2, debug, sd"DSdata 0x\",xds;
  state->vps_enable = saa7127_write,,xdsxff
 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 if (!enable)
  return 0;

 state->vps_data[0] = data->data[2];
 state->vps_data[1] = data->data[8];
 state->vps_data[2] = data->data[9];
 state->vps_data[3] = data-
 state->vps_datajava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 v4l2_dbg{
saa7127_write, x55>vps_data;
 nt = data- ! 0java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
 (sd x57 state-[2)
 saa7127_write(sd, 0x58, state->vps_data[3]);
(sd x59state-[];
 0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
}



static int saa7127_set_cc( >wss_enableenable
{
struct * =to_state)
 cc>]<  |>[
 int enable

  &data->  1
  return(,sd
ifstate-)
  v4l2_dbg> =(>1 )< 8|>[0java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
   "Turn CC %s\n", enable ? "on" : "off");
 (,,
 /
  state->java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 0
 }
 if (!enable)
  return 0;

 v4l2_dbg2 debug,sdCCdata")
 saa7127_write( (1,debug  \java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
 saa7127_write, ,  \)
  (,0,  )
 ;
}

/* ----------------------------------------------------------------------- */

static  >  ;
{
 struct
 u16 =>[1 <  |>data]
 int 

 if (enable &
  return  s=()
    ;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(,
 > ;
  }if> =&
 }
 !)
returnjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11

 v4l2_dbg(2, debug, sd, "XDS data: v4l2_dbg(, debug,,
sd )
   =;
> xds
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0


/* ----------------------------------------------------------------------- */

static struct*   *)
{
 s(,)
   =data- )

 if (enable && (data-
  return -EINVAL;
 ifjava.lang.StringIndexOutOfBoundsException: Range [0, 4) out of bounds for length 0
(,, , Turn, ?"":"ff)
  saa7127_write(sd, 0x27, enable java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  :
 }
 if (!enable >  x0f
  return 0;

 saa7127_write(sd, 0x26, data->data;
 saa7127_write(sd :
 v4l2_dbg  > =SAA7129
  "WSS mode: %s\n", wss_strs[data->data[0] & 0xf]);
state->1&0f <8|>[0java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
 return 0;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

/* ----------------------------------------------------------------------- */

  saa7127_set_video_enable v4l2_subdev*,int)
{
 struct saa7127_state *state =else

 if >reg_3a0; /* by default switch YUV to RGB-matrix on */
break
  saa7127_write
  saa7127_write(, x61>reg_61;
 } else {
  v4l2_dbg(1, debug, sd, "Disable Video Output\n" > = x4f/* reg 2D = 01001111, all DAC's on, RGB + VBS */
  saa7127_write(sd,b;
  java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
 }
state-  ;
 return 0;
}

/* ----------------------------------------------------------------------- */)

static int   >reg_2dxbf
{
 struct saa7127_state
 const struct:

  l2_dbg1debug,,
   " soutputtype\n" [output
  inittab = saa7127_init_config_60hz
 tate- = ;

 } if>ident=SAA7129&java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
     (td& ) &
     !(std & (V4L2_STD_625_50 & ~V4L2_STD_SECAM))) {

 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  v4l2_dbg(1, debug, sd,
 static (structv4l2_subdev, intinput
  inittabjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  state->reg_61 =

 } else {
 (1,debugsd " 5 PALvideo Standardn)
  inittab = saa7127_init_config_50hz_pal;
  state->reg_61, , SelectingNormal Inputn";
}

 /* Write Table */
127_write_inittab, inittab;
 state->stdv4l2_dbg,debugsd "electing Color Bar generatorn)
 return;
}

/* ----------------------------------------------------------------------- */

staticint(structv4l2_subdev*, int output)
{
 struct saa7127_state*state = to_statesd;

 switch (output) {
 case SAA7127_OUTPUT_TYPE_RGB saa7127_writesd 0, state-reg_3a |state-);
  state-reg_2d 0; /* RGB + CVBS (for sync) */
->  x13
  break;

 casejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  if
  >  x20
  else
   state->reg_2d =
  state->reg_3a = 0x13
  breakstaticint(struct *,

 case SAA7127_OUTPUT_TYPE_SVIDEO:
  if (state->ident == SAA7129)
  state- =018 /* Y + C */
  else
   state->reg_2d 
    saa7127_state = (sd
  break int  =0java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12

caseSAA7127_OUTPUT_TYPE_YUV_V
  state- rc  &>output_type )
  state->reg_3a =(,java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
  state-
 x0b
  break;

java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
 > )
   ;
  >)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
  > java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
  >   )
;

 default
 ;
 }
(1,java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
Selectingtypeoutput

 /* Configure Encoder */ >java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
 }
 java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
 state->output_typejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 return 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

/* ----------------------------------------------------------------------- */

static struct *)
{
 struct s saa7127_state =(sd;

 switch (inputv4l2_info,":%s\" state-&  6 " 5 ";
case:java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
   l2_info%,> 
   [>]  java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
;


  v4l2_dbg
 
 ;

 default:
  return -EINVALifdefCONFIG_VIDEO_ADV_DEBUG
}
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 51
> ;
 return java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

/* ----------------------------------------------------------------------- */;

static int saa7127_s_std_output(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
 struct saa7127_state *state = to_state(sd);

 if (state->std == std  -;
  return 0;
 return saa7127_set_std
}

static int saa7127_s_routing(struct >addr< 1;
        u32 inputstatedevm_kzallocclient-devsizeofstate )java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
{
 struct saa7127_state *state =  =&>sd
 int rc  ;

 if (state->input_type != input)
  rc = saa7127_set_input_type(sd57are version  ( be0,
 if (rc == 0 && state->output_typeand 2should  0
  if(saa7127_read(, 0 &0xe4) ! 0 |
 return rc;
}

static int saa7127_s_stream(struct   ((sd x29&0x3f!=0x1d){
{
struct *state (sd)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44

 if (state-){/java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
  return 0;
 return saa7127_set_video_enable(sd, enable);
}

static  saa7127_g_sliced_fmtstruct *, truct *fmt
{
  saa7127_statestate (sd;

memsetfmt-, 0(fmt-));
 if (state-> state->ident ;
 fmt-06  V4L2_SLICED_VPS;
 if (state->wss_enable)
  fmt->  java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26

fmt-[]2]= ;
  fmt- client- < ,client->);
 }
 fmt->service_set =
  (>vps_enable ?V4L2_SLICED_VPS 0 |
  (state-saa7127_write_inittabsdsaa7127_init_config_common);
  (state-> saa7127_set_std(sdV4L2_STD_NTSC;
 return 0;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

static int (sd vbi;
{
 switch (data->id) {
 case V4L2_SLICED_WSS_625:
  return (sddata
 case V4L2_SLICED_VPS:
   (sddata
 case V4L2_SLICED_CAPTION_525:
 if data- ==)
   return  /* This can befor *java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
  return saa7127_set_xds(sd, data (sd );
 :
  returnjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 }
 return 0;
}

#ifdef CONFIG_VIDEO_ADV_DEBUG
static int saa7127_g_register ;
{
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 reg->size = 1;
 return 0;
}

static int saa7127_s_register(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg)
{
 saa7127_write(sd, reg->reg & 0xffjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 return;
}
#endif

static s v4l2_subdev =(client
{
 struct saa7127_state *state(sd;

 v4l2_info(sd, "Standard: %s\n", (state->std * Turn off TV output */
 v4l2_info
 v4l2_info(sd, "Output
   output_strs[state->output_type
 (sd,WSSsn,state- ?
   wss_strs[state->wss_mode] : "disabled");
 v4l2_info{"saa7127_auto",0 } /* auto-detection */
 v4l2_info(sd ": %s\n, state->cc_enable?"enabled: "");
 return 0;
}

/* ----------------------------------------------------------------------- */

static const struct v4l2_subdev_core_ops saa7127_core_ops = {
 .log_status = saa7127_log_status,
#ifdef CONFIG_VIDEO_ADV_DEBUG
 .g_register {}
 .s_register = saa7127_s_register
#endif
};

static const struct v4l2_subdev_video_ops saa7127_video_ops = {
 .s_std_output static i2c_driver  = {
 .s_routing = saa7127_s_routing,
 .s_stream.driver{
};

static const struct v4l2_subdev_vbi_ops .ame saa7127
 .s_vbi_data = saa7127_s_vbi_data,
 .g_sliced_fmt saa7127_g_sliced_fmt,
};

static const struct v4l2_subdev_ops saa7127_ops = {
 .core = &saa7127_core_ops,
 .video = &saa7127_video_ops
 .vbi = &module_i2c_driver(saa7127_driver;
};

/* ----------------------------------------------------------------------- */

static int saa7127_probe(struct i2c_client *client)
{
 const struct i2c_device_id *id = i2c_client_get_device_id(client);
 struct saa7127_state *state;
 struct v4l2_subdev *sd;
 struct v4l2_sliced_vbi_data vbi = { 0, 0, 0, 0 };  /* set to disabled */

 /* Check if the adapter supports the needed features */
 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
  return -EIO;

 v4l_dbg(1, debug, client, "detecting saa7127 client on address 0x%x\n",
   client->addr << 1);

 state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL);
 if (state == NULL)
  return -ENOMEM;

 sd = &state->sd;
 v4l2_i2c_subdev_init(sd, client, &saa7127_ops);

 /* First test register 0: Bits 5-7 are a version ID (should be 0),
   and bit 2 should also be 0.
   This is rather general, so the second test is more specific and
   looks at the 'ending point of burst in clock cycles' which is
   0x1d after a reset and not expected to ever change. */

 if ((saa7127_read(sd, 0) & 0xe4) != 0 ||
   (saa7127_read(sd, 0x29) & 0x3f) != 0x1d) {
  v4l2_dbg(1, debug, sd, "saa7127 not found\n");
  return -ENODEV;
 }

 if (id->driver_data) { /* Chip type is already known */
  state->ident = id->driver_data;
 } else {  /* Needs detection */
  int read_result;

  /* Detect if it's an saa7129 */
  read_result = saa7127_read(sd, SAA7129_REG_FADE_KEY_COL2);
  saa7127_write(sd, SAA7129_REG_FADE_KEY_COL2, 0xaa);
  if (saa7127_read(sd, SAA7129_REG_FADE_KEY_COL2) == 0xaa) {
   saa7127_write(sd, SAA7129_REG_FADE_KEY_COL2,
     read_result);
   state->ident = SAA7129;
   strscpy(client->name, "saa7129", I2C_NAME_SIZE);
  } else {
   state->ident = SAA7127;
   strscpy(client->name, "saa7127", I2C_NAME_SIZE);
  }
 }

 v4l2_info(sd, "%s found @ 0x%x (%s)\n", client->name,
   client->addr << 1, client->adapter->name);

 v4l2_dbg(1, debug, sd, "Configuring encoder\n");
 saa7127_write_inittab(sd, saa7127_init_config_common);
 saa7127_set_std(sd, V4L2_STD_NTSC);
 saa7127_set_output_type(sd, SAA7127_OUTPUT_TYPE_BOTH);
 saa7127_set_vps(sd, &vbi);
 saa7127_set_wss(sd, &vbi);
 saa7127_set_cc(sd, &vbi);
 saa7127_set_xds(sd, &vbi);
 if (test_image == 1)
  /* The Encoder has an internal Colorbar generator */
  /* This can be used for debugging */
  saa7127_set_input_type(sd, SAA7127_INPUT_TYPE_TEST_IMAGE);
 else
  saa7127_set_input_type(sd, SAA7127_INPUT_TYPE_NORMAL);
 saa7127_set_video_enable(sd, 1);

 if (state->ident == SAA7129)
  saa7127_write_inittab(sd, saa7129_init_config_extra);
 return 0;
}

/* ----------------------------------------------------------------------- */

static void saa7127_remove(struct i2c_client *client)
{
 struct v4l2_subdev *sd = i2c_get_clientdata(client);

 v4l2_device_unregister_subdev(sd);
 /* Turn off TV output */
 saa7127_set_video_enable(sd, 0);
}

/* ----------------------------------------------------------------------- */

static const struct i2c_device_id saa7127_id[] = {
 { "saa7127_auto", 0 }, /* auto-detection */
 { "saa7126", SAA7127 },
 { "saa7127", SAA7127 },
 { "saa7128", SAA7129 },
 { "saa7129", SAA7129 },
 { }
};
MODULE_DEVICE_TABLE(i2c, saa7127_id);

static struct i2c_driver saa7127_driver = {
 .driver = {
  .name = "saa7127",
 },
 .probe  = saa7127_probe,
 .remove  = saa7127_remove,
 .id_table = saa7127_id,
};

module_i2c_driver(saa7127_driver);

Messung V0.5
C=92 H=95 G=93

¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.8Bemerkung:  ¤

*Bot Zugriff






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge