linux/drivers/gpu/drm/i2c/ch7006_priv.h

/*
 * Copyright (C) 2009 Francisco Jerez.
 * All Rights Reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice (including the
 * next paragraph) shall be included in all copies or substantial
 * portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 */

#ifndef __DRM_I2C_CH7006_PRIV_H__
#define __DRM_I2C_CH7006_PRIV_H__

#include <drm/drm_encoder_slave.h>
#include <drm/drm_probe_helper.h>
#include <drm/i2c/ch7006.h>

fixed;
#define fixed1

enum ch7006_tv_norm {};

struct ch7006_tv_norm_info {};

struct ch7006_mode {};

struct ch7006_state {};

struct ch7006_priv {};

#define to_ch7006_priv(x)

extern int ch7006_debug;
extern char *ch7006_tv_norm;
extern int ch7006_scale;

extern const char * const ch7006_tv_norm_names[];
extern const struct ch7006_tv_norm_info ch7006_tv_norms[];
extern const struct ch7006_mode ch7006_modes[];

const struct ch7006_mode *ch7006_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);

/* Some helper macros */

#define ch7006_dbg(client, format, ...)
#define ch7006_info(client, format, ...)
#define ch7006_err(client, format, ...)

#define __mask(src, bitfield)
#define mask(bitfield)

#define __bitf(src, bitfield, x)
#define bitf(bitfield, x)
#define bitfs(bitfield, s)
#define setbitf(state, reg, bitfield, x)

#define __unbitf(src, bitfield, x)
#define unbitf(bitfield, x)

static inline int interpolate(int y0, int y1, int y2, int x)
{}

static inline int32_t round_fixed(fixed x)
{}

#define ch7006_load_reg(client, state, reg)
#define ch7006_save_reg(client, state, reg)

/* Fixed hardware specs */

#define CH7006_FREQ0
#define CH7006_MAXN
#define CH7006_MAXM

/* Register definitions */

#define CH7006_DISPMODE
#define CH7006_DISPMODE_INPUT_RES
#define CH7006_DISPMODE_INPUT_RES_512x384
#define CH7006_DISPMODE_INPUT_RES_720x400
#define CH7006_DISPMODE_INPUT_RES_640x400
#define CH7006_DISPMODE_INPUT_RES_640x480
#define CH7006_DISPMODE_INPUT_RES_800x600
#define CH7006_DISPMODE_INPUT_RES_NATIVE
#define CH7006_DISPMODE_OUTPUT_STD
#define CH7006_DISPMODE_OUTPUT_STD_PAL
#define CH7006_DISPMODE_OUTPUT_STD_NTSC
#define CH7006_DISPMODE_OUTPUT_STD_PAL_M
#define CH7006_DISPMODE_OUTPUT_STD_NTSC_J
#define CH7006_DISPMODE_SCALING_RATIO
#define CH7006_DISPMODE_SCALING_RATIO_5_4
#define CH7006_DISPMODE_SCALING_RATIO_1_1
#define CH7006_DISPMODE_SCALING_RATIO_7_8
#define CH7006_DISPMODE_SCALING_RATIO_5_6
#define CH7006_DISPMODE_SCALING_RATIO_3_4
#define CH7006_DISPMODE_SCALING_RATIO_7_10

#define CH7006_FFILTER
#define CH7006_FFILTER_TEXT
#define CH7006_FFILTER_LUMA
#define CH7006_FFILTER_CHROMA
#define CH7006_FFILTER_CHROMA_NO_DCRAWL

#define CH7006_BWIDTH
#define CH7006_BWIDTH_5L_FFILER
#define CH7006_BWIDTH_CVBS_NO_CHROMA
#define CH7006_BWIDTH_CHROMA
#define CH7006_BWIDTH_SVIDEO_YPEAK
#define CH7006_BWIDTH_SVIDEO_LUMA
#define CH7006_BWIDTH_CVBS_LUMA

#define CH7006_INPUT_FORMAT
#define CH7006_INPUT_FORMAT_DAC_GAIN
#define CH7006_INPUT_FORMAT_RGB_PASS_THROUGH
#define CH7006_INPUT_FORMAT_FORMAT
#define CH7006_INPUT_FORMAT_FORMAT_RGB16
#define CH7006_INPUT_FORMAT_FORMAT_YCrCb24m16
#define CH7006_INPUT_FORMAT_FORMAT_RGB24m16
#define CH7006_INPUT_FORMAT_FORMAT_RGB15
#define CH7006_INPUT_FORMAT_FORMAT_RGB24m12C
#define CH7006_INPUT_FORMAT_FORMAT_RGB24m12I
#define CH7006_INPUT_FORMAT_FORMAT_RGB24m8
#define CH7006_INPUT_FORMAT_FORMAT_RGB16m8
#define CH7006_INPUT_FORMAT_FORMAT_RGB15m8
#define CH7006_INPUT_FORMAT_FORMAT_YCrCb24m8

