Index: uspace/lib/usb/src/hidparser.c
===================================================================
--- uspace/lib/usb/src/hidparser.c	(revision 8bec4d135a827923bd762e497c465c6b29829c0f)
+++ uspace/lib/usb/src/hidparser.c	(revision 7351dc3dbe011ce085a1813b4acde57432b7fc0e)
@@ -112,5 +112,7 @@
 	usb_hid_report_item_t *new_report_item;
 
-	size_t offset=0;
+	size_t offset_input=0;
+	size_t offset_output=0;
+	size_t offset_feature=0;
 	
 
@@ -118,4 +120,6 @@
 		return ENOMEM;
 	}
+	memset(report_item, 0, sizeof(usb_hid_report_item_t));
+	
 	link_initialize(&(report_item->link));	
 
@@ -143,14 +147,15 @@
 					// store report item to report and create the new one
 					usb_log_debug("\nNEW REPORT ITEM: %X",tag);
-
-					report_item->offset = offset;
-					offset += report_item->count * report_item->size;
 					
 					switch(tag) {
 						case USB_HID_REPORT_TAG_INPUT:
+							report_item->offset = offset_input;
+							offset_input += report_item->count * report_item->size;
 							usb_log_debug(" - INPUT\n");
 							list_append(&(report_item->link), &(parser->input));
 							break;
 						case USB_HID_REPORT_TAG_OUTPUT:
+							report_item->offset = offset_output;
+							offset_output += report_item->count * report_item->size;
 							usb_log_debug(" - OUTPUT\n");
 								list_append(&(report_item->link), &(parser->output));
@@ -158,4 +163,6 @@
 							break;
 						case USB_HID_REPORT_TAG_FEATURE:
+							report_item->offset = offset_feature;
+							offset_feature += report_item->count * report_item->size;
 							usb_log_debug(" - FEATURE\n");
 								list_append(&(report_item->link), &(parser->feature));
@@ -483,5 +490,5 @@
 	
 	if(head == NULL || list_empty(head)) {
-	    printf("\tempty\n");
+	    usb_log_debug("\tempty\n");
 	    return;
 	}
@@ -491,15 +498,15 @@
 		report_item = list_get_instance(item, usb_hid_report_item_t, link);
 
-		printf("\tOFFSET: %X\n", report_item->offset);
-		printf("\tCOUNT: %X\n", report_item->count);
-		printf("\tSIZE: %X\n", report_item->size);
-		printf("\tCONSTANT: %X\n", USB_HID_ITEM_FLAG_CONSTANT(report_item->item_flags));
-		printf("\tUSAGE: %X\n", report_item->usage);
-		printf("\tUSAGE PAGE: %X\n", report_item->usage_page);
-		printf("\tLOGMIN: %X\n", report_item->logical_minimum);
-		printf("\tLOGMAX: %X\n", report_item->logical_maximum);		
-		printf("\tPHYMIN: %X\n", report_item->physical_minimum);		
-		printf("\tPHYMAX: %X\n", report_item->physical_maximum);				
-		printf("\n");		
+		usb_log_debug("\tOFFSET: %X\n", report_item->offset);
+		usb_log_debug("\tCOUNT: %X\n", report_item->count);
+		usb_log_debug("\tSIZE: %X\n", report_item->size);
+		usb_log_debug("\tCONSTANT: %X\n", USB_HID_ITEM_FLAG_CONSTANT(report_item->item_flags));
+		usb_log_debug("\tUSAGE: %X\n", report_item->usage);
+		usb_log_debug("\tUSAGE PAGE: %X\n", report_item->usage_page);
+		usb_log_debug("\tLOGMIN: %X\n", report_item->logical_minimum);
+		usb_log_debug("\tLOGMAX: %X\n", report_item->logical_maximum);		
+		usb_log_debug("\tPHYMIN: %X\n", report_item->physical_minimum);		
+		usb_log_debug("\tPHYMAX: %X\n", report_item->physical_maximum);				
+		usb_log_debug("\n");		
 
 	}
@@ -515,11 +522,11 @@
 void usb_hid_descriptor_print(usb_hid_report_parser_t *parser)
 {
-	printf("INPUT:\n");
+	usb_log_debug("INPUT:\n");
 	usb_hid_descriptor_print_list(&parser->input);
 	
-	printf("OUTPUT: \n");
+	usb_log_debug("OUTPUT: \n");
 	usb_hid_descriptor_print_list(&parser->output);
 	
-	printf("FEATURE:\n");	
+	usb_log_debug("FEATURE:\n");	
 	usb_hid_descriptor_print_list(&parser->feature);
 
@@ -652,10 +659,17 @@
 	}
 
-	if((item->physical_minimum == 0) && (item->physical_maximum ==0)) {
+	if((item->physical_minimum == 0) && (item->physical_maximum == 0)) {
 		item->physical_minimum = item->logical_minimum;
 		item->physical_maximum = item->logical_maximum;		
 	}
 
-	resolution = (item->logical_maximum - item->logical_minimum) / ((item->physical_maximum - item->physical_minimum) * (usb_pow(10,(item->unit_exponent))));
+	if(item->physical_maximum == item->physical_minimum){
+	    resolution = 1;
+	}
+	else {
+	    resolution = (item->logical_maximum - item->logical_minimum) / 
+		((item->physical_maximum - item->physical_minimum) * 
+		(usb_pow(10,(item->unit_exponent))));
+	}
 	offset = item->offset + (j * item->size);
 	
@@ -694,4 +708,5 @@
 
 		usb_log_debug2("offset %d\n", offset);
+	
 		usb_log_debug2("foo %x\n", *foo);
 		usb_log_debug2("maska %x\n",  mask);
@@ -699,5 +714,5 @@
 	}
 
-	usb_log_debug2("---\n\n");
+	usb_log_debug2("---\n\n"); 
 
 	return (int)(((value - item->logical_minimum) / resolution) + item->physical_minimum);
