Dear all, Why
I cannot read data form i #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> #include <linux/i #include <linux/input.h> #include <linux/delay.h> #include <linux/clk.h> #include <linux/gpio.h> #include <asm/io.h> #include
"../../../arch/arm/mach-mx51/crm_regs.h" #include
"../../../arch/arm/mach-mx51/iomux.h" #define ABC_I #define I #define ABC_DD_NAME "abc_dd" struct abc_dd_priv { struct i struct input_dev
*input; int irq; }; static irqreturn_t abc_event_handler(int irq, void
*dev_id){ int
i; u_int8_t
dd_data[10]={0}; struct
abc_dd_priv *priv = dev_id; memset(dd_data,
0, sizeof(dd_data)); i for(i=0;i<10;i++){ printk(KERN_INFO
"dd_data[%d]=%d\n",i,dd_data[i]); } return
IRQ_HANDLED; } /*
------------------------------------------------------------------------- */ static int abc_i struct
input_dev *abc_inputdev; struct
abc_dd_priv *priv; unsigned long tmp; int
retval; int res; priv
= kzalloc(sizeof(struct abc_dd_priv), GFP_KERNEL); if (!priv)
{
dev_err(&client->dev, "failed to allocate driver data\n");
return -ENOMEM; } i priv->client
= client; priv->irq
= client->irq; if(priv->irq){ tmp=readl(MXC_CCM_CWDR); writel(tmp|0x00000008,
MXC_CCM_CWDR); res=mxc_request_iomux(MX51_PIN_GPIO1_5,
IOMUX_CONFIG_ALT0); gpio_config(0,5,false,GPIO_INT_HIGH_LEV); gpio_request_irq(0,5,GPIO_LOW_PRIO,abc_event_handler,0,ABC_DD_NAME,priv); } abc_inputdev
= input_allocate_device(); if
(!abc_inputdev) { printk(KERN_ERR
"not enough memory for input device\n"); return
-ENOMEM; } priv->input
= abc_inputdev; input_set_drvdata(abc_inputdev,priv); abc_inputdev->name = ABC_DD_NAME; retval
= input_register_device(priv->input); if (retval < 0) { input_free_device(abc_inputdev); return
retval; } return
0; } static const struct i {
"abc_dd", 0 }, { } }; MODULE_DEVICE_TABLE(i static struct i .driver = {
.name = ABC_DD_NAME,
.owner =
THIS_MODULE,
}, .probe =
abc_i
.id_table = abc_dd_id, }; /* * module load/unload record keeping */ static int __init abc_dd_init(void) { printk(KERN_INFO
"Diver Initiating...\n"); return
i } static void __exit abc_dd_exit(void) { i } MODULE_AUTHOR("ABC International Inc."); MODULE_DESCRIPTION("DD driver"); MODULE_LICENSE("GPL"); module_init(abc_dd_init); module_exit(abc_dd_exit); |
_______________________________________________ lm-sensors mailing list lm-sensors@xxxxxxxxxxxxxx http://lists.lm-sensors.org/mailman/listinfo/lm-sensors