mydev              63 drivers/usb/misc/usbsevseg.c static void update_display_powered(struct usb_sevsegdev *mydev)
mydev              67 drivers/usb/misc/usbsevseg.c 	if (mydev->powered && !mydev->has_interface_pm) {
mydev              68 drivers/usb/misc/usbsevseg.c 		rc = usb_autopm_get_interface(mydev->intf);
mydev              71 drivers/usb/misc/usbsevseg.c 		mydev->has_interface_pm = 1;
mydev              74 drivers/usb/misc/usbsevseg.c 	if (mydev->shadow_power != 1)
mydev              77 drivers/usb/misc/usbsevseg.c 	rc = usb_control_msg(mydev->udev,
mydev              78 drivers/usb/misc/usbsevseg.c 			usb_sndctrlpipe(mydev->udev, 0),
mydev              82 drivers/usb/misc/usbsevseg.c 			(0x00 * 0x100) + (mydev->powered ? 1 : 0),
mydev              87 drivers/usb/misc/usbsevseg.c 		dev_dbg(&mydev->udev->dev, "power retval = %d\n", rc);
mydev              89 drivers/usb/misc/usbsevseg.c 	if (!mydev->powered && mydev->has_interface_pm) {
mydev              90 drivers/usb/misc/usbsevseg.c 		usb_autopm_put_interface(mydev->intf);
mydev              91 drivers/usb/misc/usbsevseg.c 		mydev->has_interface_pm = 0;
mydev              95 drivers/usb/misc/usbsevseg.c static void update_display_mode(struct usb_sevsegdev *mydev)
mydev              99 drivers/usb/misc/usbsevseg.c 	if(mydev->shadow_power != 1)
mydev             102 drivers/usb/misc/usbsevseg.c 	rc = usb_control_msg(mydev->udev,
mydev             103 drivers/usb/misc/usbsevseg.c 			usb_sndctrlpipe(mydev->udev, 0),
mydev             107 drivers/usb/misc/usbsevseg.c 			(mydev->mode_msb * 0x100) + mydev->mode_lsb,
mydev             113 drivers/usb/misc/usbsevseg.c 		dev_dbg(&mydev->udev->dev, "mode retval = %d\n", rc);
mydev             116 drivers/usb/misc/usbsevseg.c static void update_display_visual(struct usb_sevsegdev *mydev, gfp_t mf)
mydev             123 drivers/usb/misc/usbsevseg.c 	if(mydev->shadow_power != 1)
mydev             131 drivers/usb/misc/usbsevseg.c 	for (i = 0; i < mydev->textlength; i++)
mydev             132 drivers/usb/misc/usbsevseg.c 		buffer[i] = mydev->text[mydev->textlength-1-i];
mydev             134 drivers/usb/misc/usbsevseg.c 	rc = usb_control_msg(mydev->udev,
mydev             135 drivers/usb/misc/usbsevseg.c 			usb_sndctrlpipe(mydev->udev, 0),
mydev             139 drivers/usb/misc/usbsevseg.c 			(0 * 0x100) + mydev->textmode, /* mode  */
mydev             141 drivers/usb/misc/usbsevseg.c 			mydev->textlength,
mydev             145 drivers/usb/misc/usbsevseg.c 		dev_dbg(&mydev->udev->dev, "write retval = %d\n", rc);
mydev             150 drivers/usb/misc/usbsevseg.c 	for (i = 0; i < sizeof(mydev->decimals); i++)
mydev             151 drivers/usb/misc/usbsevseg.c 		decimals |= mydev->decimals[i] << i;
mydev             153 drivers/usb/misc/usbsevseg.c 	rc = usb_control_msg(mydev->udev,
mydev             154 drivers/usb/misc/usbsevseg.c 			usb_sndctrlpipe(mydev->udev, 0),
mydev             164 drivers/usb/misc/usbsevseg.c 		dev_dbg(&mydev->udev->dev, "decimal retval = %d\n", rc);
mydev             172 drivers/usb/misc/usbsevseg.c 	struct usb_sevsegdev *mydev = usb_get_intfdata(intf);	\
mydev             174 drivers/usb/misc/usbsevseg.c 	return sprintf(buf, "%u\n", mydev->name);		\
mydev             181 drivers/usb/misc/usbsevseg.c 	struct usb_sevsegdev *mydev = usb_get_intfdata(intf);	\
mydev             183 drivers/usb/misc/usbsevseg.c 	mydev->name = simple_strtoul(buf, NULL, 10);		\
mydev             184 drivers/usb/misc/usbsevseg.c 	update_fcn(mydev); 					\
mydev             194 drivers/usb/misc/usbsevseg.c 	struct usb_sevsegdev *mydev = usb_get_intfdata(intf);
mydev             196 drivers/usb/misc/usbsevseg.c 	return snprintf(buf, mydev->textlength, "%s\n", mydev->text);
mydev             203 drivers/usb/misc/usbsevseg.c 	struct usb_sevsegdev *mydev = usb_get_intfdata(intf);
mydev             206 drivers/usb/misc/usbsevseg.c 	if (end > sizeof(mydev->text))
mydev             209 drivers/usb/misc/usbsevseg.c 	memset(mydev->text, 0, sizeof(mydev->text));
mydev             210 drivers/usb/misc/usbsevseg.c 	mydev->textlength = end;
mydev             213 drivers/usb/misc/usbsevseg.c 		memcpy(mydev->text, buf, end);
mydev             215 drivers/usb/misc/usbsevseg.c 	update_display_visual(mydev, GFP_KERNEL);
mydev             225 drivers/usb/misc/usbsevseg.c 	struct usb_sevsegdev *mydev = usb_get_intfdata(intf);
mydev             229 drivers/usb/misc/usbsevseg.c 	for (i = 0; i < sizeof(mydev->decimals); i++) {
mydev             230 drivers/usb/misc/usbsevseg.c 		pos = sizeof(mydev->decimals) - 1 - i;
mydev             231 drivers/usb/misc/usbsevseg.c 		if (mydev->decimals[i] == 0)
mydev             233 drivers/usb/misc/usbsevseg.c 		else if (mydev->decimals[i] == 1)
mydev             239 drivers/usb/misc/usbsevseg.c 	buf[sizeof(mydev->decimals)] = '\n';
mydev             240 drivers/usb/misc/usbsevseg.c 	return sizeof(mydev->decimals) + 1;
mydev             247 drivers/usb/misc/usbsevseg.c 	struct usb_sevsegdev *mydev = usb_get_intfdata(intf);
mydev             251 drivers/usb/misc/usbsevseg.c 	if (end > sizeof(mydev->decimals))
mydev             258 drivers/usb/misc/usbsevseg.c 	memset(mydev->decimals, 0, sizeof(mydev->decimals));
mydev             261 drivers/usb/misc/usbsevseg.c 			mydev->decimals[end-1-i] = 1;
mydev             263 drivers/usb/misc/usbsevseg.c 	update_display_visual(mydev, GFP_KERNEL);
mydev             274 drivers/usb/misc/usbsevseg.c 	struct usb_sevsegdev *mydev = usb_get_intfdata(intf);
mydev             280 drivers/usb/misc/usbsevseg.c 		if (mydev->textmode == i) {
mydev             300 drivers/usb/misc/usbsevseg.c 	struct usb_sevsegdev *mydev = usb_get_intfdata(intf);
mydev             307 drivers/usb/misc/usbsevseg.c 	mydev->textmode = i;
mydev             308 drivers/usb/misc/usbsevseg.c 	update_display_visual(mydev, GFP_KERNEL);
mydev             334 drivers/usb/misc/usbsevseg.c 	struct usb_sevsegdev *mydev = NULL;
mydev             337 drivers/usb/misc/usbsevseg.c 	mydev = kzalloc(sizeof(struct usb_sevsegdev), GFP_KERNEL);
mydev             338 drivers/usb/misc/usbsevseg.c 	if (!mydev)
mydev             341 drivers/usb/misc/usbsevseg.c 	mydev->udev = usb_get_dev(udev);
mydev             342 drivers/usb/misc/usbsevseg.c 	mydev->intf = interface;
mydev             343 drivers/usb/misc/usbsevseg.c 	usb_set_intfdata(interface, mydev);
mydev             346 drivers/usb/misc/usbsevseg.c 	mydev->shadow_power = 1; /* currently active */
mydev             347 drivers/usb/misc/usbsevseg.c 	mydev->has_interface_pm = 0; /* have not issued autopm_get */
mydev             350 drivers/usb/misc/usbsevseg.c 	mydev->textmode = 0x02; /* ascii mode */
mydev             351 drivers/usb/misc/usbsevseg.c 	mydev->mode_msb = 0x06; /* 6 characters */
mydev             352 drivers/usb/misc/usbsevseg.c 	mydev->mode_lsb = 0x3f; /* scanmode for 6 chars */
mydev             363 drivers/usb/misc/usbsevseg.c 	struct usb_sevsegdev *mydev;
mydev             365 drivers/usb/misc/usbsevseg.c 	mydev = usb_get_intfdata(interface);
mydev             367 drivers/usb/misc/usbsevseg.c 	usb_put_dev(mydev->udev);
mydev             368 drivers/usb/misc/usbsevseg.c 	kfree(mydev);
mydev             374 drivers/usb/misc/usbsevseg.c 	struct usb_sevsegdev *mydev;
mydev             376 drivers/usb/misc/usbsevseg.c 	mydev = usb_get_intfdata(intf);
mydev             377 drivers/usb/misc/usbsevseg.c 	mydev->shadow_power = 0;
mydev             384 drivers/usb/misc/usbsevseg.c 	struct usb_sevsegdev *mydev;
mydev             386 drivers/usb/misc/usbsevseg.c 	mydev = usb_get_intfdata(intf);
mydev             387 drivers/usb/misc/usbsevseg.c 	mydev->shadow_power = 1;
mydev             388 drivers/usb/misc/usbsevseg.c 	update_display_mode(mydev);
mydev             389 drivers/usb/misc/usbsevseg.c 	update_display_visual(mydev, GFP_NOIO);
mydev             396 drivers/usb/misc/usbsevseg.c 	struct usb_sevsegdev *mydev;
mydev             398 drivers/usb/misc/usbsevseg.c 	mydev = usb_get_intfdata(intf);
mydev             399 drivers/usb/misc/usbsevseg.c 	mydev->shadow_power = 1;
mydev             400 drivers/usb/misc/usbsevseg.c 	update_display_mode(mydev);
mydev             401 drivers/usb/misc/usbsevseg.c 	update_display_visual(mydev, GFP_NOIO);