Lines Matching +full:0 +full:xf3

27 #define	GET_ABS_X(packet)	((packet[1] << 2) | ((packet[3] >> 2) & 0x03))
28 #define GET_ABS_Y(packet) ((packet[2] << 2) | (packet[3] & 0x03))
31 static const char fsp_drv_ver[] = "1.1.0-K";
59 case 0xe9: case 0xee: case 0xf2: case 0xff: in fsp_test_invert_cmd()
88 if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0) in fsp_reg_read()
91 /* should return 0xfe(request for resending) */ in fsp_reg_read()
92 ps2_sendbyte(ps2dev, 0x66, FSP_CMD_TIMEOUT2); in fsp_reg_read()
93 /* should return 0xfc(failed) */ in fsp_reg_read()
94 ps2_sendbyte(ps2dev, 0x88, FSP_CMD_TIMEOUT2); in fsp_reg_read()
96 if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0) in fsp_reg_read()
100 ps2_sendbyte(ps2dev, 0x68, FSP_CMD_TIMEOUT2); in fsp_reg_read()
103 ps2_sendbyte(ps2dev, 0xcc, FSP_CMD_TIMEOUT2); in fsp_reg_read()
104 /* expect 0xfe */ in fsp_reg_read()
107 ps2_sendbyte(ps2dev, 0x66, FSP_CMD_TIMEOUT2); in fsp_reg_read()
108 /* expect 0xfe */ in fsp_reg_read()
110 /* should return 0xfc(failed) */ in fsp_reg_read()
113 if (__ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO) < 0) in fsp_reg_read()
117 rc = 0; in fsp_reg_read()
123 "READ REG: 0x%02x is 0x%02x (rc = %d)\n", in fsp_reg_read()
136 if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0) in fsp_reg_write()
141 ps2_sendbyte(ps2dev, 0x74, FSP_CMD_TIMEOUT2); in fsp_reg_write()
145 ps2_sendbyte(ps2dev, 0x77, FSP_CMD_TIMEOUT2); in fsp_reg_write()
148 ps2_sendbyte(ps2dev, 0x55, FSP_CMD_TIMEOUT2); in fsp_reg_write()
154 if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0) in fsp_reg_write()
159 ps2_sendbyte(ps2dev, 0x47, FSP_CMD_TIMEOUT2); in fsp_reg_write()
162 ps2_sendbyte(ps2dev, 0x44, FSP_CMD_TIMEOUT2); in fsp_reg_write()
165 ps2_sendbyte(ps2dev, 0x33, FSP_CMD_TIMEOUT2); in fsp_reg_write()
170 rc = 0; in fsp_reg_write()
175 "WRITE REG: 0x%02x to 0x%02x (rc = %d)\n", in fsp_reg_write()
198 return 0; in fsp_reg_write_enable()
211 if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0) in fsp_page_reg_read()
214 ps2_sendbyte(ps2dev, 0x66, FSP_CMD_TIMEOUT2); in fsp_page_reg_read()
215 ps2_sendbyte(ps2dev, 0x88, FSP_CMD_TIMEOUT2); in fsp_page_reg_read()
217 if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0) in fsp_page_reg_read()
220 ps2_sendbyte(ps2dev, 0x83, FSP_CMD_TIMEOUT2); in fsp_page_reg_read()
221 ps2_sendbyte(ps2dev, 0x88, FSP_CMD_TIMEOUT2); in fsp_page_reg_read()
228 rc = 0; in fsp_page_reg_read()
234 "READ PAGE REG: 0x%02x (rc = %d)\n", in fsp_page_reg_read()
247 if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0) in fsp_page_reg_write()
250 ps2_sendbyte(ps2dev, 0x38, FSP_CMD_TIMEOUT2); in fsp_page_reg_write()
251 ps2_sendbyte(ps2dev, 0x88, FSP_CMD_TIMEOUT2); in fsp_page_reg_write()
253 if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0) in fsp_page_reg_write()
257 ps2_sendbyte(ps2dev, 0x47, FSP_CMD_TIMEOUT2); in fsp_page_reg_write()
260 ps2_sendbyte(ps2dev, 0x44, FSP_CMD_TIMEOUT2); in fsp_page_reg_write()
263 ps2_sendbyte(ps2dev, 0x33, FSP_CMD_TIMEOUT2); in fsp_page_reg_write()
267 rc = 0; in fsp_page_reg_write()
272 "WRITE PAGE REG: to 0x%02x (rc = %d)\n", in fsp_page_reg_write()
282 return 0; in fsp_get_version()
290 return 0; in fsp_get_revision()
298 /* production number since Cx is available at: 0x0b40 ~ 0x0b42 */ in fsp_get_sn()
308 rc = 0; in fsp_get_sn()
317 0x16, /* Left/Middle/Right/Forward/Backward & Scroll Up/Down */ in fsp_get_buttons()
318 0x06, /* Left/Middle/Right & Scroll Up/Down/Right/Left */ in fsp_get_buttons()
319 0x04, /* Left/Middle/Right & Scroll Up/Down */ in fsp_get_buttons()
320 0x02, /* Left/Middle/Right */ in fsp_get_buttons()
327 *btn = buttons[(val & 0x30) >> 4]; in fsp_get_buttons()
328 return 0; in fsp_get_buttons()
335 int res = 0; in fsp_opc_tag_enable()
354 if (res != 0) { in fsp_opc_tag_enable()
380 return 0; in fsp_onpad_vscr()
411 return 0; in fsp_onpad_hscr()
417 * ex: 0xab 0xcd - write oxcd into register 0xab
427 if (rest == buf || *rest != ' ' || reg > 0xff) in fsp_attr_set_setreg()
434 if (val > 0xff) in fsp_attr_set_setreg()
440 retval = fsp_reg_write(psmouse, reg, val) < 0 ? -EIO : count; in fsp_attr_set_setreg()
460 * ex: 0xab -- read content from register 0xab
473 if (reg > 0xff) in fsp_attr_set_getreg()
491 int val = 0; in fsp_attr_show_pagereg()
509 if (val > 0xff) in fsp_attr_set_pagereg()
594 for (i = 0; i < count; i++) { in fsp_attr_set_flags()
642 unsigned short abs_x = 0, abs_y = 0; in fsp_packet_debug()
645 switch (packet[0] >> FSP_PKT_TYPE_SHIFT) { in fsp_packet_debug()
668 packet[0], packet[1], packet[2], packet[3], abs_x, abs_y); in fsp_packet_debug()
672 ps2_packet_cnt = 0; in fsp_packet_debug()
698 unsigned char button_status = 0, lscroll = 0, rscroll = 0; in fsp_process_byte()
699 unsigned short abs_x, abs_y, fgrs = 0; in fsp_process_byte()
710 switch (psmouse->packet[0] >> FSP_PKT_TYPE_SHIFT) { in fsp_process_byte()
713 if ((packet[0] == 0x48 || packet[0] == 0x49) && in fsp_process_byte()
714 packet[1] == 0 && packet[2] == 0) { in fsp_process_byte()
720 packet[3] &= 0xf0; in fsp_process_byte()
726 if (packet[0] & FSP_PB0_MFMC) { in fsp_process_byte()
734 if (packet[0] & FSP_PB0_MFMC_FGR2) { in fsp_process_byte()
743 fsp_set_slot(dev, 0, false, 0, 0); in fsp_process_byte()
757 fsp_set_slot(dev, 1, false, 0, 0); in fsp_process_byte()
760 fsp_set_slot(dev, 0, fgrs != 0, abs_x, abs_y); in fsp_process_byte()
764 if ((packet[0] & (FSP_PB0_LBTN|FSP_PB0_PHY_BTN)) == in fsp_process_byte()
770 packet[0] &= ~FSP_PB0_LBTN; in fsp_process_byte()
774 ad->last_mt_fgr = 0; in fsp_process_byte()
776 if (abs_x != 0 && abs_y != 0) in fsp_process_byte()
779 fsp_set_slot(dev, 0, fgrs > 0, abs_x, abs_y); in fsp_process_byte()
780 fsp_set_slot(dev, 1, false, 0, 0); in fsp_process_byte()
782 if (fgrs == 1 || (fgrs == 2 && !(packet[0] & FSP_PB0_MFMC_FGR2))) { in fsp_process_byte()
786 input_report_key(dev, BTN_LEFT, packet[0] & 0x01); in fsp_process_byte()
787 input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); in fsp_process_byte()
796 packet[0] &= ~FSP_PB0_LBTN; in fsp_process_byte()
802 if (packet[3] != 0) { in fsp_process_byte()
803 if (packet[3] & BIT(0)) in fsp_process_byte()
804 button_status |= 0x01; /* wheel down */ in fsp_process_byte()
806 button_status |= 0x0f; /* wheel up */ in fsp_process_byte()
812 if (button_status != 0) in fsp_process_byte()
849 param[0] = 200; in fsp_activate_protocol()
851 param[0] = 200; in fsp_activate_protocol()
853 param[0] = 80; in fsp_activate_protocol()
857 if (param[0] != 0x04) { in fsp_activate_protocol()
880 if (pad->buttons == 0x06) { in fsp_activate_protocol()
917 return 0; in fsp_activate_protocol()
952 input_set_abs_params(dev, ABS_X, 0, abs_x, 0, 0); in fsp_set_input_params()
953 input_set_abs_params(dev, ABS_Y, 0, abs_y, 0, 0); in fsp_set_input_params()
954 input_mt_init_slots(dev, 2, 0); in fsp_set_input_params()
955 input_set_abs_params(dev, ABS_MT_POSITION_X, 0, abs_x, 0, 0); in fsp_set_input_params()
956 input_set_abs_params(dev, ABS_MT_POSITION_Y, 0, abs_y, 0, 0); in fsp_set_input_params()
959 return 0; in fsp_set_input_params()
969 if (id != 0x01) in fsp_detect()
977 return 0; in fsp_detect()
1000 if (fsp_detect(psmouse, 0)) in fsp_reconnect()
1009 return 0; in fsp_reconnect()
1015 int ver, rev, sn = 0; in fsp_init()
1029 ver >> 4, ver & 0x0F, rev, sn, fsp_drv_ver); in fsp_init()
1061 return 0; in fsp_init()