Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
ch7006_mode.c File Reference
#include "ch7006_priv.h"

Go to the source code of this file.

Macros

#define NTSC_LIKE_TIMINGS
 
#define PAL_LIKE_TIMINGS
 
#define __MODE(f, hd, vd, ht, vt, hsynp, vsynp,subc, scale, scale_mask, norm_mask, e_hd, e_vd)
 
#define MODE(f, hd, vd, ht, vt, hsynp, vsynp,subc, scale, scale_mask, norm_mask)
 
#define NTSC_LIKE
 
#define PAL_LIKE   (1 << TV_NORM_PAL | 1 << TV_NORM_PAL_N | 1 << TV_NORM_PAL_NC)
 

Functions

struct ch7006_modech7006_lookup_mode (struct drm_encoder *encoder, const struct drm_display_mode *drm_mode)
 
void ch7006_setup_levels (struct drm_encoder *encoder)
 
void ch7006_setup_subcarrier (struct drm_encoder *encoder)
 
void ch7006_setup_pll (struct drm_encoder *encoder)
 
void ch7006_setup_power_state (struct drm_encoder *encoder)
 
void ch7006_setup_properties (struct drm_encoder *encoder)
 
void ch7006_write (struct i2c_client *client, uint8_t addr, uint8_t val)
 
uint8_t ch7006_read (struct i2c_client *client, uint8_t addr)
 
void ch7006_state_load (struct i2c_client *client, struct ch7006_state *state)
 
void ch7006_state_save (struct i2c_client *client, struct ch7006_state *state)
 

Variables

charch7006_tv_norm_names []
 
struct ch7006_tv_norm_info ch7006_tv_norms []
 
struct ch7006_mode ch7006_modes []
 

Macro Definition Documentation

#define __MODE (   f,
  hd,
  vd,
  ht,
  vt,
  hsynp,
  vsynp,
  subc,
  scale,
  scale_mask,
  norm_mask,
  e_hd,
  e_vd 
)
Value:
{ \
.mode = { \
.name = #hd "x" #vd, \
.status = 0, \
.clock = f, \
.hdisplay = hd, \
.hsync_start = e_hd + 16, \
.hsync_end = e_hd + 80, \
.htotal = ht, \
.hskew = 0, \
.vdisplay = vd, \
.vsync_start = vd + 10, \
.vsync_end = vd + 26, \
.vtotal = vt, \
.vscan = 0, \
.flags = DRM_MODE_FLAG_##hsynp##HSYNC | \
DRM_MODE_FLAG_##vsynp##VSYNC, \
.vrefresh = 0, \
}, \
.enc_hdisp = e_hd, \
.enc_vdisp = e_vd, \
.subc_coeff = subc * fixed1, \
.dispmode = bitfs(CH7006_DISPMODE_SCALING_RATIO, scale) | \
bitfs(CH7006_DISPMODE_INPUT_RES, e_hd##x##e_vd), \
.valid_scales = scale_mask, \
.valid_norms = norm_mask \
}

Definition at line 105 of file ch7006_mode.c.

#define MODE (   f,
  hd,
  vd,
  ht,
  vt,
  hsynp,
  vsynp,
  subc,
  scale,
  scale_mask,
  norm_mask 
)
Value:
__MODE(f, hd, vd, ht, vt, hsynp, vsynp, subc, scale, \
scale_mask, norm_mask, hd, vd)

Definition at line 135 of file ch7006_mode.c.

#define NTSC_LIKE
Value:

Definition at line 140 of file ch7006_mode.c.

#define NTSC_LIKE_TIMINGS
Value:
.vrefresh = 60 * fixed1/1.001, \
.vdisplay = 480, \
.vtotal = 525, \
.hvirtual = 660

Definition at line 39 of file ch7006_mode.c.

#define PAL_LIKE   (1 << TV_NORM_PAL | 1 << TV_NORM_PAL_N | 1 << TV_NORM_PAL_NC)

Definition at line 143 of file ch7006_mode.c.

#define PAL_LIKE_TIMINGS
Value:
.vrefresh = 50 * fixed1, \
.vdisplay = 576, \
.vtotal = 625, \
.hvirtual = 810

Definition at line 44 of file ch7006_mode.c.

Function Documentation

struct ch7006_mode* ch7006_lookup_mode ( struct drm_encoder encoder,
const struct drm_display_mode drm_mode 
)
read

Definition at line 174 of file ch7006_mode.c.

uint8_t ch7006_read ( struct i2c_client client,
uint8_t  addr 
)

Definition at line 380 of file ch7006_mode.c.

void ch7006_setup_levels ( struct drm_encoder encoder)

Definition at line 200 of file ch7006_mode.c.

void ch7006_setup_pll ( struct drm_encoder encoder)

Definition at line 255 of file ch7006_mode.c.

