implemented infrared_sensor-driver

This commit is contained in:
Siegfried Kienzle
2017-06-14 08:10:56 +02:00
parent 1b80f5b89e
commit c92e91d760
3 changed files with 2 additions and 39 deletions

View File

@@ -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)
{
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;
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)