summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ch7017/ch7017.c40
-rw-r--r--src/ch7xxx/ch7xxx.c16
-rw-r--r--src/ivch/ivch.c35
-rw-r--r--src/sil164/sil164.c23
-rw-r--r--src/sil164/sil164_reg.h15
-rw-r--r--src/tfp410/tfp410.c21
-rw-r--r--src/tfp410/tfp410_reg.h15
7 files changed, 82 insertions, 83 deletions
diff --git a/src/ch7017/ch7017.c b/src/ch7017/ch7017.c
index 76f9cf77..f685965c 100644
--- a/src/ch7017/ch7017.c
+++ b/src/ch7017/ch7017.c
@@ -47,16 +47,16 @@
struct ch7017_priv {
I2CDevRec d;
- CARD8 save_hapi;
- CARD8 save_vali;
- CARD8 save_valo;
- CARD8 save_ailo;
- CARD8 save_lvds_pll_vco;
- CARD8 save_feedback_div;
- CARD8 save_lvds_control_2;
- CARD8 save_outputs_enable;
- CARD8 save_lvds_power_down;
- CARD8 save_power_management;
+ uint8_t save_hapi;
+ uint8_t save_vali;
+ uint8_t save_valo;
+ uint8_t save_ailo;
+ uint8_t save_lvds_pll_vco;
+ uint8_t save_feedback_div;
+ uint8_t save_lvds_control_2;
+ uint8_t save_outputs_enable;
+ uint8_t save_lvds_power_down;
+ uint8_t save_power_management;
};
static void
@@ -65,7 +65,7 @@ static void
ch7017_dpms(I2CDevPtr d, int mode);
static Bool
-ch7017_read(struct ch7017_priv *priv, int addr, CARD8 *val)
+ch7017_read(struct ch7017_priv *priv, int addr, uint8_t *val)
{
if (!xf86I2CReadByte(&priv->d, addr, val)) {
xf86DrvMsg(priv->d.pI2CBus->scrnIndex, X_ERROR,
@@ -77,7 +77,7 @@ ch7017_read(struct ch7017_priv *priv, int addr, CARD8 *val)
}
static Bool
-ch7017_write(struct ch7017_priv *priv, int addr, CARD8 val)
+ch7017_write(struct ch7017_priv *priv, int addr, uint8_t val)
{
if (!xf86I2CWriteByte(&priv->d, addr, val)) {
xf86DrvMsg(priv->d.pI2CBus->scrnIndex, X_ERROR,
@@ -93,7 +93,7 @@ static void *
ch7017_init(I2CBusPtr b, I2CSlaveAddr addr)
{
struct ch7017_priv *priv;
- CARD8 val;
+ uint8_t val;
priv = xcalloc(1, sizeof(struct ch7017_priv));
if (priv == NULL)
@@ -149,11 +149,11 @@ static void
ch7017_mode_set(I2CDevPtr d, DisplayModePtr mode, DisplayModePtr adjusted_mode)
{
struct ch7017_priv *priv = d->DriverPrivate.ptr;
- CARD8 lvds_pll_feedback_div, lvds_pll_vco_control;
- CARD8 outputs_enable, lvds_control_2, lvds_power_down;
- CARD8 horizontal_active_pixel_input;
- CARD8 horizontal_active_pixel_output, vertical_active_line_output;
- CARD8 active_input_line_output;
+ uint8_t lvds_pll_feedback_div, lvds_pll_vco_control;
+ uint8_t outputs_enable, lvds_control_2, lvds_power_down;
+ uint8_t horizontal_active_pixel_input;
+ uint8_t horizontal_active_pixel_output, vertical_active_line_output;
+ uint8_t active_input_line_output;
xf86DrvMsg(priv->d.pI2CBus->scrnIndex, X_INFO,
"Registers before mode setting\n");
@@ -228,7 +228,7 @@ static void
ch7017_dpms(I2CDevPtr d, int mode)
{
struct ch7017_priv *priv = d->DriverPrivate.ptr;
- CARD8 val;
+ uint8_t val;
ch7017_read(priv, CH7017_LVDS_POWER_DOWN, &val);
@@ -258,7 +258,7 @@ static void
ch7017_dump_regs(I2CDevPtr d)
{
struct ch7017_priv *priv = d->DriverPrivate.ptr;
- CARD8 val;
+ uint8_t val;
#define DUMP(reg) \
do { \
diff --git a/src/ch7xxx/ch7xxx.c b/src/ch7xxx/ch7xxx.c
index 51fa78e6..3309a569 100644
--- a/src/ch7xxx/ch7xxx.c
+++ b/src/ch7xxx/ch7xxx.c
@@ -50,7 +50,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
static struct ch7xxx_id_struct {
- CARD8 vid;
+ uint8_t vid;
char *name;
} ch7xxx_ids[] = {
{ CH7011_VID, "CH7011" },
@@ -62,7 +62,7 @@ static struct ch7xxx_id_struct {
#define ID_ARRAY_SIZE (sizeof(ch7xxx_ids) / sizeof(ch7xxx_ids[0]))
struct ch7xxx_reg_state {
- CARD8 regs[CH7xxx_NUM_REGS];
+ uint8_t regs[CH7xxx_NUM_REGS];
};
struct ch7xxx_priv {
@@ -71,13 +71,13 @@ struct ch7xxx_priv {
struct ch7xxx_reg_state SavedReg;
struct ch7xxx_reg_state ModeReg;
- CARD8 save_TCTL, save_TPCP, save_TPD, save_TPVT;
- CARD8 save_TLPF, save_TCT, save_PM, save_IDF;
+ uint8_t save_TCTL, save_TPCP, save_TPD, save_TPVT;
+ uint8_t save_TLPF, save_TCT, save_PM, save_IDF;
};
static void ch7xxx_save(I2CDevPtr d);
-static char *ch7xxx_get_id(CARD8 vid)
+static char *ch7xxx_get_id(uint8_t vid)
{
int i;
@@ -126,7 +126,7 @@ ch7xxx_init(I2CBusPtr b, I2CSlaveAddr addr)
{
/* this will detect the CH7xxx chip on the specified i2c bus */
struct ch7xxx_priv *dev_priv;
- CARD8 vendor, device;
+ uint8_t vendor, device;
char *name;
dev_priv = xcalloc(1, sizeof(struct ch7xxx_priv));
@@ -187,7 +187,7 @@ static xf86OutputStatus
ch7xxx_detect(I2CDevPtr d)
{
struct ch7xxx_priv *dev_priv = d->DriverPrivate.ptr;
- CARD8 cdet, orig_pm, pm;
+ uint8_t cdet, orig_pm, pm;
ch7xxx_read(dev_priv, CH7xxx_PM, &orig_pm);
@@ -219,7 +219,7 @@ static void
ch7xxx_mode_set(I2CDevPtr d, DisplayModePtr mode, DisplayModePtr adjusted_mode)
{
struct ch7xxx_priv *dev_priv = d->DriverPrivate.ptr;
- CARD8 tvco, tpcp, tpd, tlpf, idf;
+ uint8_t tvco, tpcp, tpd, tlpf, idf;
if (mode->Clock <= 65000) {
tvco = 0x23;
diff --git a/src/ivch/ivch.c b/src/ivch/ivch.c
index 820919fb..873afcc9 100644
--- a/src/ivch/ivch.c
+++ b/src/ivch/ivch.c
@@ -50,26 +50,25 @@ struct ivch_priv {
xf86OutputPtr output;
Bool quiet;
- CARD16 width;
- CARD16 height;
+ uint16_t width, height;
- CARD16 save_VR01;
- CARD16 save_VR40;
+ uint16_t save_VR01;
+ uint16_t save_VR40;
};
struct vch_capabilities {
struct aimdb_block aimdb_block;
- CARD8 panel_type;
- CARD8 set_panel_type;
- CARD8 slave_address;
- CARD8 capabilities;
+ uint8_t panel_type;
+ uint8_t set_panel_type;
+ uint8_t slave_address;
+ uint8_t capabilities;
#define VCH_PANEL_FITTING_SUPPORT (0x3 << 0)
#define VCH_PANEL_FITTING_TEXT (1 << 2)
#define VCH_PANEL_FITTING_GRAPHICS (1 << 3)
#define VCH_PANEL_FITTING_RATIO (1 << 4)
#define VCH_DITHERING (1 << 5)
- CARD8 backlight_gpio;
- CARD8 set_panel_type_us_gpios;
+ uint8_t backlight_gpio;
+ uint8_t set_panel_type_us_gpios;
} __attribute__ ((packed));
static void
@@ -81,7 +80,7 @@ ivch_dump_regs(I2CDevPtr d);
* Each of the 256 registers are 16 bits long.
*/
static Bool
-ivch_read(struct ivch_priv *priv, int addr, CARD16 *data)
+ivch_read(struct ivch_priv *priv, int addr, uint16_t *data)
{
I2CBusPtr b = priv->d.pI2CBus;
I2CByte *p = (I2CByte *) data;
@@ -118,7 +117,7 @@ ivch_read(struct ivch_priv *priv, int addr, CARD16 *data)
/** Writes a 16-bit register on the ivch */
static Bool
-ivch_write(struct ivch_priv *priv, int addr, CARD16 data)
+ivch_write(struct ivch_priv *priv, int addr, uint16_t data)
{
I2CBusPtr b = priv->d.pI2CBus;
@@ -158,7 +157,7 @@ static void *
ivch_init(I2CBusPtr b, I2CSlaveAddr addr)
{
struct ivch_priv *priv;
- CARD16 temp;
+ uint16_t temp;
priv = xcalloc(1, sizeof(struct ivch_priv));
if (priv == NULL)
@@ -226,7 +225,7 @@ ivch_dpms(I2CDevPtr d, int mode)
{
struct ivch_priv *priv = d->DriverPrivate.ptr;
int i;
- CARD16 vr01, vr30, backlight;
+ uint16_t vr01, vr30, backlight;
/* Set the new power state of the panel. */
if (!ivch_read(priv, VR01, &vr01))
@@ -262,8 +261,8 @@ static void
ivch_mode_set(I2CDevPtr d, DisplayModePtr mode, DisplayModePtr adjusted_mode)
{
struct ivch_priv *priv = d->DriverPrivate.ptr;
- CARD16 vr40 = 0;
- CARD16 vr01;
+ uint16_t vr40 = 0;
+ uint16_t vr01;
vr01 = 0;
vr40 = (VR40_STALL_ENABLE |
@@ -273,7 +272,7 @@ ivch_mode_set(I2CDevPtr d, DisplayModePtr mode, DisplayModePtr adjusted_mode)
if (mode->HDisplay != adjusted_mode->HDisplay ||
mode->VDisplay != adjusted_mode->VDisplay)
{
- CARD16 x_ratio, y_ratio;
+ uint16_t x_ratio, y_ratio;
vr01 |= VR01_PANEL_FIT_ENABLE;
vr40 |= VR40_CLOCK_GATING_ENABLE;
@@ -299,7 +298,7 @@ static void
ivch_dump_regs(I2CDevPtr d)
{
struct ivch_priv *priv = d->DriverPrivate.ptr;
- CARD16 val;
+ uint16_t val;
ivch_read(priv, VR00, &val);
xf86DrvMsg(priv->d.pI2CBus->scrnIndex, X_INFO, "VR00: 0x%04x\n", val);
diff --git a/src/sil164/sil164.c b/src/sil164/sil164.c
index f7d414a2..0c325456 100644
--- a/src/sil164/sil164.c
+++ b/src/sil164/sil164.c
@@ -45,8 +45,23 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "sil164.h"
#include "sil164_reg.h"
+typedef struct _Sil164SaveRec {
+ uint8_t reg8;
+ uint8_t reg9;
+ uint8_t regc;
+} SIL164SaveRec;
+
+typedef struct {
+ I2CDevRec d;
+ Bool quiet;
+ SIL164SaveRec SavedReg;
+ SIL164SaveRec ModeReg;
+} SIL164Rec, *SIL164Ptr;
+
+#define SILPTR(d) ((SIL164Ptr)(d->DriverPrivate.ptr))
+
static Bool
-sil164ReadByte(SIL164Ptr sil, int addr, CARD8 *ch)
+sil164ReadByte(SIL164Ptr sil, int addr, uint8_t *ch)
{
if (!xf86I2CReadByte(&(sil->d), addr, ch)) {
if (!sil->quiet) {
@@ -60,7 +75,7 @@ sil164ReadByte(SIL164Ptr sil, int addr, CARD8 *ch)
}
static Bool
-sil164WriteByte(SIL164Ptr sil, int addr, CARD8 ch)
+sil164WriteByte(SIL164Ptr sil, int addr, uint8_t ch)
{
if (!xf86I2CWriteByte(&(sil->d), addr, ch)) {
if (!sil->quiet) {
@@ -131,7 +146,7 @@ static xf86OutputStatus
sil164_detect(I2CDevPtr d)
{
SIL164Ptr sil = SILPTR(d);
- CARD8 reg9;
+ uint8_t reg9;
sil164ReadByte(sil, SIL164_REG9, &reg9);
@@ -190,7 +205,7 @@ static void
sil164_dump_regs(I2CDevPtr d)
{
SIL164Ptr sil = SILPTR(d);
- CARD8 val;
+ uint8_t val;
sil164ReadByte(sil, SIL164_FREQ_LO, &val);
xf86DrvMsg(sil->d.pI2CBus->scrnIndex, X_INFO, "SIL164_FREQ_LO: 0x%02x\n",
diff --git a/src/sil164/sil164_reg.h b/src/sil164/sil164_reg.h
index 734e55dd..151b430f 100644
--- a/src/sil164/sil164_reg.h
+++ b/src/sil164/sil164_reg.h
@@ -57,19 +57,4 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define SIL164_REGC 0x0c
-typedef struct _Sil164SaveRec {
- CARD8 reg8;
- CARD8 reg9;
- CARD8 regc;
-} SIL164SaveRec;
-
-typedef struct {
- I2CDevRec d;
- Bool quiet;
- SIL164SaveRec SavedReg;
- SIL164SaveRec ModeReg;
-} SIL164Rec, *SIL164Ptr;
-
-#define SILPTR(d) ((SIL164Ptr)(d->DriverPrivate.ptr))
-
#endif
diff --git a/src/tfp410/tfp410.c b/src/tfp410/tfp410.c
index bb038cdb..81a6d0a7 100644
--- a/src/tfp410/tfp410.c
+++ b/src/tfp410/tfp410.c
@@ -44,8 +44,23 @@
#include "tfp410.h"
#include "tfp410_reg.h"
+typedef struct _TFP410SaveRec {
+ uint8_t ctl1;
+ uint8_t ctl2;
+} TFP410SaveRec;
+
+typedef struct {
+ I2CDevRec d;
+ Bool quiet;
+
+ TFP410SaveRec SavedReg;
+ TFP410SaveRec ModeReg;
+} TFP410Rec, *TFP410Ptr;
+
+#define TFPPTR(d) ((TFP410Ptr)(d->DriverPrivate.ptr))
+
static Bool
-tfp410ReadByte(TFP410Ptr tfp, int addr, CARD8 *ch)
+tfp410ReadByte(TFP410Ptr tfp, int addr, uint8_t *ch)
{
if (!xf86I2CReadByte(&(tfp->d), addr, ch)) {
if (!tfp->quiet) {
@@ -59,7 +74,7 @@ tfp410ReadByte(TFP410Ptr tfp, int addr, CARD8 *ch)
}
static Bool
-tfp410WriteByte(TFP410Ptr tfp, int addr, CARD8 ch)
+tfp410WriteByte(TFP410Ptr tfp, int addr, uint8_t ch)
{
if (!xf86I2CWriteByte(&(tfp->d), addr, ch)) {
if (!tfp->quiet) {
@@ -191,7 +206,7 @@ static void
tfp410_dump_regs(I2CDevPtr d)
{
TFP410Ptr tfp = TFPPTR(d);
- CARD8 val, val2;
+ uint8_t val, val2;
tfp410ReadByte(tfp, TFP410_REV, &val);
xf86DrvMsg(tfp->d.pI2CBus->scrnIndex, X_INFO,
diff --git a/src/tfp410/tfp410_reg.h b/src/tfp410/tfp410_reg.h
index c555b977..5bfe28b2 100644
--- a/src/tfp410/tfp410_reg.h
+++ b/src/tfp410/tfp410_reg.h
@@ -88,19 +88,4 @@
#define TFP410_V_RES_LO 0x3C
#define TFP410_V_RES_HI 0x3D
-typedef struct _TFP410SaveRec {
- CARD8 ctl1;
- CARD8 ctl2;
-} TFP410SaveRec;
-
-typedef struct {
- I2CDevRec d;
- Bool quiet;
-
- TFP410SaveRec SavedReg;
- TFP410SaveRec ModeReg;
-} TFP410Rec, *TFP410Ptr;
-
-#define TFPPTR(d) ((TFP410Ptr)(d->DriverPrivate.ptr))
-
#endif