void ch7006_setup_power_state ( struct drm_encoder encoder)

Definition at line 293 of file ch7006_mode.c.

void ch7006_setup_properties ( struct drm_encoder encoder)

Definition at line 326 of file ch7006_mode.c.

void ch7006_setup_subcarrier ( struct drm_encoder encoder)

Definition at line 231 of file ch7006_mode.c.

void ch7006_state_load ( struct i2c_client client,
struct ch7006_state state 
)

Definition at line 401 of file ch7006_mode.c.

void ch7006_state_save ( struct i2c_client client,
struct ch7006_state state 
)

Definition at line 435 of file ch7006_mode.c.

void ch7006_write ( struct i2c_client client,
uint8_t  addr,
uint8_t  val 
)

Definition at line 369 of file ch7006_mode.c.

Variable Documentation

struct ch7006_mode ch7006_modes[]
Initial value:
= {
MODE(21000, 512, 384, 840, 500, N, N, 181.797557582, 5_4, 0x6, PAL_LIKE),
MODE(26250, 512, 384, 840, 625, N, N, 145.438046066, 1_1, 0x1, PAL_LIKE),
MODE(20140, 512, 384, 800, 420, N, N, 213.257083791, 5_4, 0x4, NTSC_LIKE),
MODE(24671, 512, 384, 784, 525, N, N, 174.0874153, 1_1, 0x3, NTSC_LIKE),
MODE(28125, 720, 400, 1125, 500, N, N, 135.742176298, 5_4, 0x6, PAL_LIKE),
MODE(34875, 720, 400, 1116, 625, N, N, 109.469496898, 1_1, 0x1, PAL_LIKE),
MODE(23790, 720, 400, 945, 420, N, N, 160.475642016, 5_4, 0x4, NTSC_LIKE),
MODE(29455, 720, 400, 936, 525, N, N, 129.614941843, 1_1, 0x3, NTSC_LIKE),
MODE(25000, 640, 400, 1000, 500, N, N, 152.709948279, 5_4, 0x6, PAL_LIKE),
MODE(31500, 640, 400, 1008, 625, N, N, 121.198371646, 1_1, 0x1, PAL_LIKE),
MODE(21147, 640, 400, 840, 420, N, N, 180.535097338, 5_4, 0x4, NTSC_LIKE),
MODE(26434, 640, 400, 840, 525, N, N, 144.42807787, 1_1, 0x2, NTSC_LIKE),
MODE(30210, 640, 400, 840, 600, N, N, 126.374568276, 7_8, 0x1, NTSC_LIKE),
MODE(21000, 640, 480, 840, 500, N, N, 181.797557582, 5_4, 0x4, PAL_LIKE),
MODE(26250, 640, 480, 840, 625, N, N, 145.438046066, 1_1, 0x2, PAL_LIKE),
MODE(31500, 640, 480, 840, 750, N, N, 121.198371646, 5_6, 0x1, PAL_LIKE),
MODE(24671, 640, 480, 784, 525, N, N, 174.0874153, 1_1, 0x4, NTSC_LIKE),
MODE(28196, 640, 480, 784, 600, N, N, 152.326488422, 7_8, 0x2, NTSC_LIKE),
MODE(30210, 640, 480, 800, 630, N, N, 142.171389101, 5_6, 0x1, NTSC_LIKE),
__MODE(29500, 720, 576, 944, 625, P, P, 145.592111636, 1_1, 0x7, PAL_LIKE, 800, 600),
MODE(36000, 800, 600, 960, 750, P, P, 119.304647022, 5_6, 0x6, PAL_LIKE),
MODE(39000, 800, 600, 936, 836, P, P, 110.127366499, 3_4, 0x1, PAL_LIKE),
MODE(39273, 800, 600, 1040, 630, P, P, 145.816809399, 5_6, 0x4, NTSC_LIKE),
MODE(43636, 800, 600, 1040, 700, P, P, 131.235128487, 3_4, 0x2, NTSC_LIKE),
MODE(47832, 800, 600, 1064, 750, P, P, 119.723275165, 7_10, 0x1, NTSC_LIKE),
{}
}

Definition at line 145 of file ch7006_mode.c.

char* ch7006_tv_norm_names[]
Initial value:
= {
[TV_NORM_PAL] = "PAL",
[TV_NORM_PAL_M] = "PAL-M",
[TV_NORM_PAL_N] = "PAL-N",
[TV_NORM_PAL_NC] = "PAL-Nc",
[TV_NORM_PAL_60] = "PAL-60",
[TV_NORM_NTSC_M] = "NTSC-M",
[TV_NORM_NTSC_J] = "NTSC-J",
}

Definition at line 29 of file ch7006_mode.c.

struct ch7006_tv_norm_info ch7006_tv_norms[]

Definition at line 49 of file ch7006_mode.c.