implemented infrared_sensor-driver
This commit is contained in:
@@ -37,7 +37,7 @@ static int infrared_sensor_open(struct inode *devfile, struct file *instance)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD:project/module/infrared_sensor/infrared_sensor_in_2.c
|
|
||||||
static ssize_t infrared_sensor_read( struct file *file, char __user *buffer, size_t length, loff_t *offset)
|
static ssize_t infrared_sensor_read( struct file *file, char __user *buffer, size_t length, loff_t *offset)
|
||||||
{
|
{
|
||||||
unsigned long not_copied;
|
unsigned long not_copied;
|
||||||
@@ -57,18 +57,6 @@ static ssize_t infrared_sensor_read( struct file *file, char __user *buffer, siz
|
|||||||
*offset += count - not_copied;
|
*offset += count - not_copied;
|
||||||
|
|
||||||
return count - not_copied;
|
return count - not_copied;
|
||||||
=======
|
|
||||||
static ssize_t infrared_sensor_read( struct file *instance, char __user *user,
|
|
||||||
size_t max_bytes_to_read, loff_t *offset)
|
|
||||||
{
|
|
||||||
unsigned long not_copied, to_copy;
|
|
||||||
u32 value = gpio_get_value;
|
|
||||||
|
|
||||||
to_copy = min( max_bytes_to_read, sizeof(value) );
|
|
||||||
not_copied=copy_to_user( user, &value, to_copy);
|
|
||||||
|
|
||||||
return to_copy - not_copied;
|
|
||||||
>>>>>>> 8ad08b638d0490724f49b13692420465d9c65658:project/modules/infrared_sensor_in_2/infrared_sensor_in_2.c
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int infrared_sensor_close( struct inode *devfile, struct file *instance)
|
static int infrared_sensor_close( struct inode *devfile, struct file *instance)
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ static int infrared_sensor_open(struct inode *devfile, struct file *instance)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD:project/module/infrared_sensor/infrared_sensor_in_3.c
|
|
||||||
static ssize_t infrared_sensor_read( struct file *file, char __user *buffer, size_t length, loff_t *offset)
|
static ssize_t infrared_sensor_read( struct file *file, char __user *buffer, size_t length, loff_t *offset)
|
||||||
{
|
{
|
||||||
unsigned long not_copied;
|
unsigned long not_copied;
|
||||||
@@ -57,18 +57,6 @@ static ssize_t infrared_sensor_read( struct file *file, char __user *buffer, siz
|
|||||||
*offset += count - not_copied;
|
*offset += count - not_copied;
|
||||||
|
|
||||||
return count - not_copied;
|
return count - not_copied;
|
||||||
=======
|
|
||||||
static ssize_t infrared_sensor_read( struct file *instance, char __user *user,
|
|
||||||
size_t max_bytes_to_read, loff_t *offset)
|
|
||||||
{
|
|
||||||
unsigned long not_copied, to_copy;
|
|
||||||
u32 value = gpio_get_value;
|
|
||||||
|
|
||||||
to_copy = min( max_bytes_to_read, sizeof(value) );
|
|
||||||
not_copied=copy_to_user( user, &value, to_copy);
|
|
||||||
|
|
||||||
return to_copy - not_copied;
|
|
||||||
>>>>>>> 8ad08b638d0490724f49b13692420465d9c65658:project/modules/infrared_sensor_in_3/infrared_sensor_in_3.c
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int infrared_sensor_close( struct inode *devfile, struct file *instance)
|
static int infrared_sensor_close( struct inode *devfile, struct file *instance)
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ static int infrared_sensor_open(struct inode *devfile, struct file *instance)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD:project/module/infrared_sensor/infrared_sensor_in_4.c
|
|
||||||
static ssize_t infrared_sensor_read( struct file *file, char __user *buffer, size_t length, loff_t *offset)
|
static ssize_t infrared_sensor_read( struct file *file, char __user *buffer, size_t length, loff_t *offset)
|
||||||
{
|
{
|
||||||
unsigned long not_copied;
|
unsigned long not_copied;
|
||||||
@@ -57,18 +56,6 @@ static ssize_t infrared_sensor_read( struct file *file, char __user *buffer, siz
|
|||||||
*offset += count - not_copied;
|
*offset += count - not_copied;
|
||||||
|
|
||||||
return count - not_copied;
|
return count - not_copied;
|
||||||
=======
|
|
||||||
static ssize_t infrared_sensor_read( struct file *instance, char __user *user,
|
|
||||||
size_t max_bytes_to_read, loff_t *offset)
|
|
||||||
{
|
|
||||||
unsigned long not_copied, to_copy;
|
|
||||||
u32 value = gpio_get_value;
|
|
||||||
|
|
||||||
to_copy = min( max_bytes_to_read, sizeof(value) );
|
|
||||||
not_copied=copy_to_user( user, &value, to_copy);
|
|
||||||
|
|
||||||
return to_copy - not_copied;
|
|
||||||
>>>>>>> 8ad08b638d0490724f49b13692420465d9c65658:project/modules/infrared_sensor_in_4/infrared_sensor_in_4.c
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int infrared_sensor_close( struct inode *devfile, struct file *instance)
|
static int infrared_sensor_close( struct inode *devfile, struct file *instance)
|
||||||
|
|||||||
Reference in New Issue
Block a user