#define CH7006_CLKMODE
#define CH7006_CLKMODE_SUBC_LOCK
#define CH7006_CLKMODE_MASTER
#define CH7006_CLKMODE_POS_EDGE
#define CH7006_CLKMODE_XCM
#define CH7006_CLKMODE_PCM

#define CH7006_START_ACTIVE
#define CH7006_START_ACTIVE_0

#define CH7006_POV
#define CH7006_POV_START_ACTIVE_8
#define CH7006_POV_HPOS_8
#define CH7006_POV_VPOS_8

#define CH7006_BLACK_LEVEL
#define CH7006_BLACK_LEVEL_0

#define CH7006_HPOS
#define CH7006_HPOS_0

#define CH7006_VPOS
#define CH7006_VPOS_0

#define CH7006_INPUT_SYNC
#define CH7006_INPUT_SYNC_EMBEDDED
#define CH7006_INPUT_SYNC_OUTPUT
#define CH7006_INPUT_SYNC_PVSYNC
#define CH7006_INPUT_SYNC_PHSYNC

#define CH7006_POWER
#define CH7006_POWER_SCART
#define CH7006_POWER_RESET
#define CH7006_POWER_LEVEL
#define CH7006_POWER_LEVEL_CVBS_OFF
#define CH7006_POWER_LEVEL_POWER_OFF
#define CH7006_POWER_LEVEL_SVIDEO_OFF
#define CH7006_POWER_LEVEL_NORMAL
#define CH7006_POWER_LEVEL_FULL_POWER_OFF

#define CH7006_DETECT
#define CH7006_DETECT_SVIDEO_Y_TEST
#define CH7006_DETECT_SVIDEO_C_TEST
#define CH7006_DETECT_CVBS_TEST
#define CH7006_DETECT_SENSE

#define CH7006_CONTRAST
#define CH7006_CONTRAST_0

#define CH7006_PLLOV
#define CH7006_PLLOV_N_8
#define CH7006_PLLOV_M_8

#define CH7006_PLLM
#define CH7006_PLLM_0

#define CH7006_PLLN
#define CH7006_PLLN_0

#define CH7006_BCLKOUT

#define CH7006_SUBC_INC0
#define CH7006_SUBC_INC0_28

#define CH7006_SUBC_INC1
#define CH7006_SUBC_INC1_24

#define CH7006_SUBC_INC2
#define CH7006_SUBC_INC2_20

#define CH7006_SUBC_INC3
#define CH7006_SUBC_INC3_GPIO1_VAL
#define CH7006_SUBC_INC3_GPIO0_VAL
#define CH7006_SUBC_INC3_POUT_3_3V
#define CH7006_SUBC_INC3_POUT_INV
#define CH7006_SUBC_INC3_16

#define CH7006_SUBC_INC4
#define CH7006_SUBC_INC4_GPIO1_IN
#define CH7006_SUBC_INC4_GPIO0_IN
#define CH7006_SUBC_INC4_DS_INPUT
#define CH7006_SUBC_INC4_12

#define CH7006_SUBC_INC5
#define CH7006_SUBC_INC5_8

#define CH7006_SUBC_INC6
#define CH7006_SUBC_INC6_4

#define CH7006_SUBC_INC7
#define CH7006_SUBC_INC7_0

#define CH7006_PLL_CONTROL
#define CH7006_PLL_CONTROL_CPI
#define CH7006_PLL_CONTROL_CAPACITOR
#define CH7006_PLL_CONTROL_7STAGES
#define CH7006_PLL_CONTROL_DIGITAL_5V
#define CH7006_PLL_CONTROL_ANALOG_5V
#define CH7006_PLL_CONTROL_MEMORY_5V

#define CH7006_CALC_SUBC_INC0
#define CH7006_CALC_SUBC_INC0_24
#define CH7006_CALC_SUBC_INC0_HYST
#define CH7006_CALC_SUBC_INC0_AUTO

#define CH7006_CALC_SUBC_INC1
#define CH7006_CALC_SUBC_INC1_16

#define CH7006_CALC_SUBC_INC2
#define CH7006_CALC_SUBC_INC2_8

#define CH7006_CALC_SUBC_INC3
#define CH7006_CALC_SUBC_INC3_0

#define CH7006_VERSION_ID

#endif