LinuxÏÂUSB suspend/resumeÔ´Âë·ÖÎö
Linux
ÏÂ
USB
suspend/resume
Ô´Âë·ÖÎö
Author:aaron
±¾ÎÄÖ÷Òª´Ó×Ô¼º¿ª·¢µÄÒ»¸ö
USB
Çý¶¯µÄÀý×ÓÀ´ÉîÈë½²½â
linux
ÄÚºËÊÇÈçºÎÖ§³Ö
USB
É豸µÄÐÝÃߺͻ½ÐѵÄ
,
×î½üÎÒÔÚΪÎÒÃǹ«Ë¾µÄÒ»¸öÄ£¿éд
linux
ϵÄÇý¶¯
,
ÆäÖÐÖ®Ò»¾ÍÊÇÒªÖ§³Ö
USB
µÄÐÝÃß»½ÐÑÎÊÌâ
,
ʵ¼ÊÉÏ
linux
Äں˶Ô
USB
µÄÕâ¸ö¹¦ÄܵÄÖ§³Ö»¹ÊDZȽÏеÄ
,
Ò²¾ÍÊÇ×î½ü¼¸ÄêµÄÊÂ
.
Ò»
´ò¿ª
/
¹Ø±Õ
USB suspend/resuem
¹¦ÄÜ
ÒªÈÃ
linux
Ö§³Ö
usb suspend/resuem,
µ±È»ÏÈÒª°ÑÄÚºËÖÐÕâ¸ö¹¦ÄܵĴúÂë±àÒë½øÈ¥¿©
,
¼´ÒªÔÚ
make menuconfig
ʱ´ò¿ª¶ÔÕâÏÄܵÄÖ§³Ö
.
µÚÒ»¸ö´ò¿ªµÄÏîÊÇ
CONFIG_PM,
¼´Õû¸öϵͳµÄµçÔ´¹ÜÀí
, USB suspend/resuem
Ö»ÊÇÕû¸öµçÔ´¹ÜÀíµÄÒ»¸ö×Ôϵͳ
.
Ö»Óдò¿ªÁËÕâ¸ö¹¦ÄܲÅÄÜÈÃ
USB
µÄÕâ¸öÌØÐÔÄÜÓÃ
.
µÚ¶þ¸öÒª´ò¿ªµÄµ±ÈÃÊÇ
USB
×Ô¼ºµÄ¿ª¹ØÁË
CONFIG_USB_SUSPEND.
¼´´ò¿ªÁËÕâ¸ö¹¦ÄܺóÎÒÃÇÖ»ÒªÔÚÎÒÃÇ×Ô¼ºµÄÇý¶¯Àï¼òµ¥µ÷ÓÃÏÂ
USB core
ÌṩµÄº¯Êý½Ó¿Ú¾ÍÄÜʹÎÒÃǵÄÉ豸ÐÝÃßÁË
.
¶þ
Ô´Âë·ÖÎö
ÔÚ
2.6.19
֮ǰµÄ´úÂëÖв»Ö§³Ö
USB
×Ô¶¯ÐÝÃߵŦÄÜ
,
ËüÖ»ÄÜÊÇÔÚ
host
ÐÝÃßÇé¿öϲŻáÈÃ
USB
É豸ҲÐÝÃß
.
ËùÒÔÈç¹ûÎÒÃÇÒªÈÃ×Ô¼ºµÄÉ豸ÔÚ²»Ê¹ÓõÄÇé¿öϾÍÐÝÃ߾͵Ã×Ô¼ºÌí¼ÓÏàÓ¦µÄ´úÂë
,
ÐÒÔ˵ÄÊÇÎÒÃDz»ÐèÒªÌí¼Ó¸´ÔӵĴúÂë¾ÍÄÜ´ïµ½Õâ¸öÄ¿µÄ
,
ÒòΪ
USB core
ÀïÌṩÁ˼¸¸ö½Ó¿Ú¿ÉÒÔÖ±½ÓÈÃÎÒÃǵÄÇý¶¯µ÷ÓÃÒÔ°ÑÎÒÃǵÄÉ豸ÖÃÈëÐÝÃß״̬
.
ÏÂÃæÎÒÃÇÒÔ
2.6.16
µÄ´úÂëΪÀýÀ´·ÖÎöÏÂ
USB
É豸ÊÇÈçºÎ½øÈëÐÝÃßµÄ
.
Drivers\usr\core\hub.c:
int usb_suspend_device(struct usb_device *udev)
{
#ifdef
CONFIG_USB_SUSPEND
if (udev->state ==
USB_STATE_NOTATTACHED)
return -ENODEV;
return
__usb_suspend_device(udev, udev->portnum);
#else
/* NOTE:
udev->state unchanged, it's not lying ...
*/
udev->dev.power.power_state
= PMSG_SUSPEND;
return 0;
#endif
}
û´í
,
ÔÚÎÒÃǵ
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌṩÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
ARGB8888
32λɫ,ARGB8888±íʾARGB¸÷´ú±í8룬A±íʾ͸Ã÷¶È£¬µ±ÎªffʱΪ·Ç͸Ã÷£¬RGB·Ö±ðΪºìÂÌÀ¶£¬ff±íʾ×îŨ¡£
ARGB1555
16λɫ 1 λ±íʾ ͸Ã÷¶È£¬ Ö»ÄÜÏÔʾÁ½ÖÖ״̬£¬Í¸Ã÷ºÍ·Ç͸Ã÷¡£
¡¾Ê²Ã´ÊÇFrameBuffer¡¿
FrameÖ¡£ºÄãËù¿´µ½µÄÆÁÄ»µÄͼÏñ£¬»òÕßÔÚÒ»¸ö´°¿ÚÖеÄͼÏñ£¬¾Í½ÐÒ»Ö¡¡£
Buffer»º³å£ºÒ»¶ÎRAM£¬ÓÃÀ´ÔÝ´æͼÏñÊý ......
1.ÊÖÍ·ÓÐÒ»±¾ºÃµÄÈëÃŽ̲Ä
ÂòÄÇЩһ¿ªÊ¼¾Í´Óϵͳ»ù±¾»ú¹¹»ù±¾ÃüÁʼ½²½âµÄÊé¼®£¬Ò»¿ªÊ¼ÄãҪѡ¶¨Ò»±¾ÈëÃŽ̲Ä,µ«ÊDz»ÄÜÖ»¿´Ò»±¾,ÒòΪÓÐЩÊéÉϽ²µÄ,¿ÉÄÜÊÇÁíÍâµÄÊéÉÏûÓеÄ.Òò´Ë,ÖصãÑ¡Ò»±¾½Ì²Ä¿´Íê.È»ºóÔÙ¿´Á½Èý±¾ÈëÃŽ̲Ää¯ÀÀÒ»ÏÂ.×÷Ϊ¶ÔµÚÒ»±¾ÊéµÄ֪ʶµÄÀ©³äºÍ¹®¹Ì¡£
2.¿´Íêϵͳ×Ô´øµÄÎĵµ
¾ø´ ......
Linux ÓÐ×Ô¼ºµÄ input ×Óϵͳ£¬¿ÉÒÔͳһ¹ÜÀíÊó±êºÍ¼üÅÌʼþ¡£
»ùÓÚÊäÈë×Óϵͳ ʵÏÖµÄ uinput ¿ÉÒÔ·½±ãµÄÔÚÓû§¿Õ¼äÄ£ÄâÊó±êºÍ¼üÅÌʼþ¡£
µ±È»£¬Ò²¿ÉÒÔ×Ô¼ºÔìÂÖ×Ó£¬ ×öÒ»¸ö×Ö·ûÉ豸½ÓÊÕÓû§ÊäÈ룬¸ù¾ÝÊäÈ룬ͶµÝ input ʼþ¡£
»¹ÓÐÒ»ÖÖ·½Ê½¾ÍÊÇÖ±½Ó Íù evnent ÀïдÈëÊý¾Ý£¬ ¶¼¿ÉÒÔ´ïµ½¿ØÖÆÊó±ê¼üÅ̵ŦÄÜ¡£
±¾ÆªÎÄÕ¾ÍÊÇ ......
1 ³ÌÐòÁ÷³Ìͼ¡£
2 sampleÀý×Ó
HI_S32 TDE_DrawGraphicSample()
{
HI_U32 u32Size;
HI_S32 s32Fd;
HI_U32 u32Times;
HI_U8* pu8Screen;
HI_U32 u32PhyAddr;
HI_S32 s32Ret = -1;
  ......