]> Devoid-pointer.net GitWeb - omnibook.git/commitdiff
* Remove unused macro
authorMathieu Bérard <mathieu.berard@crans.org>
Wed, 22 Nov 2006 16:57:46 +0000 (16:57 +0000)
committerMathieu Bérard <mathieu.berard@crans.org>
Wed, 22 Nov 2006 16:57:46 +0000 (16:57 +0000)
* debug printk in nbsmi hotkeys handling

ec.c
kbc.c
nbsmi.c
polling.c

diff --git a/ec.c b/ec.c
index 8f02283391e251101d18bd6b6e7429973593a127..714ce4ac0d98d1745fb2a36fd6b9e16fecae2a38 100644 (file)
--- a/ec.c
+++ b/ec.c
@@ -45,7 +45,7 @@ static DEFINE_SPINLOCK(omnibook_ec_lock);
 
 #define OMNIBOOK_EC_STAT_OBF           0x01    /* Output buffer full */
 #define OMNIBOOK_EC_STAT_IBF           0x02    /* Input buffer full */
-#define OMNIBOOK_EC_STAT_CMD           0x08    /* Last write was a command write (0=data) */
+
 
 /*
  * Embedded controller commands
@@ -53,7 +53,6 @@ static DEFINE_SPINLOCK(omnibook_ec_lock);
 
 #define OMNIBOOK_EC_CMD_READ           0x80
 #define OMNIBOOK_EC_CMD_WRITE          0x81
-#define OMNIBOOK_EC_CMD_QUERY          0x84
 
 /*
  * Wait for embedded controller buffer
diff --git a/kbc.c b/kbc.c
index 5a7ff711e9cbc11d4983077fd1e9e11f48800251..5634b40565c3d00f6008ddb21f1c8296ef0d785e 100644 (file)
--- a/kbc.c
+++ b/kbc.c
@@ -42,7 +42,7 @@ extern int omnibook_key_polling_disable(void);
 
 #define OMNIBOOK_KBC_STAT_OBF          0x01    /* Output buffer full */
 #define OMNIBOOK_KBC_STAT_IBF          0x02    /* Input buffer full */
-#define OMNIBOOK_KBC_STAT_CMD          0x08    /* Last write was a command write (0=data) */
+
 
 /*
  * Interrupt control
diff --git a/nbsmi.c b/nbsmi.c
index c0c47be51af12a46ced61275c8e941b0ac2f1e6e..c144dc5795e55cc8cb3a2cd427a7307614e5e250 100644 (file)
--- a/nbsmi.c
+++ b/nbsmi.c
@@ -36,8 +36,6 @@
 /*
  * ATI's IXP PCI-LPC bridge
  */
-#define PCI_DEVICE_ID_ATI_SB400 0x4377
-
 #define INTEL_PMBASE   0x40
 #define INTEL_GPE0_EN  0x2c
 
@@ -178,10 +176,11 @@ static inline u32 intel_do_smi_call(u16 function, struct pci_dev *lpc_bridge)
 static int nbsmi_smi_command(u16 function, 
                             const u8 * inputbuffer,
                             u8 * outputbuffer,
-                            struct nbsmi_backend_data *priv_data)
+                            const struct nbsmi_backend_data *priv_data)
 {
        int count;
        u32 retval = 0;
+       
 
        for (count = 0; count < BUFFER_SIZE; count++) {
                outb(count + priv_data->start_offset, RTC_PORT(2));
@@ -466,8 +465,7 @@ static int register_input_subsystem(struct nbsmi_backend_data *priv_data)
        hook_handler.private = priv_data;
 
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18))
-       retval = input_register_handler(&hook_handler);
-       
+       retval = input_register_handler(&hook_handler); 
 #else
        input_register_handler(&hook_handler);
 #endif
@@ -785,7 +783,8 @@ static int omnibook_nbmsi_hotkeys_set(const struct omnibook_operation *io_op, un
 {
        int i, retval;
        u8 data, rdata;
-       struct omnibook_operation hotkeys_op = SIMPLE_BYTE(SMI, SMI_SET_FN_F5_INTERFACE, 0);
+       struct omnibook_operation hotkeys_op = SIMPLE_BYTE(SMI, SMI_SET_FN_F5_INTERFACE, 0);    
+       u8* data_array;
 
        data = !!(state & HKEY_FNF5);
 
@@ -810,21 +809,32 @@ static int omnibook_nbmsi_hotkeys_set(const struct omnibook_operation *io_op, un
         * required. The criteria here is simple: retry until probed state match
         * the requested one (with timeout).
         */
+
+       data_array = kcalloc(250, sizeof(u8), GFP_KERNEL);
+       if(!data_array)
+               return -ENODEV;
+
        for (i = 0; i < 250; i++) {
                retval = nbsmi_smi_write_command(&hotkeys_op, data);
                if (retval)
-                       return retval;
+                       goto out;
                mdelay(1);
                retval = nbsmi_smi_read_command(&hotkeys_op, &rdata);
                if(retval)
-                       return retval;
+                       goto out;
                if(rdata == data) {
                        dprintk("check loop ok after %i iters\n.",i);
-                       return 0;
+                       retval = 0;
+                       goto out;
                }
        }
        dprintk("error or check loop timeout !!\n");
-
+       dprintk("forensics datas: ");
+       for (i = 0; i < 250; i++)
+               dprintk_simple("%x ", data_array[i]);
+       dprintk_simple("\n");
+out:
+       kfree(data_array);
        return retval;
 }
 
index 78b10b3cada8153509a2867ab96453606649be78..3265bb9f8c2cecb47f32103fc5fb6e51d99597bc 100644 (file)
--- a/polling.c
+++ b/polling.c
 #include "hardware.h"
 #include <linux/workqueue.h>
 
-/* Predefined convinient on/off states */
-#define HKEY_ON  HKEY_ONETOUCH|HKEY_MULTIMEDIA|HKEY_FN|HKEY_DOCK|HKEY_FNF5|HKEY_VOL
-#define HKEY_OFF 0
-
 /*
  * XE3GC type key_polling polling:
  *