default: 
default: 
static int powermate_probe(struct usb_interface *intf, const struct usb_device_id *id){	struct usb_device *udev = interface_to_usbdev (intf);	struct usb_host_interface *interface;	struct usb_endpoint_descriptor *endpoint;	struct powermate_device *pm;	int pipe, maxp;	char path[64];	interface = intf->cur_altsetting;	endpoint = &interface->endpoint[0].desc;	if (!(endpoint->bEndpointAddress & 0x80))		return -EIO;	if ((endpoint->bmAttributes & 3) != 3)		return -EIO;	usb_control_msg(udev, usb_sndctrlpipe(udev, 0),		0x0a, USB_TYPE_CLASS | USB_RECIP_INTERFACE,		0, interface->desc.bInterfaceNumber, NULL, 0,		USB_CTRL_SET_TIMEOUT);	if (!(pm = kmalloc(sizeof(struct powermate_device), GFP_KERNEL)))		return -ENOMEM;	memset(pm, 0, sizeof(struct powermate_device));	pm->udev = udev;	if (powermate_alloc_buffers(udev, pm)) {		powermate_free_buffers(udev, pm);		kfree(pm);		return -ENOMEM;	}	pm->irq = usb_alloc_urb(0, GFP_KERNEL);	if (!pm->irq) {		powermate_free_buffers(udev, pm);		kfree(pm);		return -ENOMEM;	}	pm->config = usb_alloc_urb(0, GFP_KERNEL);	if (!pm->config) {		usb_free_urb(pm->irq);		powermate_free_buffers(udev, pm);		kfree(pm);		return -ENOMEM;	}	spin_lock_init(&pm->lock);	init_input_dev(&pm->input);	/* get a handle to the interrupt data pipe */	pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress);	maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe));	if(maxp < POWERMATE_PAYLOAD_SIZE_MIN || maxp > POWERMATE_PAYLOAD_SIZE_MAX){		printk("powermate: Expected payload of %d--%d bytes, found %d bytes!\n",			POWERMATE_PAYLOAD_SIZE_MIN, POWERMATE_PAYLOAD_SIZE_MAX, maxp);		maxp = POWERMATE_PAYLOAD_SIZE_MAX;	}	usb_fill_int_urb(pm->irq, udev, pipe, pm->data,			 maxp, powermate_irq,			 pm, endpoint->bInterval);	pm->irq->transfer_dma = pm->data_dma;	pm->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;	/* register our interrupt URB with the USB system */	if (usb_submit_urb(pm->irq, GFP_KERNEL)) {		powermate_free_buffers(udev, pm);		kfree(pm);		return -EIO; /* failure */	}	switch (le16_to_cpu(udev->descriptor.idProduct)) {	case POWERMATE_PRODUCT_NEW: pm->input.name = pm_name_powermate; break;	case POWERMATE_PRODUCT_OLD: pm->input.name = pm_name_soundknob; break;	default: 		pm->input.name = pm_name_soundknob;		printk(KERN_WARNING "powermate: unknown product id %04x\n",		       le16_to_cpu(udev->descriptor.idProduct));	}	pm->input.private = pm;	pm->input.evbit[0] = BIT(EV_KEY) | BIT(EV_REL) | BIT(EV_MSC);	pm->input.keybit[LONG(BTN_0)] = BIT(BTN_0);	pm->input.relbit[LONG(REL_DIAL)] = BIT(REL_DIAL);	pm->input.mscbit[LONG(MSC_PULSELED)] = BIT(MSC_PULSELED);	pm->input.id.bustype = BUS_USB;	pm->input.id.vendor = le16_to_cpu(udev->descriptor.idVendor);	pm->input.id.product = le16_to_cpu(udev->descriptor.idProduct);	pm->input.id.version = le16_to_cpu(udev->descriptor.bcdDevice);	pm->input.event = powermate_input_event;	pm->input.dev = &intf->dev;	pm->input.phys = pm->phys;	input_register_device(&pm->input);	usb_make_path(udev, path, 64);	snprintf(pm->phys, 64, "%s/input0", path);	printk(KERN_INFO "input: %s on %s\n", pm->input.name, pm->input.phys);		/* force an update of everything */	pm->requires_update = UPDATE_PULSE_ASLEEP | UPDATE_PULSE_AWAKE | UPDATE_PULSE_MODE | UPDATE_STATIC_BRIGHTNESS;	powermate_pulse_led(pm, 0x80, 255, 0, 1, 0); // set default pulse parameters  	usb_set_intfdata(intf, pm);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/05f091ab4c8c1f12f8dd38ee789489904fea327d/powermate.c/clean/drivers/usb/input/powermate.c