linux内核对S3C2410睡眠模式的支持

时间:2013-03-18来源:网络

  (3)编写测试程序

  #include stdio.h>

  #include sys/types.h>

  #include sys/ioctl.h>

  #include unistd.h>

  #include fcntl.h>

  #include linux/ioctl.h>

  #define APM_IOC_STANDBY _IO('A', 1)

  #define APM_IOC_SUSPEND _IO('A', 2)

  int main (void)

  {

  int fd;

  fd = open ("/dev/apm_bios",O_RDWR);

  if (fd 0) {

  printf ("fd open failed");

  exit(0);

  }

  printf ("/dev/apm_bios opened, fd=%d",fd);

  ioctl (fd, APM_IOC_SUSPEND);

  close (fd);

  printf ("/dev/apm_bios closed :)");

  return 0;

  }

  (4)测试效果

  #./test

  .....

  sleep: irq wakeup masks: fffffff0,fffffff0

  GSTATUS3 0x30367140

  GSTATUS4 0x00000000

  进入睡眠状态,此时按K10按键,即中断0,唤醒系统

  GPIO[0] CON 007fffff => 007fffff, DAT 00000000 => 00000000

  GPIO[1] CON 00044555 => 00044555, DAT 00000540 => 00000540

  GPIO[2] CON aaaaaaaa => aaaaaaaa, DAT 00000000 => 00000000

  GPIO[3] CON aaaaaaaa => aaaaaaaa, DAT 00000000 => 00000000

  GPIO[4] CON aaaaa6aa => aaaaa6aa, DAT 0000ffc5 => 0000ffc5

  GPIO[5] CON 000055aa => 000055aa, DAT 000000fe => 000000ff

  GPIO[6] CON ffa5ff30 => ffa5ffba, DAT 0000aced => 0000aced

  GPIO[7] CON 002afaaa => 002afaaa, DAT 000001ff => 000001fb

  post sleep: IRQs 0x02000001, 0x00000200

  IRQ 16 asserted at resume

  post sleep, preparing to return

  S3C2410 PM Resume (post-restore)

  s3c2410-sdi s3c2410-sdi: powered down.

  s3c24xx-pm: check if we have anything to wake-up with

  Disabling IRQ 52 (pin 192)

  Disabling IRQ 53 (pin 193)

  Disabling IRQ 55 (pin 195)

  dma3: restoring configuration

  timer tcon=00000000, tcnt a2c1, tcfg 00000200,00000000, usec 00001eb8

  s3c2410-wdt: watchdog disabled

  s3c2410-i2c s3c2410-i2c: slave address 0x10

  s3c2410-i2c s3c2410-i2c: bus frequency set to 390 KHz

  s3c2410-nand s3c2410-nand: Tacls=3, 30ns Twrph0=7 70ns, Twrph1=3 30ns

  s3c2410-sdi s3c2410-sdi: running at 0kHz (requested: 0kHz).

  s3c2410-sdi s3c2410-sdi: running at 98kHz (requested: 97kHz).

  s3c2410-sdi s3c2410-sdi: running at 98kHz (requested: 97kHz).

  s3c2410-sdi s3c2410-sdi: running at 98kHz (requested: 97kHz).

  s3c2410-sdi s3c2410-sdi: powered down.

  usb usb1: root hub lost power or was reset

  Restarting tasks ... done.

  /dev/apm_bios closed :)

  #

  此时系统恢复了正常运行。

1 2 3

关键词: linux内核 S3C2410 睡眠模式

加入微信
获取电子行业最新资讯
搜索微信公众号:EEPW

或用微信扫描左侧二维码

相关文章

查看电脑版