diff --git a/microdia-sysfs.c b/microdia-sysfs.c
index b7c30e3..66f6dac 100644
--- a/microdia-sysfs.c
+++ b/microdia-sysfs.c
@@ -39,6 +39,7 @@
 
 #include "microdia.h"
 #include "sn9c20x.h"
+#include "mt9vx11.h"
 
 
 extern const struct microdia_coord microdia_image_sizes[MICRODIA_NBR_SIZES];
@@ -942,6 +943,200 @@ static ssize_t show_i2c_slave_adr(struct device *class, struct device_attribute
 	return sprintf(buf, "0x%x\n", dev->vsettings.i2cslave);
 }
 
+/** 
+ * @brief show_autotuning
+ *
+ * @param class Class device
+ *
+ * @retval buf Adress of buffer with the 'vflip' value
+ * 
+ * @returns Size of buffer
+ */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+static ssize_t show_autotuning(struct class_device *class, char *buf)
+#else
+	static ssize_t show_autotuning(struct device *class, struct device_attribute *attr, char *buf)
+#endif
+{
+    struct video_device *vdev = to_video_device(class);
+    struct usb_microdia *dev = video_get_drvdata(vdev);
+    
+    if((dev->sensor_slave_address == MT9V111_I2C_SLAVE_ADDRESS)&& (dev->webcam_model == MICRODIA_6270))
+    {
+	if(mt9v111_read_IFP_reg6(dev)!=0)
+	    return sprintf(buf, "%x\n",1);
+	return sprintf(buf, "%x\n",0);
+    }
+    return -EINVAL;
+}
+
+
+/** 
+ * @brief store_autotuning
+ *
+ * @param class Class device
+ * @param buf Buffer
+ * @param count Counter
+ *
+ * @returns Size of buffer
+ */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+static ssize_t store_autotuning(struct class_device *class, const char *buf, size_t count)
+#else
+	static ssize_t store_autotuning(struct device *class, struct device_attribute *attr, const char *buf, size_t count)
+#endif
+{
+    struct video_device *vdev = to_video_device(class);
+    struct usb_microdia *dev = video_get_drvdata(vdev);
+
+    if((dev->sensor_slave_address == MT9V111_I2C_SLAVE_ADDRESS)&& (dev->webcam_model == MICRODIA_6270))
+    {
+        if (strncmp(buf, "1", 1) == 0)
+        {
+	    mt9v111_auto_exposure(dev, ENABLE);
+	    mt9v111_auto_corections_on_fly(dev,ENABLE);
+	    mt9v111_auto_color_correction(dev,ENABLE);
+	    mt9v111_auto_white_balance_correction(dev, ENABLE);
+	    mt9v111_auto_measurement_area(dev,BOTH_WINDOW);
+	    mt9v111_auto_aperture_correction(dev, DISABLE);
+	    
+        }
+        else if (strncmp(buf, "0", 1) == 0)
+        {
+	    mt9v111_auto_exposure(dev, DISABLE);
+	    mt9v111_auto_corections_on_fly(dev,DISABLE);
+	    mt9v111_auto_color_correction(dev,DISABLE);
+	    mt9v111_auto_white_balance_correction(dev, DISABLE);
+	    mt9v111_auto_measurement_area(dev,LARGE_WINDOW);
+        }
+        else
+	   return -EINVAL;
+    }
+
+    
+
+    return strlen(buf);
+}
+
+
+/** 
+ * @brief show_autoreg
+ *
+ * @param class Class device
+ *
+ * @retval buf Adress of buffer with the 'vflip' value
+ * 
+ * @returns Size of buffer
+ */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+static ssize_t show_autoreg(struct class_device *class, char *buf)
+#else
+	static ssize_t show_autoreg(struct device *class, struct device_attribute *attr, char *buf)
+#endif
+{
+    struct video_device *vdev = to_video_device(class);
+    struct usb_microdia *dev = video_get_drvdata(vdev);
+    
+    if((dev->sensor_slave_address == MT9V111_I2C_SLAVE_ADDRESS)&& (dev->webcam_model == MICRODIA_6270))
+    {
+	
+	    return sprintf(buf, "0x%x\n",mt9v111_read_IFP_reg6(dev));
+	
+    }
+    return -EINVAL;
+}
+
+
+/** 
+ * @brief store_autoreg
+ *
+ * @param class Class device
+ * @param buf Buffer
+ * @param count Counter
+ *
+ * @returns Size of buffer
+ */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+static ssize_t store_autoreg(struct class_device *class, const char *buf, size_t count)
+#else
+	static ssize_t store_autoreg(struct device *class, struct device_attribute *attr, const char *buf, size_t count)
+#endif
+{
+    char *endp;
+    unsigned long value;
+    
+    struct video_device *vdev = to_video_device(class);
+    struct usb_microdia *dev = video_get_drvdata(vdev);
+    
+    value = simple_strtoul(buf, &endp, 16);
+    
+    if((dev->sensor_slave_address == MT9V111_I2C_SLAVE_ADDRESS)&& (dev->webcam_model == MICRODIA_6270))
+    {
+	if((value&0x0001)==0)
+	{
+	    mt9v111_auto_exposure(dev, DISABLE);
+	}else
+	{
+	    mt9v111_auto_exposure(dev, ENABLE);
+	}
+	
+	if((value&0x0002)==0)
+	{
+	    mt9v111_auto_corections_on_fly(dev,DISABLE);
+	}else
+	{
+	    mt9v111_auto_corections_on_fly(dev,ENABLE);
+	}
+	
+	if((value&0x0004)==0)
+	{
+	    mt9v111_auto_color_correction(dev,DISABLE);
+	}else
+	{
+	    mt9v111_auto_color_correction(dev,ENABLE);
+	}
+	
+	if((value&0x0008)==0)
+	{
+	    mt9v111_auto_white_balance_correction(dev, DISABLE);
+	}else
+	{
+	    mt9v111_auto_white_balance_correction(dev, ENABLE);
+	}
+	
+	if((value&0x0010)==0)
+	{
+	    mt9v111_auto_measurement_area(dev,BOTH_WINDOW);
+	}
+	
+	if((value&0x0020)==0)
+	{
+	    mt9v111_auto_measurement_area(dev,CENTRAL_WINDOW);
+	}
+	
+	if((value&0x0040)==0)
+	{
+	    mt9v111_auto_measurement_area(dev,LARGE_WINDOW);
+	}
+	
+	if((value&0x0080)==0)
+	{
+	    mt9v111_auto_aperture_correction(dev, DISABLE);
+	}else
+	{
+	    mt9v111_auto_aperture_correction(dev, ENABLE);
+	}
+	 
+	return strlen(buf);
+    }
+
+    return -EINVAL;
+
+    return strlen(buf);
+}
+
+
+
 
 
 
