Input: sentelic - fix retrieving number of buttons
[pandora-kernel.git] / drivers / input / mouse / sentelic.c
index 2fc887a..86d6f39 100644 (file)
@@ -2,7 +2,7 @@
  * Finger Sensing Pad PS/2 mouse driver.
  *
  * Copyright (C) 2005-2007 Asia Vital Components Co., Ltd.
- * Copyright (C) 2005-2010 Tai-hwa Liang, Sentelic Corporation.
+ * Copyright (C) 2005-2011 Tai-hwa Liang, Sentelic Corporation.
  *
  *   This program is free software; you can redistribute it and/or
  *   modify it under the terms of the GNU General Public License
@@ -162,7 +162,7 @@ static int fsp_reg_write(struct psmouse *psmouse, int reg_addr, int reg_val)
        ps2_sendbyte(ps2dev, v, FSP_CMD_TIMEOUT2);
 
        if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0)
-               return -1;
+               goto out;
 
        if ((v = fsp_test_invert_cmd(reg_val)) != reg_val) {
                /* inversion is required */
@@ -261,7 +261,7 @@ static int fsp_page_reg_write(struct psmouse *psmouse, int reg_val)
        ps2_sendbyte(ps2dev, 0x88, FSP_CMD_TIMEOUT2);
 
        if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0)
-               return -1;
+               goto out;
 
        if ((v = fsp_test_invert_cmd(reg_val)) != reg_val) {
                ps2_sendbyte(ps2dev, 0x47, FSP_CMD_TIMEOUT2);
@@ -309,7 +309,7 @@ static int fsp_get_buttons(struct psmouse *psmouse, int *btn)
        };
        int val;
 
-       if (fsp_reg_read(psmouse, FSP_REG_TMOD_STATUS1, &val) == -1)
+       if (fsp_reg_read(psmouse, FSP_REG_TMOD_STATUS, &val) == -1)
                return -EIO;
 
        *btn = buttons[(val & 0x30) >> 4];
@@ -607,11 +607,12 @@ static void fsp_packet_debug(unsigned char packet[])
 
        ps2_packet_cnt++;
        jiffies_msec = jiffies_to_msecs(jiffies);
-       printk(KERN_DEBUG "%08dms PS/2 packets: %02x, %02x, %02x, %02x\n",
-               jiffies_msec, packet[0], packet[1], packet[2], packet[3]);
+       psmouse_dbg(psmouse,
+                   "%08dms PS/2 packets: %02x, %02x, %02x, %02x\n",
+                   jiffies_msec, packet[0], packet[1], packet[2], packet[3]);
 
        if (jiffies_msec - ps2_last_second > 1000) {
-               printk(KERN_DEBUG "PS/2 packets/sec = %d\n", ps2_packet_cnt);
+               psmouse_dbg(psmouse, "PS/2 packets/sec = %d\n", ps2_packet_cnt);
                ps2_packet_cnt = 0;
                ps2_last_second = jiffies_msec;
        }
@@ -820,9 +821,9 @@ int fsp_init(struct psmouse *psmouse)
                return -ENODEV;
        }
 
-       printk(KERN_INFO
-               "Finger Sensing Pad, hw: %d.%d.%d, sw: %s, buttons: %d\n",
-               ver >> 4, ver & 0x0F, rev, fsp_drv_ver, buttons & 7);
+       psmouse_info(psmouse,
+                    "Finger Sensing Pad, hw: %d.%d.%d, sw: %s, buttons: %d\n",
+                    ver >> 4, ver & 0x0F, rev, fsp_drv_ver, buttons & 7);
 
        psmouse->private = priv = kzalloc(sizeof(struct fsp_data), GFP_KERNEL);
        if (!priv)