require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&SYS_DEV_PCKBC_PMSREG_H)) {
    eval 'sub SYS_DEV_PCKBC_PMSREG_H () {1;}' unless defined(&SYS_DEV_PCKBC_PMSREG_H);
    eval 'sub PMS_SET_SCALE11 () {0xe6;}' unless defined(&PMS_SET_SCALE11);
    eval 'sub PMS_SET_SCALE21 () {0xe7;}' unless defined(&PMS_SET_SCALE21);
    eval 'sub PMS_SET_RES () {0xe8;}' unless defined(&PMS_SET_RES);
    eval 'sub PMS_SEND_DEV_STATUS () {0xe9;}' unless defined(&PMS_SEND_DEV_STATUS);
    eval 'sub PMS_SET_STREAM_MODE () {0xea;}' unless defined(&PMS_SET_STREAM_MODE);
    eval 'sub PMS_SEND_DEV_DATA () {0xeb;}' unless defined(&PMS_SEND_DEV_DATA);
    eval 'sub PMS_RESET_WRAP_MODE () {0xec;}' unless defined(&PMS_RESET_WRAP_MODE);
    eval 'sub PMS_SET_WRAP_MODE () {0xed;}' unless defined(&PMS_SET_WRAP_MODE);
    eval 'sub PMS_SET_REMOTE_MODE () {0xf0;}' unless defined(&PMS_SET_REMOTE_MODE);
    eval 'sub PMS_SEND_DEV_ID () {0xf2;}' unless defined(&PMS_SEND_DEV_ID);
    eval 'sub PMS_SET_SAMPLE () {0xf3;}' unless defined(&PMS_SET_SAMPLE);
    eval 'sub PMS_DEV_ENABLE () {0xf4;}' unless defined(&PMS_DEV_ENABLE);
    eval 'sub PMS_DEV_DISABLE () {0xf5;}' unless defined(&PMS_DEV_DISABLE);
    eval 'sub PMS_SET_DEFAULTS () {0xf6;}' unless defined(&PMS_SET_DEFAULTS);
    eval 'sub PMS_RESEND () {0xfe;}' unless defined(&PMS_RESEND);
    eval 'sub PMS_RESET () {0xff;}' unless defined(&PMS_RESET);
    eval 'sub PMS_RSTDONE () {0xaa;}' unless defined(&PMS_RSTDONE);
    eval 'sub PMS_PS2_BUTTONSMASK () {0x7;}' unless defined(&PMS_PS2_BUTTONSMASK);
    eval 'sub PMS_PS2_BUTTON1 () {0x1;}' unless defined(&PMS_PS2_BUTTON1);
    eval 'sub PMS_PS2_BUTTON2 () {0x4;}' unless defined(&PMS_PS2_BUTTON2);
    eval 'sub PMS_PS2_BUTTON3 () {0x2;}' unless defined(&PMS_PS2_BUTTON3);
    eval 'sub PMS_PS2_XNEG () {0x10;}' unless defined(&PMS_PS2_XNEG);
    eval 'sub PMS_PS2_YNEG () {0x20;}' unless defined(&PMS_PS2_YNEG);
    eval 'sub PMS_INTELLI_MAGIC1 () {200;}' unless defined(&PMS_INTELLI_MAGIC1);
    eval 'sub PMS_INTELLI_MAGIC2 () {100;}' unless defined(&PMS_INTELLI_MAGIC2);
    eval 'sub PMS_INTELLI_MAGIC3 () {80;}' unless defined(&PMS_INTELLI_MAGIC3);
    eval 'sub PMS_INTELLI_ID () {0x3;}' unless defined(&PMS_INTELLI_ID);
    eval 'sub PMS_ALPS_MAGIC1 () {0;}' unless defined(&PMS_ALPS_MAGIC1);
    eval 'sub PMS_ALPS_MAGIC2 () {0;}' unless defined(&PMS_ALPS_MAGIC2);
    eval 'sub PMS_ALPS_MAGIC3_1 () {10;}' unless defined(&PMS_ALPS_MAGIC3_1);
    eval 'sub PMS_ALPS_MAGIC3_2 () {80;}' unless defined(&PMS_ALPS_MAGIC3_2);
    eval 'sub PMS_ALPS_MAGIC3_3 () {100;}' unless defined(&PMS_ALPS_MAGIC3_3);
    eval 'sub PMS_ALPS_PS2_MASK () {0xc8;}' unless defined(&PMS_ALPS_PS2_MASK);
    eval 'sub PMS_ALPS_PS2_VALID () {0x8;}' unless defined(&PMS_ALPS_PS2_VALID);
    eval 'sub PMS_ALPS_INTERLEAVED_MASK () {0xcf;}' unless defined(&PMS_ALPS_INTERLEAVED_MASK);
    eval 'sub PMS_ALPS_INTERLEAVED_VALID () {0xf;}' unless defined(&PMS_ALPS_INTERLEAVED_VALID);
    eval 'sub PMS_ALPS_MASK () {0x80;}' unless defined(&PMS_ALPS_MASK);
    eval 'sub PMS_ALPS_VALID () {0x;}' unless defined(&PMS_ALPS_VALID);
    eval 'sub SYNAPTICS_QUE_IDENTIFY () {0x;}' unless defined(&SYNAPTICS_QUE_IDENTIFY);
    eval 'sub SYNAPTICS_QUE_MODES () {0x1;}' unless defined(&SYNAPTICS_QUE_MODES);
    eval 'sub SYNAPTICS_QUE_CAPABILITIES () {0x2;}' unless defined(&SYNAPTICS_QUE_CAPABILITIES);
    eval 'sub SYNAPTICS_QUE_MODEL () {0x3;}' unless defined(&SYNAPTICS_QUE_MODEL);
    eval 'sub SYNAPTICS_QUE_SERIAL_NUMBER_PREFIX () {0x6;}' unless defined(&SYNAPTICS_QUE_SERIAL_NUMBER_PREFIX);
    eval 'sub SYNAPTICS_QUE_SERIAL_NUMBER_SUFFIX () {0x7;}' unless defined(&SYNAPTICS_QUE_SERIAL_NUMBER_SUFFIX);
    eval 'sub SYNAPTICS_QUE_RESOLUTION () {0x8;}' unless defined(&SYNAPTICS_QUE_RESOLUTION);
    eval 'sub SYNAPTICS_QUE_EXT_MODEL () {0x9;}' unless defined(&SYNAPTICS_QUE_EXT_MODEL);
    eval 'sub SYNAPTICS_QUE_EXT_CAPABILITIES () {0xc;}' unless defined(&SYNAPTICS_QUE_EXT_CAPABILITIES);
    eval 'sub SYNAPTICS_QUE_EXT_DIMENSIONS () {0xd;}' unless defined(&SYNAPTICS_QUE_EXT_DIMENSIONS);
    eval 'sub SYNAPTICS_CMD_SET_MODE () {0x14;}' unless defined(&SYNAPTICS_CMD_SET_MODE);
    eval 'sub SYNAPTICS_CMD_SEND_CLIENT () {0x28;}' unless defined(&SYNAPTICS_CMD_SEND_CLIENT);
    eval 'sub SYNAPTICS_CMD_SET_ADV_GESTURE_MODE () {0xc8;}' unless defined(&SYNAPTICS_CMD_SET_ADV_GESTURE_MODE);
    eval 'sub SYNAPTICS_ID_MODEL {
        my($id) = @_;
	    eval q(((($id) >> 4) & 0xf));
    }' unless defined(&SYNAPTICS_ID_MODEL);
    eval 'sub SYNAPTICS_ID_MINOR {
        my($id) = @_;
	    eval q(((($id) >> 16) & 0xff));
    }' unless defined(&SYNAPTICS_ID_MINOR);
    eval 'sub SYNAPTICS_ID_MAJOR {
        my($id) = @_;
	    eval q((($id) & 0xf));
    }' unless defined(&SYNAPTICS_ID_MAJOR);
    eval 'sub SYNAPTICS_ID_MAGIC () {0x47;}' unless defined(&SYNAPTICS_ID_MAGIC);
    eval 'sub SYNAPTICS_ABSOLUTE_MODE () {(1<< 7);}' unless defined(&SYNAPTICS_ABSOLUTE_MODE);
    eval 'sub SYNAPTICS_HIGH_RATE () {(1<< 6);}' unless defined(&SYNAPTICS_HIGH_RATE);
    eval 'sub SYNAPTICS_SLEEP_MODE () {(1<< 3);}' unless defined(&SYNAPTICS_SLEEP_MODE);
    eval 'sub SYNAPTICS_DISABLE_GESTURE () {(1<< 2);}' unless defined(&SYNAPTICS_DISABLE_GESTURE);
    eval 'sub SYNAPTICS_FOUR_BYTE_CLIENT () {(1<< 1);}' unless defined(&SYNAPTICS_FOUR_BYTE_CLIENT);
    eval 'sub SYNAPTICS_W_MODE () {(1<< 0);}' unless defined(&SYNAPTICS_W_MODE);
    eval 'sub SYNAPTICS_CAP_EXTENDED () {(1<< 23);}' unless defined(&SYNAPTICS_CAP_EXTENDED);
    eval 'sub SYNAPTICS_CAP_EXTENDED_QUERIES {
        my($c) = @_;
	    eval q(((($c) >> 20) & 0x7));
    }' unless defined(&SYNAPTICS_CAP_EXTENDED_QUERIES);
    eval 'sub SYNAPTICS_CAP_MIDDLE_BUTTON () {(1<< 18);}' unless defined(&SYNAPTICS_CAP_MIDDLE_BUTTON);
    eval 'sub SYNAPTICS_CAP_PASSTHROUGH () {(1<< 7);}' unless defined(&SYNAPTICS_CAP_PASSTHROUGH);
    eval 'sub SYNAPTICS_CAP_SLEEP () {(1<< 4);}' unless defined(&SYNAPTICS_CAP_SLEEP);
    eval 'sub SYNAPTICS_CAP_FOUR_BUTTON () {(1<< 3);}' unless defined(&SYNAPTICS_CAP_FOUR_BUTTON);
    eval 'sub SYNAPTICS_CAP_BALLISTICS () {(1<< 2);}' unless defined(&SYNAPTICS_CAP_BALLISTICS);
    eval 'sub SYNAPTICS_CAP_MULTIFINGER () {(1<< 1);}' unless defined(&SYNAPTICS_CAP_MULTIFINGER);
    eval 'sub SYNAPTICS_CAP_PALMDETECT () {(1<< 0);}' unless defined(&SYNAPTICS_CAP_PALMDETECT);
    eval 'sub SYNAPTICS_MODEL_ROT180 () {(1<< 23);}' unless defined(&SYNAPTICS_MODEL_ROT180);
    eval 'sub SYNAPTICS_MODEL_PORTRAIT () {(1<< 22);}' unless defined(&SYNAPTICS_MODEL_PORTRAIT);
    eval 'sub SYNAPTICS_MODEL_SENSOR {
        my($m) = @_;
	    eval q(((($m) >> 16) & 0x3f));
    }' unless defined(&SYNAPTICS_MODEL_SENSOR);
    eval 'sub SYNAPTICS_MODEL_HARDWARE {
        my($m) = @_;
	    eval q(((($m) >> 9) & 0x7f));
    }' unless defined(&SYNAPTICS_MODEL_HARDWARE);
    eval 'sub SYNAPTICS_MODEL_NEWABS () {(1<< 7);}' unless defined(&SYNAPTICS_MODEL_NEWABS);
    eval 'sub SYNAPTICS_MODEL_PEN () {(1<< 6);}' unless defined(&SYNAPTICS_MODEL_PEN);
    eval 'sub SYNAPTICS_MODEL_SIMPLC () {(1<< 5);}' unless defined(&SYNAPTICS_MODEL_SIMPLC);
    eval 'sub SYNAPTICS_MODEL_GEOMETRY {
        my($m) = @_;
	    eval q((($m) & 0xf));
    }' unless defined(&SYNAPTICS_MODEL_GEOMETRY);
    eval 'sub SYNAPTICS_RESOLUTION_X {
        my($r) = @_;
	    eval q(((($r) >> 16) & 0xff));
    }' unless defined(&SYNAPTICS_RESOLUTION_X);
    eval 'sub SYNAPTICS_RESOLUTION_Y {
        my($r) = @_;
	    eval q((($r) & 0xff));
    }' unless defined(&SYNAPTICS_RESOLUTION_Y);
    eval 'sub SYNAPTICS_EXT_MODEL_LIGHTCONTROL () {(1<< 22);}' unless defined(&SYNAPTICS_EXT_MODEL_LIGHTCONTROL);
    eval 'sub SYNAPTICS_EXT_MODEL_PEAKDETECT () {(1<< 21);}' unless defined(&SYNAPTICS_EXT_MODEL_PEAKDETECT);
    eval 'sub SYNAPTICS_EXT_MODEL_VWHEEL () {(1<< 19);}' unless defined(&SYNAPTICS_EXT_MODEL_VWHEEL);
    eval 'sub SYNAPTICS_EXT_MODEL_EW_MODE () {(1<< 18);}' unless defined(&SYNAPTICS_EXT_MODEL_EW_MODE);
    eval 'sub SYNAPTICS_EXT_MODEL_HSCROLL () {(1<< 17);}' unless defined(&SYNAPTICS_EXT_MODEL_HSCROLL);
    eval 'sub SYNAPTICS_EXT_MODEL_VSCROLL () {(1<< 16);}' unless defined(&SYNAPTICS_EXT_MODEL_VSCROLL);
    eval 'sub SYNAPTICS_EXT_MODEL_BUTTONS {
        my($em) = @_;
	    eval q((($em >> 12) & 0xf));
    }' unless defined(&SYNAPTICS_EXT_MODEL_BUTTONS);
    eval 'sub SYNAPTICS_EXT_MODEL_SENSOR {
        my($em) = @_;
	    eval q((($em >> 10) & 0x3));
    }' unless defined(&SYNAPTICS_EXT_MODEL_SENSOR);
    eval 'sub SYNAPTICS_EXT_MODEL_PRODUCT {
        my($em) = @_;
	    eval q((($em) & 0xff));
    }' unless defined(&SYNAPTICS_EXT_MODEL_PRODUCT);
    eval 'sub SYNAPTICS_EXT_CAP_CLICKPAD () {(1<< 20);}' unless defined(&SYNAPTICS_EXT_CAP_CLICKPAD);
    eval 'sub SYNAPTICS_EXT_CAP_ADV_GESTURE () {(1<< 19);}' unless defined(&SYNAPTICS_EXT_CAP_ADV_GESTURE);
    eval 'sub SYNAPTICS_EXT_CAP_MAX_DIMENSIONS () {(1<< 17);}' unless defined(&SYNAPTICS_EXT_CAP_MAX_DIMENSIONS);
    eval 'sub SYNAPTICS_EXT_CAP_CLICKPAD_2BTN () {(1<< 8);}' unless defined(&SYNAPTICS_EXT_CAP_CLICKPAD_2BTN);
    eval 'sub SYNAPTICS_DIM_X {
        my($d) = @_;
	    eval q((((($d) & 0xff0000) >> 11) | ((($d) & 0xf00) >> 7)));
    }' unless defined(&SYNAPTICS_DIM_X);
    eval 'sub SYNAPTICS_DIM_Y {
        my($d) = @_;
	    eval q((((($d) & 0xff) << 5) | ((($d) & 0xf000) >> 11)));
    }' unless defined(&SYNAPTICS_DIM_Y);
    eval 'sub SYNAPTICS_XMIN_BEZEL () {1472;}' unless defined(&SYNAPTICS_XMIN_BEZEL);
    eval 'sub SYNAPTICS_XMAX_BEZEL () {5472;}' unless defined(&SYNAPTICS_XMAX_BEZEL);
    eval 'sub SYNAPTICS_YMIN_BEZEL () {1408;}' unless defined(&SYNAPTICS_YMIN_BEZEL);
    eval 'sub SYNAPTICS_YMAX_BEZEL () {4448;}' unless defined(&SYNAPTICS_YMAX_BEZEL);
    eval 'sub ALPS_XMIN_BEZEL () {130;}' unless defined(&ALPS_XMIN_BEZEL);
    eval 'sub ALPS_XMAX_BEZEL () {840;}' unless defined(&ALPS_XMAX_BEZEL);
    eval 'sub ALPS_YMIN_BEZEL () {130;}' unless defined(&ALPS_YMIN_BEZEL);
    eval 'sub ALPS_YMAX_BEZEL () {640;}' unless defined(&ALPS_YMAX_BEZEL);
    eval 'sub ALPS_XSEC_BEZEL () {768;}' unless defined(&ALPS_XSEC_BEZEL);
    eval 'sub ALPS_YSEC_BEZEL () {512;}' unless defined(&ALPS_YSEC_BEZEL);
    eval 'sub ALPS_Z_MAGIC () {127;}' unless defined(&ALPS_Z_MAGIC);
}
1;