@@ -963,6 +1158,8 @@ static CLASS_DEVICE_ATTR(reg, S_IRUGO | S_IWUGO, show_register, store_register);
 static CLASS_DEVICE_ATTR(i2cadr, S_IRUGO | S_IWUGO, show_i2cadr, store_i2cadr);				/**< I2C Register adress */
 static CLASS_DEVICE_ATTR(i2creg, S_IRUGO | S_IWUGO, show_i2creg, store_i2creg);				/**< I2C Register value */
 static CLASS_DEVICE_ATTR(i2cslave, S_IRUGO | S_IWUGO, show_i2c_slave_adr, store_i2c_slave_adr);				/**< I2C Slave adress */
+static CLASS_DEVICE_ATTR(autotuning, S_IRUGO | S_IWUGO, show_autotuning, store_autotuning);						/**< Set autotuning */
+static CLASS_DEVICE_ATTR(autoreg, S_IRUGO | S_IWUGO, show_autoreg, store_autoreg);						/**< Set auto register for sensor with IFP */
 #else
 static DEVICE_ATTR(release, S_IRUGO, show_release, NULL);											/**< Release value */
 static DEVICE_ATTR(videostatus, S_IRUGO, show_videostatus, NULL);									/**< Video status */
@@ -981,6 +1178,8 @@ static DEVICE_ATTR(reg, S_IRUGO | S_IWUGO, show_register, store_register);
 static DEVICE_ATTR(i2cadr, S_IRUGO | S_IWUGO, show_i2cadr, store_i2cadr);						/**< I2C Register adress */
 static DEVICE_ATTR(i2creg, S_IRUGO | S_IWUGO, show_i2creg, store_i2creg);						/**< I2C Register value */
 static DEVICE_ATTR(i2cslave, S_IRUGO | S_IWUGO, show_i2c_slave_adr, store_i2c_slave_adr);						/**< I2C Slave adress */
