43. #define GPNCONS3C64XX_GPNCON
44. #define GPNDATS3C64XX_GPNDAT
45. #define GPNPUDS3C64XX_GPNPUD
46. #define GPMCON S3C64XX_GPMCON
47. #define GPMDATS3C64XX_GPMDAT
48. #define GPMPUD S3C64XX_GPMPUD
49.
50. #define VIB_ON 0x11
51. #defineVIB_OFF 0x22
52. static const struct file_operations GPIO_Viberator_ctl_ops={
53. .owner= THIS_MODULE,
54. .open= GPIO_VIB_open,
55. .read=GPIO_VIB_read,
56. .write=GPIO_VIB_write,
57. .ioctl = GPIO_VIB_ioctl,
58. .release =GPIO_VIB_release,
59. };
60. ssize_t GPIO_VIB_read(struct file * file,char * buf,size_t count,loff_t *
f_ops)
61. {
62. printk(" GPIO_VIB_read \r\n");
63. gpio_direction_output(S3C64XX_GPM(3), 0);//
64. return count ;
65. }
66. ssize_t GPIO_VIB_write (struct file * file,const char * buf, size_t
count,loff_t * f_ops)
67. {
68. printk(" GPIO_VIB_write \r\n");
69. gpio_direction_output(S3C64XX_GPM(3), 1);//
70. return count;
71. }
72.
73. //ssize_t GPIO_VIB_ioctl(struct inode *inode,struct file * file,unsigned
int cmd, long data)
74. static int GPIO_VIB_ioctl(struct inode *inode, struct file *file, unsigned
int cmd, unsigned long arg)
75. {
76. printk(KERN_ERR"VIB:GPIO_VIB_ioctl --CMD=%x \n",cmd);
77. switch(cmd)
78. {
79. case VIB_ON:
80. gpio_direction_output(S3C64XX_GPM(1), 0);//
81. gpio_direction_output(S3C64XX_GPM(2), 0);//
82. gpio_direction_output(S3C64XX_GPM(3), 0);//