+static DEVICE_ATTR(autotuning, S_IRUGO | S_IWUGO, show_autotuning, store_autotuning);						/**< Set autotuning */
+static DEVICE_ATTR(autoreg, S_IRUGO | S_IWUGO, show_autoreg, store_autoreg);						/**< Set auto register for sensor with IFP */
 #endif
 
 
@@ -1015,6 +1214,8 @@ int microdia_create_sysfs_files(struct video_device *vdev)
 	ret = video_device_create_file(vdev, &class_device_attr_i2creg);
 	ret = video_device_create_file(vdev, &class_device_attr_i2cadr);
 	ret = video_device_create_file(vdev, &class_device_attr_i2cslave);
+	ret = video_device_create_file(vdev, &class_device_attr_autotuning);
+	ret = video_device_create_file(vdev, &class_device_attr_autoreg);
 #else
 	ret = video_device_create_file(vdev, &dev_attr_release);
 	ret = video_device_create_file(vdev, &dev_attr_videostatus);
@@ -1033,6 +1234,8 @@ int microdia_create_sysfs_files(struct video_device *vdev)
 	ret = video_device_create_file(vdev, &dev_attr_i2creg);
 	ret = video_device_create_file(vdev, &dev_attr_i2cadr);
 	ret = video_device_create_file(vdev, &dev_attr_i2cslave);
+	ret = video_device_create_file(vdev, &dev_attr_autotuning);
+	ret = video_device_create_file(vdev, &dev_attr_autoreg);
 #endif
 	return ret;
 }
@@ -1067,6 +1270,8 @@ void microdia_remove_sysfs_files(struct video_device *vdev)
 	video_device_remove_file(vdev, &class_device_attr_i2creg);
 	video_device_remove_file(vdev, &class_device_attr_i2cadr);
 	video_device_remove_file(vdev, &class_device_attr_i2cslave);
+	video_device_remove_file(vdev, &class_device_attr_autotuning);
+	video_device_remove_file(vdev, &class_device_attr_autoreg);
 #else
 	video_device_remove_file(vdev, &dev_attr_release);
 	video_device_remove_file(vdev, &dev_attr_videostatus);
@@ -1085,6 +1290,8 @@ void microdia_remove_sysfs_files(struct video_device *vdev)
 	video_device_remove_file(vdev, &dev_attr_i2creg);
 	video_device_remove_file(vdev, &dev_attr_i2cadr);
 	video_device_remove_file(vdev, &dev_attr_i2cslave);
+	video_device_remove_file(vdev, &dev_attr_autotuning);
+	video_device_remove_file(vdev, &dev_attr_autoreg);
 #endif
 }
 
diff --git a/mt9vx11.c b/mt9vx11.c
index 0b39b8c..b6024a3 100644
--- a/mt9vx11.c
+++ b/mt9vx11.c
@@ -178,3 +178,286 @@ int mt9vx11_set_hvflip(struct usb_microdia *dev)
 	return ret;
 }
 
+int mt9v111_auto_exposure(struct usb_microdia * dev, __u8 status)
+{
+    __u8 buf[2];
+    int retI2C;
+
+	// check if status is valid:
+    if ((status != ENABLE) && (status != DISABLE))
+    {
+	UDIA_INFO("Error: invalid status autoexposure selection for sensor MT9V111/MI0360SOC !\n");
+	return -1;
+    }
+    
+    //Set IFP addres space
+    if(mt9v111_select_address_space(dev,MT9V111_IFP_ADDRESS_SPACE)!=0)
+    {
+	UDIA_INFO("Error: Unable to set IFP space from autoexposure for sensor MT9V111/MI0360SOC !\n");
+	return -1;
+    }
+
+    retI2C = sn9c20x_read_i2c_data(dev, MT9V111_I2C_SLAVE_ADDRESS, 2, 0x06, SN9C20X_I2C_2WIRE, buf);
+    if (retI2C != 0)
+    {
+	UDIA_INFO("Error: MT9V111/MI0360SOC (I2C-slave 0x5c): read of reg0x06 failed !\n");
+	return -1;
+    }
+    
+    if(status==ENABLE)
+    {
+        buf[0]=buf[0]|0x40;
+    }
+    else
+    {
+	buf[0]=buf[0]&0xbf;	
+    }
+    
+    retI2C = sn9c20x_write_i2c_data(dev, dev->sensor_slave_address, 2, 0x06, SN9C20X_I2C_2WIRE, buf);
+    //by default the selected addres space is sensor
+    retI2C = mt9v111_select_address_space(dev,MT9V111_SENSOR_ADDRESS_SPACE);
+    return 0;
+}
+
+int mt9v111_auto_corections_on_fly(struct usb_microdia * dev, __u8 status)
+{
+    __u8 buf[2];
+    int retI2C;
+
+	// check if status is valid:
+    if ((status != ENABLE) && (status != DISABLE))
+    {
+	UDIA_INFO("Error: invalid status autocorection on fly selection for sensor MT9V111/MI0360SOC !\n");
+	return -1;
+    }
+    
+    //Set IFP addres space
+    if(mt9v111_select_address_space(dev,MT9V111_IFP_ADDRESS_SPACE)!=0)
+    {
+	UDIA_INFO("Error: Unable to set IFP space from autocorection on fly for sensor MT9V111/MI0360SOC !\n");
+	return -1;
+    }
+
+    retI2C = sn9c20x_read_i2c_data(dev, MT9V111_I2C_SLAVE_ADDRESS, 2, 0x06, SN9C20X_I2C_2WIRE, buf);
+    if (retI2C != 0)
+    {
+	UDIA_INFO("Error: MT9V111/MI0360SOC (I2C-slave 0x5c): read of reg0x06 failed !\n");
+	return -1;
+    }
+    
+    if(status==ENABLE)
+    {
+	buf[0]=buf[0]|0x30;
+    }
+    else
+    {
+	buf[0]=buf[0]&0xdf;
+    }
+    
+    retI2C = sn9c20x_write_i2c_data(dev, dev->sensor_slave_address, 2, 0x06, SN9C20X_I2C_2WIRE, buf);
+    //by default the selected addres space is sensor
+    retI2C = mt9v111_select_address_space(dev,MT9V111_SENSOR_ADDRESS_SPACE);
+    return 0;
+}
+
+int mt9v111_auto_aperture_correction(struct usb_microdia * dev, __u8 status)
+{
+    __u8 buf[2];
+    int retI2C;
+
+	// check if status is valid:
+    if ((status != ENABLE) && (status != DISABLE))
+    {
+	UDIA_INFO("Error: invalid status auto aperture corection selection for sensor MT9V111/MI0360SOC !\n");
+	return -1;
+    }
+    
+    //Set IFP addres space
+    if(mt9v111_select_address_space(dev,MT9V111_IFP_ADDRESS_SPACE)!=0)
+    {
+	UDIA_INFO("Error: Unable to set IFP space from auto aperture corection for sensor MT9V111/MI0360SOC !\n");
+	return -1;
+    }
+
+    retI2C = sn9c20x_read_i2c_data(dev, MT9V111_I2C_SLAVE_ADDRESS, 2, 0x06, SN9C20X_I2C_2WIRE, buf);
+    if (retI2C != 0)
+    {
+	UDIA_INFO("Error: MT9V111/MI0360SOC (I2C-slave 0x5c): read of reg0x06 failed !\n");
+	return -1;
+    }
+    
+    if(status==ENABLE)
+    {
+	buf[0]=buf[0]|0x10;
+    }
+    else
+    {
+	buf[0]=buf[0]&0xef;
+    }
+    
+    retI2C = sn9c20x_write_i2c_data(dev, dev->sensor_slave_address, 2, 0x06, SN9C20X_I2C_2WIRE, buf);
+    //by default the selected addres space is sensor
+    retI2C = mt9v111_select_address_space(dev,MT9V111_SENSOR_ADDRESS_SPACE);
+    return 0;
+}
+
+
+int mt9v111_auto_color_correction(struct usb_microdia * dev, __u8 status)
+{
+    __u8 buf[2];
+    int retI2C;
+
+	// check if status is valid:
+    if ((status != ENABLE) && (status != DISABLE))
+    {
+	UDIA_INFO("Error: invalid status auto color corection selection for sensor MT9V111/MI0360SOC !\n");
+	return -1;
+    }
+    
+    //Set IFP addres space
+    if(mt9v111_select_address_space(dev,MT9V111_IFP_ADDRESS_SPACE)!=0)
+    {
+	UDIA_INFO("Error: Unable to set IFP space from auto color corection for sensor MT9V111/MI0360SOC !\n");
+	return -1;
+    }
+
+    retI2C = sn9c20x_read_i2c_data(dev, MT9V111_I2C_SLAVE_ADDRESS, 2, 0x06, SN9C20X_I2C_2WIRE, buf);
+    if (retI2C != 0)
+    {
+	UDIA_INFO("Error: MT9V111/MI0360SOC (I2C-slave 0x5c): read of reg0x06 failed !\n");
+	return -1;
+    }
+    
+    if(status==ENABLE)
+    {
+	buf[1]=buf[1]|0x10;
+    }
+    else
+    {
+	buf[1]=buf[1]&0xef;	
+    }
+    
+    retI2C = sn9c20x_write_i2c_data(dev, dev->sensor_slave_address, 2, 0x06, SN9C20X_I2C_2WIRE, buf);
+    //by default the selected addres space is sensor
+    retI2C = mt9v111_select_address_space(dev,MT9V111_SENSOR_ADDRESS_SPACE);
+    return 0;
+}
+
+int mt9v111_auto_white_balance_correction(struct usb_microdia * dev, __u8 status)
+{
+    __u8 buf[2];
+    int retI2C;
+
+	// check if status is valid:
+    if ((status != ENABLE) && (status != DISABLE))
+    {
+	UDIA_INFO("Error: invalid status auto white balance corection selection for sensor MT9V111/MI0360SOC !\n");
+	return -1;
+    }
+    
+    //Set IFP addres space
+    if(mt9v111_select_address_space(dev,MT9V111_IFP_ADDRESS_SPACE)!=0)
+    {
+	UDIA_INFO("Error: Unable to set IFP space from auto white balance corection for sensor MT9V111/MI0360SOC !\n");
+	return -1;
+    }
+
+    retI2C = sn9c20x_read_i2c_data(dev, MT9V111_I2C_SLAVE_ADDRESS, 2, 0x06, SN9C20X_I2C_2WIRE, buf);
+    if (retI2C != 0)
+    {
+	UDIA_INFO("Error: MT9V111/MI0360SOC (I2C-slave 0x5c): read of reg0x06 failed !\n");
+	return -1;
+    }
+    
+    if(status==ENABLE)
+    {
+	buf[1]=buf[1]|0x02;
+    }
+    else
+    {
+	buf[1]=buf[1]&0xfd;	
+    }
+    
+    retI2C = sn9c20x_write_i2c_data(dev, dev->sensor_slave_address, 2, 0x06, SN9C20X_I2C_2WIRE, buf);
+    //by default the selected addres space is sensor
+    retI2C = mt9v111_select_address_space(dev,MT9V111_SENSOR_ADDRESS_SPACE);
+    return 0;
+}
+
+int mt9v111_auto_measurement_area(struct usb_microdia * dev, __u8 status)
+{
+    __u8 buf[2];
+    int retI2C;
+
+	// check if status is valid:
+    if ((status != CENTRAL_WINDOW) && (status != LARGE_WINDOW) && (status != BOTH_WINDOW))
+    {
+	UDIA_INFO("Error: invalid status auto measurement area for sensor MT9V111/MI0360SOC !\n");
+	return -1;
+    }
+    
+    //Set IFP addres space
+    if(mt9v111_select_address_space(dev,MT9V111_IFP_ADDRESS_SPACE)!=0)
+    {
+	UDIA_INFO("Error: Unable to set IFP space from auto measurement area for sensor MT9V111/MI0360SOC !\n");
+	return -1;
+    }
+
+    retI2C = sn9c20x_read_i2c_data(dev, MT9V111_I2C_SLAVE_ADDRESS, 2, 0x06, SN9C20X_I2C_2WIRE, buf);
+    if (retI2C != 0)
+    {
+	UDIA_INFO("Error: MT9V111/MI0360SOC (I2C-slave 0x5c): read of reg0x06 failed !\n");
+	return -1;
+    }
+    
+    if(status==CENTRAL_WINDOW)
+    {
+	buf[1]=buf[1]&0xf3;
+	buf[1]=buf[1]|0x04;
+    }
+    
+    if(status==LARGE_WINDOW)
+    {
+	buf[1]=buf[1]&0xf3;	
+    }
+    
+    if(status==BOTH_WINDOW)
+    {
+	buf[1]=buf[1]&0xf3;
+	buf[1]=buf[1]|0x0c;	
+    }
+    
+    retI2C = sn9c20x_write_i2c_data(dev, dev->sensor_slave_address, 2, 0x06, SN9C20X_I2C_2WIRE, buf);
+    //by default the selected addres space is sensor
+    retI2C = mt9v111_select_address_space(dev,MT9V111_SENSOR_ADDRESS_SPACE);
+    return 0;
+}
+
+int mt9v111_read_IFP_reg6(struct usb_microdia * dev)
+{
+    __u8 buf[2];
+    int retI2C;
+    int ret;
+
+    
+    //Set IFP addres space
+    if(mt9v111_select_address_space(dev,MT9V111_IFP_ADDRESS_SPACE)!=0)
+    {
+	UDIA_INFO("Error: Unable to set IFP space from resd IFP reg6 for sensor MT9V111/MI0360SOC !\n");
+	return -1;
+    }
+
+    retI2C = sn9c20x_read_i2c_data(dev, MT9V111_I2C_SLAVE_ADDRESS, 2, 0x06, SN9C20X_I2C_2WIRE, buf);
+    if (retI2C != 0)
+    {
+	UDIA_INFO("Error: MT9V111/MI0360SOC (I2C-slave 0x5c): read of reg0x06 failed !\n");
+	return -1;
+    }
+    
+    ret=buf[0];
+    ret=(ret<<8)&0xff00;
+    ret=ret|buf[1];
+    //by default the selected addres space is sensor
+    retI2C = mt9v111_select_address_space(dev,MT9V111_SENSOR_ADDRESS_SPACE);
+    return ret;
+}
diff --git a/mt9vx11.h b/mt9vx11.h
index 1ecdcc0..82e0182 100644
--- a/mt9vx11.h
+++ b/mt9vx11.h
@@ -35,6 +35,12 @@
 #define MT9V111_IFP_ADDRESS_SPACE	0x01
 #define MT9V111_SENSOR_ADDRESS_SPACE	0x04
 
+#define ENABLE  1
+#define DISABLE 0
+
+#define CENTRAL_WINDOW  2
+#define LARGE_WINDOW    3
+#define BOTH_WINDOW     4
 
 
 int mt9v111_select_address_space(struct usb_microdia * dev, __u8 address_space);
@@ -45,6 +51,18 @@ int mt9vx11_set_exposure(struct usb_microdia *dev);
 
 int mt9vx11_set_hvflip(struct usb_microdia *dev);
 
+int mt9v111_auto_exposure(struct usb_microdia * dev, __u8 status);
+
+int mt9v111_auto_corections_on_fly(struct usb_microdia * dev, __u8 status);
+
+int mt9v111_auto_aperture_correction(struct usb_microdia * dev, __u8 status);
+
+int mt9v111_auto_color_correction(struct usb_microdia * dev, __u8 status);
+
+int mt9v111_auto_white_balance_correction(struct usb_microdia * dev, __u8 status);
 
+int mt9v111_auto_measurement_area(struct usb_microdia * dev, __u8 status);
 
+int mt9v111_read_IFP_reg6(struct usb_microdia * dev);
+	
 #endif
