This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Suspend / Resume on Linux

Other Parts Discussed in Thread: DM3730, ADS7846, SYSCONFIG

Hi

I am using Linux Kernel 2.6.37 and need some assistance in suspend resume.

I know we can suspend resume from the command prompt using

echo mem > /sys/power/state

But what I am interested in is suspending not everything but from power management just the few unused drivers. Like I have i2c, spi, io expander, gsm, gps, usb drivers etc

I am looking for a way is how to suspend some driver when the screen sleep timer times out so that I can turn the backlight off or turn other things off which are controlled by the gpio pins of the processor or io expander, start a new timer and on its expiry suspend the whole system.

I hope I have clarified as to what I want to to do any help in this regard would be great. If its not clear please let me know and i'll try to explain.

Thanks

Ali

  • Please ca you state that what all the components you want to suspend?. Basically suspend resume feature should be supported in each driver and application can make use of it.
  • Hello Muhammad,

    Suspend/Resume means that:

     System transitions to a low power state where processor is idle

    Suspend process is initiated by the user via the standard kernel interface:
    echo mem > /sys/power/state (DeepSleep0) or echo standby > /sys/power/state (standby)

    DeepSleep0 wakeup sources supported:  UART0, Touchscreen, GPIO0, RTC, I2C0

    #Q: I am looking for a way is how to suspend some driver when the screen sleep timer times out so that I can turn the backlight off or turn other things off which are controlled by the gpio pins of the processor or io expander, start a new timer and on its expiry suspend the whole system.

    - The answer on your question is:

    Relevant Files with Suspend/Resume are:
    - arch/arm/mach-omap2/pm33xx.c
    AM33XX and AM43XX pm init code, most suspend/resume functionality

    - arch/arm/mach-omap2/sleep33xx.S and arch/arm/mach-omap2/sleep43xx.S
    Assembly code that performs final steps just prior to WFI instruction

    - kernel/power/suspend.c
    Core kernel suspend/resume code. Starts with pm_suspend function.

    - drivers/base/power/main.c
    Core driver suspend logic is here dpm_suspend and dpm_resume

    - drivers/* - You must modify the handlers, which service your backlight driver.  

    Every driver with suspend/resume handlers!

    - arch/arm/mach-omap2/omap_hwmod.c and arch/arm/mach-omap2/omap_device.c

    - Low level handling of omap modules, where CLKCTRLs are controlled from

    More information you can find in this link http://processors.wiki.ti.com/index.php/Linux_Core_Power_Management_User%27s_Guide_(v3.14)

    Best regards,

    Yanko

  • Hi Yanko,

    Thanks for the answer there. I am using DM3730 processor (linux 2.6.37 ICS from TI's website) and I guess for that the relevant files for suspend resume would be

    -arch/arm/mach-omap2/pm34xx.c with other files same as you suggested.

    You mentioned

    DeepSleep0 wakeup sources supported:  UART0, Touchscreen, GPIO0, RTC, I2C0

    when in DeepSleep0 and I touch the touchscreen nothing seems to happen. The touchscreen driver I am using is ADS7846.c

    Could you shed some light on how to get wakeup from DeepSleep0 using touchscreen.

    I have got the suspend / resume handlers for my backlight driver. Once I got basic idea of how to get into DeepSleep0, standby and wakeup from it I guess rest all will fill in place. Also I want to get into DeepSleep0 and standby not from commandline but from within code.


    Thanks

    Ali

  • Hello Ali,

    Touchscreen wake-up
    Wake-up from standby mode is possible via internal TSC-ADC module. Pressing the touchscreen will cause a wake-up.

    I think that in your case you must use wake-up by GPIO interface.

    General Purpose I/O (GPIO) Interface
    The general-purpose interface combines six general-purpose input/output (GPIO) banks.

    Each GPIO module provides 32 dedicated general-purpose pins with input and output capabilities; thus, the general-purpose interface supports up to 192 (6 x 32) pins.

    These pins can be configured for the following applications:

    Data input (capture)/output (drive)
    Keyboard interface with a debounce cell
    Interrupt generation in active mode upon the detection of external events. Detected events are processed by two parallel independent interrupt-generation submodules to support biprocessor operations.
    Wake-up request generation in idle mode upon the detection of external events.

    Wake-up feature is already implemented in ADS7846.c file - lxr.free-electrons.com/.../ads7846.c

    Take a look on the patch, which enable wake-up from ads7846 touchscreen:
    lists.infradead.org/.../014768.html

    Best regards,
    Yanko
  • Hi Yanko,

    Thanks for the reply. That is exactly what I was hoping to achieve but can not see it happening as I am getting lost.

    When I issue the echo mem > sys/power/state command terminal goes into suspend mode DeepSleep0 The debug statement I get is
    [ 57.804840] request_suspend_state: sleep (0->3) at 57992674381 (2015-05-11 13:21:21.714811830 UTC)
    [ 57.814758] hawkIII-backlight display0: Disable LCD
    Thats it nothing after that. I dont get the ads7846_suspend happening. I have put printk statement in the routine.
    On touch the IRQ does not seem to happen and hence does not proceed any further.

    Am i missing something here?

    Regards
    Ali
  • Hi Yanko,

    Update on this is that IRQ from ADS7846 does seem to occur when touch is detected in suspend mode.

    Regards

    Ali
  • Hi Ali,

    The only option which I can suggest you are these patches:

    arago-project.org/.../projects;a=shortlog;h=refs/heads/OMAPPSP_03.00.01.06

    Take a look on e2e.ti.com/.../94049
    Unfortunately, I don't have DM3730 board and I cannot replicate your use case.

    Best regards,
    Yanko
  • Hi Yanko,

    Thanks for your reply. Can you please help me with this rather than suspend resume cos I think if this gets sorted out reset also will. How can i suspend my ADS7846 driver from within Kernel code on certain condition.

    Regards

    Ali

  • Hello Ali,

    ADS7846 driver supports a suspend functionality. I think that you must check if your ADS7846 is enabled in .config file.
    /board-support/linux/.config:
    1180 # CONFIG_INPUT_TABLET is not set
    1181 CONFIG_INPUT_TOUCHSCREEN=y
    1182: CONFIG_TOUCHSCREEN_ADS7846=y
    1183 # CONFIG_TOUCHSCREEN_AD7877 is not set
    1184 # CONFIG_TOUCHSCREEN_AD7879 is not set

    Please see in the file:
    board-support/linux/drivers/input/touchscreen/ads7846.c
    /*--------------------------------------------------------------------------*/
    157
    158: /* The ADS7846 has touchscreen and other sensors.
    159 * Earlier ads784x chips are somewhat compatible.
    160 */
    ...
    201
    202 /* Must be called with ts->lock held */
    203: static void ads7846_stop(struct ads7846 *ts)
    204 {
    205 if (!ts->disabled && !ts->suspended) {
    ...
    213
    214 /* Must be called with ts->lock held */
    215: static void ads7846_restart(struct ads7846 *ts)
    216 {
    217 if (!ts->disabled && !ts->suspended) {
    ...
    224
    225 /* Must be called with ts->lock held */
    226: static void __ads7846_disable(struct ads7846 *ts)
    227 {
    228: ads7846_stop(ts);
    229 regulator_disable(ts->reg);

    Please check the configurations in /etc/suspend.conf before attempting to suspend

    Best regards,
    Yanko
  • Hi yanko,

    Thanks for the reply. I have just had a look at above suggested and all seems to be there. #defines are defined and all handler functions are present with locks. I cant seem to understand how things are working. I have also got early_suspend enabled as the kernel is from TI's website for ICS for DM3730.

    The other thing is that the ADS driver is not added as a platform device

    static struct platform_device *HAWK_III_devices[] __initdata = {
        &HAWK_III_dss_device,    // DSS Device Backlight etc
        &androidusb_device,        // USB OTG Debug Port
    };

    DSS device only contains backlight driver, which enables LCD by toggling GPIO pin when does get called when performing suspend from command line

    echo mem > sys/power/state

    Regards

    Ali

  • Hello Ali,

    ADS7846 touchcontroller supports following features:
    QSPITM/SPITM 3-WIRE INTERFACE
    AUTO POWER-DOWN

    To enter in auto power-down mode it is needed PENIRQ pin to be pulled up. Please check on your board schematic if this pin is pulled up.

    Could you provide more details about how you try to suspend your system?
    You can send me a log file with messages.

    Best regards,
    Yanko
  • Hi Yanko,

    The PENIRQ pin is connected to GPIO 27 on processor which is configured as input and on screen touch does cause an interrupt to take place.

    I am not sure the right method to do suspend. I am getting confused now. As mentioned previously I am using

    echo mem > sys/power/state to suspend (Is this not the right method in User Space). This is done when board has booted up and I enter the adb shell prompt and issue this command.

    The above command is issued from User Space, what I want to know is how can I get the kernel to do suspend when the back-light timer expires i.e in kernel space.

    The logs are below

    Texas Instruments X-Loader 1.51 (Sep  3 2014 - 04:15:14)
    Booting from nand . . .
    Starting OS Bootloader...


    U-Boot 2010.06 (Sep 03 2014 - 04:15:37)

    OMAP34xx/35xx-GP ES2.1, CPU-OPP2 L3-165MHz
    TOUCHSTAR HAWKIII Board + LPDDR/NAND
    I2C:   ready
    DRAM:  256 MiB
    NAND:  512 MiB
    In:    serial
    Out:   serial
    Err:   serial
    Net:   smc911x-0
    Hit any key to stop autoboot:  1 0
    mmc1 is available
    reading uImage

    3598876 bytes read
    ## Booting kernel from Legacy Image at 80000000 ...
       Image Name:   Linux-2.6.37-00012-gb538662
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    3598812 Bytes = 3.4 MiB
       Load Address: 80008000
       Entry Point:  80008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    OK

    Starting kernel ...

    [    0.000000] Linux version 2.6.37-00012-gb538662 (ali@ubuntu) (gcc version 4.4.3 (GCC) ) #3 Thu May 14 02:39:07 PDT 2015
    [    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7f
    [    0.000000] CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] Machine: TOUCHSTAR HAWKIII
    [    0.000000] Reserving 33554432 bytes SDRAM for VRAM
    [    0.000000] Memory policy: ECC disabled, Data cache writeback
    [    0.000000] OMAP3630 ES1.2 (l2cache iva sgx neon isp 192mhz_clk )
    [    0.000000] SRAM: Mapped pa 0x40200000 to va 0xfe400000 size: 0x10000
    [    0.000000] On node 0 totalpages: 57344
    [    0.000000] free_area_init_node: node 0, pgdat c071577c, node_mem_map c07e5000
    [    0.000000]   Normal zone: 512 pages used for memmap
    [    0.000000]   Normal zone: 0 pages reserved
    [    0.000000]   Normal zone: 56832 pages, LIFO batch:15
    [    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
    [    0.000000] pcpu-alloc: [0] 0
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 56832
    [    0.000000] Kernel command line: init=/init mem=256M noinitrd rw omap_vout.vid1_static_vrfb_alloc=y vram=32M omapfb.vram=0:16M rootdelay=1 rootwait root=/dev/mmcblk0p2 ip=off rootfstype=ext3 ethaddr=00:11:22:33:44:55 console=ttyO2,115200n8 androidboot.console=ttyO2
    [    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    [    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    [    0.000000] Memory: 224MB = 224MB total
    [    0.000000] Memory: 219004k/219004k available, 43140k reserved, 0K highmem
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    [    0.000000]     DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    [    0.000000]     vmalloc : 0xd0800000 - 0xf8000000   ( 632 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
    [    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
    [    0.000000]       .init : 0xc0008000 - 0xc0041000   ( 228 kB)
    [    0.000000]       .text : 0xc0041000 - 0xc06ca000   (6692 kB)
    [    0.000000]       .data : 0xc06ca000 - 0xc071ac40   ( 324 kB)
    [    0.000000] NR_IRQS:409
    [    0.000000] Clocking rate (Crystal/Core/MPU): 26.0/400/800 MHz
    [    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 4.0) with 96 interrupts
    [    0.000000] Total of 96 interrupts on 1 active controller
    [    0.000000] GPMC revision 5.0
    [    0.000000] Trying to install interrupt handler for IRQ402
    [    0.000000] Trying to install interrupt handler for IRQ403
    [    0.000000] Trying to install interrupt handler for IRQ404
    [    0.000000] Trying to install interrupt handler for IRQ405
    [    0.000000] Trying to install interrupt handler for IRQ406
    [    0.000000] Trying to install interrupt handler for IRQ407
    [    0.000000] Trying to install interrupt handler for IRQ408
    [    0.000000] Trying to install type control for IRQ409
    [    0.000000] Trying to set irq flags for IRQ409
    [    0.000000] OMAP clockevent source: GPTIMER1 at 32768 Hz
    [    0.000000] Console: colour dummy device 80x30
    [    0.000000] Calibrating delay loop... 799.29 BogoMIPS (lpj=3121152)
    [    0.000000] pid_max: default: 32768 minimum: 301
    [    0.000000] Security Framework initialized
    [    0.000000] Mount-cache hash table entries: 512
    [    0.000000] CPU: Testing write buffer coherency: ok
    [    0.000000] regulator: core version 0.5
    [    0.000000] regulator: dummy:
    [    0.000000] NET: Registered protocol family 16
    [    0.000000] gpiochip_add: gpios 0..31 (gpio) Success to register
    [    0.000000] OMAP GPIO hardware version 2.5
    [    0.000000] gpiochip_add: gpios 32..63 (gpio) Success to register
    [    0.000000] OMAP GPIO hardware version 2.5
    [    0.000000] gpiochip_add: gpios 64..95 (gpio) Success to register
    [    0.000000] OMAP GPIO hardware version 2.5
    [    0.000000] gpiochip_add: gpios 96..127 (gpio) Success to register
    [    0.000000] OMAP GPIO hardware version 2.5
    [    0.000000] gpiochip_add: gpios 128..159 (gpio) Success to register
    [    0.000000] OMAP GPIO hardware version 2.5
    [    0.000000] gpiochip_add: gpios 160..191 (gpio) Success to register
    [    0.000000] OMAP GPIO hardware version 2.5
    [    0.000000] omap_mux_init: Add partition: #1: core, flags: 0
    [    0.000000] GPIO_129 set for Amplifier Enabled
    [    0.000000] GPIO_24 set for USB Reset
    [    0.000000] GPIO_138 set for IO_CS0
    [    0.000000] GPIO_136 set for IO_CS1
    [    0.000000] GPIO_137 set for ETH_RST
    [    0.000000] GPIO_29 set for ETH_IRQ
    [    0.000000] GPIO_28 set for nIO_IRQ
    [    0.000000] GPIO_26 set for WAKE_UP
    [    0.000000] hw-breakpoint: debug architecture 0x4 unsupported.
    [    0.000000] OMAP DMA hardware revision 5.0
    [    0.023162] bio: create slab <bio-0> at 0
    [    0.024322] regulator: vwl1271: 1800 mV
    [    0.025604] SCSI subsystem initialized
    [    0.026275] spi spi2.0: setup: speed 1500000, sample leading edge, clk normal
    [    0.026519] spi spi2.1: setup: speed 12000000, sample leading edge, clk normal
    [    0.026733] IO Expander 1 spi2.1: setup: speed 12000000, sample leading edge, clk normal
    [    0.029205] gpiochip_add: gpios 212..227 (IO Expander 1) Success to register
    [    0.029479] spi spi2.2: setup: speed 12000000, sample leading edge, clk normal
    [    0.029724] IO Expander 2 spi2.2: setup: speed 12000000, sample leading edge, clk normal
    [    0.032196] gpiochip_add: gpios 228..243 (IO Expander 2) Success to register
    [    0.033935] usbcore: registered new interface driver usbfs
    [    0.034240] usbcore: registered new interface driver hub
    [    0.034423] usbcore: registered new device driver usb
    [    0.044006] omap_i2c omap_i2c.1: bus 1 rev4.0 at 2600 kHz
    [    0.046783] twl4030: PIH (irq 7) chaining IRQs 368..375
    [    0.046813] twl4030: power (irq 373) chaining IRQs 376..383
    [    0.047271] twl4030: gpio (irq 368) chaining IRQs 384..401
    [    0.047424] gpiochip_add: gpios 192..211 (twl4030) Success to register
    [    0.049774] regulator: VUSB1V5: 1500 mV normal standby
    [    0.050292] regulator: VUSB1V8: 1800 mV normal standby
    [    0.050811] regulator: VUSB3V1: 3100 mV normal standby
    [    0.053955] twl4030_usb twl4030_usb: Initialized TWL4030 USB module
    [    0.056060] regulator: VIO: 1800 mV normal standby
    [    0.056671] regulator: VMMC1: 1850 <--> 3150 mV at 3000 mV normal standby
    [    0.057250] regulator: VDAC: 1800 mV normal standby
    [    0.057830] regulator: VAUX2_4030: 2800 mV normal standby
    [    0.058410] regulator: VPLL2: 1800 mV normal standby
    [    0.059020] regulator: VSIM: 1800 <--> 3000 mV at 1800 mV normal standby
    [    0.059234] omap_i2c omap_i2c.2: bus 2 rev4.0 at 400 kHz
    [    0.067443] omap_i2c omap_i2c.3: bus 3 rev4.0 at 400 kHz
    [    0.068725] Advanced Linux Sound Architecture Driver Version 1.0.23.
    [    0.069427] Bluetooth: Core ver 2.15
    [    0.069580] NET: Registered protocol family 31
    [    0.069610] Bluetooth: HCI device and connection manager initialized
    [    0.069610] Bluetooth: HCI socket layer initialized
    [    0.069976] Switching to clocksource 32k_counter
    [    0.092163] musb-hdrc: version 6.0, otg (peripheral+host), debug=0
    [    0.092285] musb-hdrc musb-hdrc.0: dma type: dma-inventra
    [    0.092285] HS USB OTG: revision 0x40, sysconfig 0x2001, sysstatus 0x1, intrfsel 0x1, simenable  0x0
    [    0.092346] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
    [    0.092346] musb-hdrc: MHDRC RTL version 1.800
    [    0.092376] musb-hdrc: setup fifo_mode 4
    [    0.092376] musb-hdrc: 28/31 max ep, 16384/16384 memory
    [    0.092559] musb-hdrc musb-hdrc.0: USB OTG mode controller at fa0ab000 using DMA, IRQ 92
    [    0.092590] Registered /proc/driver/musb_hdrc.0
    [    0.093048] NET: Registered protocol family 2
    [    0.093200] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.093627] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
    [    0.093750] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
    [    0.093841] TCP: Hash tables configured (established 8192 bind 8192)
    [    0.093872] TCP reno registered
    [    0.093872] UDP hash table entries: 256 (order: 0, 4096 bytes)
    [    0.093902] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    [    0.094055] NET: Registered protocol family 1
    [    0.094360] RPC: Registered udp transport module.
    [    0.094360] RPC: Registered tcp transport module.
    [    0.094390] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    0.094543] NetWinder Floating Point Emulator V0.97 (double precision)
    [    0.095550] omap-iommu omap-iommu.0: isp registered
    [    0.217041] ashmem: initialized
    [    0.217468] VFS: Disk quotas dquot_6.5.2
    [    0.217529] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
    [    0.218750] JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
    [    0.219268] yaffs: yaffs built May 14 2015 00:16:08 Installing.
    [    0.219299] msgmni has been set to 427
    [    0.220428] io scheduler noop registered
    [    0.220428] io scheduler deadline registered
    [    0.220550] io scheduler cfq registered (default)
    [    0.281250] OMAP DSS rev 2.0
    [    0.281311] OMAP DISPC rev 3.0
    [    0.281372] OMAP VENC rev 2
    [    0.281616] OMAP DSI rev 1.0
    [    0.445251] backlight_device_register: name=sharp-ls
    [    0.458312] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
    [    0.459899] omap_uart.0: ttyO0 at MMIO 0x4806a000 (irq = 72) is a OMAP UART0
    [    0.460235] omap_uart.1: ttyO1 at MMIO 0x4806c000 (irq = 73) is a OMAP UART1
    [    0.460510] omap_uart.2: ttyO2 at MMIO 0x49020000 (irq = 74) is a OMAP UART2
    [    1.351043] console [ttyO2] enabled
    [    1.355041] omap_uart.3: ttyO3 at MMIO 0x49042000 (irq = 80) is a OMAP UART3
    [    1.371551] brd: module loaded
    [    1.379119] loop: module loaded
    [    1.384826] mtdoops: mtd device (mtddev=name/number) must be supplied
    [    1.391601] omap2-nand driver initializing
    [    1.396240] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xbc (Micron )
    [    1.403228] Creating 5 MTD partitions on "omap2-nand.0":
    [    1.408813] 0x000000000000-0x000000080000 : "X-Loader-NAND"
    [    1.416320] 0x000000080000-0x0000001c0000 : "U-Boot-NAND"
    [    1.423797] 0x0000001c0000-0x000000280000 : "Boot Env-NAND"
    [    1.431152] 0x000000280000-0x000000780000 : "Kernel-NAND"
    [    1.440124] 0x000000780000-0x000020000000 : "File System - NAND"
    [    1.656097] OneNAND driver initializing
    [    1.661529] smsc911x: Driver version 2008-10-21.
    [    1.667755] smsc911x-mdio: probed
    [    1.671356] eth0: attached PHY driver [SMSC LAN8700] (mii_bus:phy_addr=ffffffff:01, irq=-1)
    [    1.681427] net eth0: MAC Address: e6:7e:51:c6:18:8d
    [    1.686981] usbcore: registered new interface driver asix
    [    1.692810] usbcore: registered new interface driver cdc_ether
    [    1.699096] usbcore: registered new interface driver net1080
    [    1.705200] usbcore: registered new interface driver cdc_subset
    [    1.711547] usbcore: registered new interface driver zaurus
    [    1.717529] usbcore: registered new interface driver zd1201
    [    1.723388] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [    1.730316] ehci-omap.0 supply hsusb0 not found, using dummy regulator
    [    2.742004] ehci-omap ehci-omap.0: OMAP-EHCI Host Controller
    [    2.747985] ehci-omap ehci-omap.0: new USB bus registered, assigned bus number 1
    [    2.755981] ehci-omap ehci-omap.0: irq 77, io mem 0x48064800
    [    2.773345] ehci-omap ehci-omap.0: USB 2.0 started, EHCI 1.00
    [    2.779418] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    [    2.786560] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [    2.794128] usb usb1: Product: OMAP-EHCI Host Controller
    [    2.799713] usb usb1: Manufacturer: Linux 2.6.37-00012-gb538662 ehci_hcd
    [    2.806732] usb usb1: SerialNumber: ehci-omap.0
    [    2.812347] hub 1-0:1.0: USB hub found
    [    2.816284] hub 1-0:1.0: 3 ports detected
    [    2.851654] Initializing USB Mass Storage driver...
    [    2.856994] usbcore: registered new interface driver usb-storage
    [    2.863281] USB Mass Storage support registered.
    [    2.868316] usbcore: registered new interface driver usbtest
    [    2.874237] android init
    [    2.876953] android_probe pdata: c06da680
    [    2.881317] android_bind
    [    2.884002] android_bind_config
    [    2.887847] android_usb gadget: android_usb ready
    [    2.892822] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
    [    2.898437] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 2
    [    2.906250] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
    [    2.913360] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [    2.920959] usb usb2: Product: MUSB HDRC host driver
    [    2.926177] usb usb2: Manufacturer: Linux 2.6.37-00012-gb538662 musb-hcd
    [    2.933197] usb usb2: SerialNumber: musb-hdrc.0
    [    2.938720] hub 2-0:1.0: USB hub found
    [    2.942657] hub 2-0:1.0: 1 port detected
    [    2.947387] f_adb init
    [    2.949859] android_register_function adb
    [    2.954101] f_mass_storage init
    [    2.957580] android_register_function usb_mass_storage
    [    2.962982] adb_bind_config
    [    2.966583] android_usb gadget: invalid number of LUNs: 0
    [    2.972717] mice: PS/2 mouse device common for all mice
    [    2.979034] ads7846 spi2.0: setup: speed 1500000, sample leading edge, clk normal
    [    2.987640] ads7846 spi2.0: touchscreen, irq 187
    [    2.993072] input: ADS7846 Touchscreen as /devices/platform/omap2_mcspi.2/spi2.0/input/input0
    [    3.003448] input: twl4030_pwrbutton as /devices/platform/omap/omap_i2c.1/i2c-1/1-0049/twl4030_pwrbutton/input/input1
    [    3.016479] using rtc device, twl_rtc, for alarms
    [    3.021240] twl_rtc twl_rtc: rtc core: registered twl_rtc as rtc0
    [    3.029907] i2c /dev entries driver
    [    3.034729] Linux media interface: v0.10
    [    3.039031] Linux video capture interface: v2.00
    [    3.044647] usbcore: registered new interface driver uvcvideo
    [    3.050720] USB Video Class driver (v1.0.0)
    [    3.055786] OMAP Watchdog Timer Rev 0x31: initial timeout 60 sec
    [    3.062530] device-mapper: uevent: version 1.0.3
    [    3.067840] device-mapper: ioctl: 4.18.0-ioctl (2010-06-29) initialised: dm-devel@redhat.com
    [    3.076782] Bluetooth: HCI UART driver ver 2.2
    [    3.081451] Bluetooth: HCI H4 protocol initialized
    [    3.086486] Bluetooth: HCILL protocol initialized
    [    3.091400] Bluetooth: Bluetooth Driver for TI WiLink - Version 1.0
    [    3.098358] cpuidle: using governor ladder
    [    3.102691] cpuidle: using governor menu
    [    3.111724] mmci-omap-hs.1 supply vmmc_aux not found, using dummy regulator
    [    3.120849] usbcore: registered new interface driver usbhid
    [    3.126708] usbhid: USB HID core driver
    [    3.131408] logger: created 64K log 'log_main'
    [    3.136322] logger: created 256K log 'log_events'
    [    3.141479] logger: created 64K log 'log_radio'
    [    3.146453] logger: created 64K log 'log_system'
    [    3.152252] usbcore: registered new interface driver snd-usb-audio
    [    3.159729] OMAP3 EVM SoC init
    [    3.219970] usb 1-1: new high speed USB device using ehci-omap and address 2
    [    3.231201] asoc: twl4030-hifi <-> omap-mcbsp-dai.1 mapping ok
    [    3.238555] ALSA device list:
    [    3.241668]   #0: omap3evm
    [    3.244537] oprofile: hardware counters not available
    [    3.249847] oprofile: using timer interrupt.
    [    3.254455] nf_conntrack version 0.5.0 (3421 buckets, 13684 max)
    [    3.261138] ip_tables: (C) 2000-2006 Netfilter Core Team
    [    3.266845] TCP cubic registered
    [    3.270233] Initializing XFRM netlink socket
    [    3.275024] NET: Registered protocol family 10
    [    3.280334] IPv6 over IPv4 tunneling driver
    [    3.285644] NET: Registered protocol family 17
    [    3.290374] NET: Registered protocol family 15
    [    3.295166] Bluetooth: L2CAP ver 2.15
    [    3.299041] Bluetooth: L2CAP socket layer initialized
    [    3.304321] Bluetooth: SCO (Voice Link) ver 0.6
    [    3.309082] Bluetooth: SCO socket layer initialized
    [    3.314270] Bluetooth: RFCOMM TTY layer initialized
    [    3.319396] Bluetooth: RFCOMM socket layer initialized
    [    3.324798] Bluetooth: RFCOMM ver 1.11
    [    3.328735] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
    [    3.334289] Bluetooth: BNEP filters: protocol multicast
    [    3.339752] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
    [    3.346313] Registering the dns_resolver key type
    [    3.351318] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    [    3.359802] ThumbEE CPU extension supported.
    [    3.369934] Power Management for TI OMAP3.
    [    3.379364] smartreflex smartreflex.0: omap_sr_probe: SmartReflex driver initialized
    [    3.387634] smartreflex smartreflex.1: omap_sr_probe: SmartReflex driver initialized
    [    3.396148] SmartReflex Class3 initialized
    [    3.403900] clock: disabling unused clocks to save power
    [    3.410369] platform iva.0: omap_voltage_scale: Already at the requestedrate 800000000
    [    3.418670] platform mpu.0: omap_voltage_scale: Already at the requestedrate 1000000000
    [    3.427093] usb 1-1: New USB device found, idVendor=0424, idProduct=2514
    [    3.434082] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
    [    3.444213] hub 1-1:1.0: USB hub found
    [    3.448242] hub 1-1:1.0: 4 ports detected
    [    3.531524] mmc0: new high speed SDHC card at address aaaa
    [    3.538482] mmcblk0: mmc0:aaaa SU04G 3.69 GiB
    [    3.548522]  mmcblk0: p1 p2 p3
    [    3.622985] hawkIII-backlight display0: Enable LCD
    [    3.630157] twl_rtc twl_rtc: setting system clock to 2000-01-01 21:14:40 UTC (946761280)
    [    3.638916] omap_vout omap_vout: Buffer Size = 3686400
    [    3.657714] omap_vout omap_vout: : registered and initialized video device 0
    [    3.665130] omap_vout omap_vout: Buffer Size = 3686400
    [    3.671417] omap_vout omap_vout: : registered and initialized video device 1
    [    3.679229] Waiting 1sec before mounting root device...
    [    3.812652] usb 1-1.1: new high speed USB device using ehci-omap and address 3
    [    3.938049] usb 1-1.1: New USB device found, idVendor=0424, idProduct=2660
    [    3.945220] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
    [    3.953796] hub 1-1.1:1.0: USB hub found
    [    3.958068] hub 1-1.1:1.0: 3 ports detected
    [    4.250152] usb 1-1.1.1: new high speed USB device using ehci-omap and address 4
    [    4.381530] usb 1-1.1.1: New USB device found, idVendor=0424, idProduct=4040
    [    4.388885] usb 1-1.1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [    4.396697] usb 1-1.1.1: Product: Ultra Fast Media Reader
    [    4.402343] usb 1-1.1.1: Manufacturer: Generic
    [    4.406951] usb 1-1.1.1: SerialNumber: 000008264001
    [    4.413177] scsi0 : usb-storage 1-1.1.1:1.0
    [    4.690734] EXT3-fs: barriers not enabled
    [    4.695648] kjournald starting.  Commit interval 5 seconds
    [    4.706787] EXT3-fs (mmcblk0p2): using internal journal
    [    4.712249] EXT3-fs (mmcblk0p2): mounted filesystem with ordered data mode
    [    4.719451] VFS: Mounted root (ext3 filesystem) on device 179:2.
    [    4.725769] Freeing init memory: 228K
    [    4.746978] init (1): /proc/1/oom_adj is deprecated, please use /proc/1/oom_score_adj instead.
    [    4.865936] init: cannot open '/initlogo.rle'
    [    4.913635] Compat-wireless backport release: compat-wireless-2011-12-05-1-g84dbe2c
    [    4.921661] Backport based on wl12xx.git v2.6.39-1328-g0890f48
    [    4.992553] cfg80211: Calling CRDA to update world regulatory domain
    [    5.176696] init: cannot find '/system/etc/install-recovery.sh', disabling 'flash_recovery'
    [    5.293640] enabling adb
    [    5.297912] adb_open
    [    5.415954] scsi 0:0:0:0: Direct-Access     Generic  Ultra HS-COMBO   1.98 PQ: 0 ANSI: 0
    [    5.426513] scsi 0:0:0:1: Direct-Access     Generic  Ultra HS-SD/MMC2 1.98 PQ: 0 ANSI: 0
    [    5.446960] sd 0:0:0:0: [sda] Attached SCSI removable disk
    [    5.454895] sd 0:0:0:1: [sdb] Attached SCSI removable disk
    [    5.496948] cfg80211: World regulatory domain updated:
    [    5.502380] cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
    [    5.511077] cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
    [    5.519348] cfg80211:     (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
    [    5.527587] cfg80211:     (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
    [    5.535919] cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
    [    5.544158] cfg80211:     (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
    root@android:/ # [    6.787170] android_usb gadget: high speed config #1: android
    [    6.793182] musb-hdrc periph: enabled ep1in for bulk IN, dma, maxpacket 512
    [    6.800415] musb-hdrc periph: enabled ep1out for bulk OUT, dma, maxpacket 512
    [    7.075408] init: untracked pid 1100 exited
    [   13.904052] warning: `zygote' uses 32-bit capabilities (legacy support in use)
    [   17.568176] backlight: set brightness to 0
    [   17.587036] request_suspend_state: wakeup (3->0) at 17774810794 (2000-01-01 21:14:54.450531007 UTC)
    [   17.609649] backlight: set brightness to 100
    [   18.304626] net eth0: SMSC911x/921x identified at 0xd0880000, IRQ: 189
    [   28.499877] eth0: no IPv6 routers present
    [   48.355377] init: untracked pid 1292 exited
    [   80.375549] backlight: set brightness to 95
    [   80.393310] backlight: set brightness to 90
    [   80.408843] backlight: set brightness to 85
    [   80.425201] backlight: set brightness to 81
    [   80.441192] backlight: set brightness to 76
    [   80.457366] backlight: set brightness to 72
    [   80.473815] backlight: set brightness to 67
    [   80.490051] backlight: set brightness to 63
    [   80.506408] backlight: set brightness to 58
    [   80.521911] backlight: set brightness to 53
    [   80.537963] backlight: set brightness to 49
    [   80.554565] backlight: set brightness to 44
    [   80.570953] backlight: set brightness to 40
    [   80.587219] backlight: set brightness to 35
    [   80.602874] backlight: set brightness to 30
    [   80.619781] backlight: set brightness to 26
    [   80.636474] backlight: set brightness to 21
    [   80.653686] backlight: set brightness to 16
    [   80.670318] backlight: set brightness to 12
    [   80.685882] backlight: set brightness to 7
    =========================================== Issued "echo mem > sys/power/state" after adb shell ===============================
    [79526.179931] request_suspend_state: sleep (0->3) at 79526367713212 (2000-01-02 19:20:03.043433425 UTC)
    [79526.190216] hawkIII-backlight display0: Disable LCD
    =========================================== Issued "echo on > sys/power/state" in adb shell ===============================
    [79610.617401] request_suspend_state: wakeup (3->0) at 79610805212388 (2000-01-02 19:21:27.480932601 UTC)
    [79610.687561] hawkIII-backlight display0: Enable LCD

  • Hello Ali,

    The PENIRQ pin is connected to GPIO 27 on processor which is configured as input and on screen touch does cause an interrupt to take place.

    - Could you check if GPIO27 is pulled up by the internal pull up resistor? 

    The above command is issued from User Space, what I want to know is how can I get the kernel to do suspend when the back-light timer expires i.e in kernel space.

    There are some scenarios for suspending your system. More detail information you can find in this link - https://www.kernel.org/doc/Documentation/power/runtime_pm.txt

    I think that you must apply some changes in kernel. 

    Best regards,

    Yanko

  • Hi yanko,

    This is how its set.

    OMAP3_MUX(ETK_D13, OMAP_MUX_MODE4 | OMAP_PIN_INPUT)

    internal pull up resistor not enabled.

    Regards

    Ali
  • Hello Ali,

    Can you try to enable this pull-up and then try to suspend?

    Best regards,
    Yanko
  • Hi Yanko,


    This is what I tried,

    OMAP3_MUX(ETK_D13, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),

    Suspend using

    echo mem > sys/power/state (Backlight GPIO low turns LCD Off)

    On touching the screen Debug comes out see below.

    [   42.359954] request_suspend_state: sleep (0->3) at 42547393857 (2015-05-18 13:13:05.225921687 UTC)
    [   42.369873] hawkIII-backlight display0: Disable LCD
    [   48.278533] ads7846 spi2.0: ignored 0 pressure 379
    [   48.293182] ads7846 spi2.0: ignored 1 pressure 714
    [   48.309234] ads7846 spi2.0: DOWN
    [   48.312591] ads7846 spi2.0: 3727/2741/ 230
    [   48.340148] ads7846 spi2.0: ignored 1 pressure 238
    [   48.360015] ads7846 spi2.0: ignored 1 pressure 112
    [   48.376434] ads7846 spi2.0: ignored 1 pressure 17
    [   48.395965] ads7846 spi2.0: 3756/2732/ 203
    [   48.415191] ads7846 spi2.0: ignored 1 pressure 239
    [   48.426300] ads7846 spi2.0: 3745/2692/ 165
    [   48.445587] ads7846 spi2.0: ignored 1 pressure 236
    [   48.462463] ads7846 spi2.0: 3755/2690/ 149
    [   48.482238] ads7846 spi2.0: 3760/2676/ 148
    [   48.494964] ads7846 spi2.0: 3745/2610/ 146
    [   48.507659] ads7846 spi2.0: 3745/2602/ 141
    [   48.521911] ads7846 spi2.0: 3735/2578/ 140
    [   48.533996] ads7846 spi2.0: 3740/2557/ 140
    [   48.548492] ads7846 spi2.0: 3749/2539/ 141
    [   48.563018] ads7846 spi2.0: 3758/2514/ 141
    [   48.579528] ads7846 spi2.0: 3789/2465/ 150
    [   48.589996] ads7846 spi2.0: 3781/2411/ 146
    [   48.607910] ads7846 spi2.0: 3776/2364/ 149
    [   48.620574] ads7846 spi2.0: 3782/2316/ 149
    [   48.635040] ads7846 spi2.0: 3773/2282/ 143
    [   48.649841] ads7846 spi2.0: 3778/2269/ 143
    [   48.664154] ads7846 spi2.0: 3786/2249/ 147
    [   48.674682] ads7846 spi2.0: 3789/2224/ 150
    [   48.683776] ads7846 spi2.0: 3789/2199/ 149
    [   48.698181] ads7846 spi2.0: 3787/2151/ 148
    [   48.714080] ads7846 spi2.0: 3778/2117/ 138
    [   48.728454] ads7846 spi2.0: 3767/2043/ 145
    [   48.737152] ads7846 spi2.0: 3777/1985/ 145
    [   48.750122] ads7846 spi2.0: 3778/1952/ 144
    [   48.760620] ads7846 spi2.0: 3770/1907/ 143
    [   48.772216] ads7846 spi2.0: 3764/1888/ 142
    [   48.784545] ads7846 spi2.0: 3742/1827/ 138
    [   48.799224] ads7846 spi2.0: 3735/1782/ 135
    [   48.807922] ads7846 spi2.0: 3730/1767/ 134
    [   48.822692] ads7846 spi2.0: 3734/1715/ 135
    [   48.836883] ads7846 spi2.0: 3743/1686/ 137
    [   48.848663] ads7846 spi2.0: 3747/1643/ 139
    [   48.862548] ads7846 spi2.0: 3747/1584/ 148
    [   48.881408] ads7846 spi2.0: 3733/1549/ 146
    [   48.896911] ads7846 spi2.0: 3751/1422/ 146
    [   48.919250] ads7846 spi2.0: 3749/1334/ 146
    [   48.941467] ads7846 spi2.0: ignored 1 pressure 10
    [   48.958160] ads7846 spi2.0: 3751/1080/ 154
    [   48.972808] ads7846 spi2.0: 3736/1034/ 152
    [   48.990264] ads7846 spi2.0: ignored 1 pressure 9215
    [   49.013549] ads7846 spi2.0: 3734/ 912/ 174
    [   49.034332] ads7846 spi2.0: ignored 1 pressure 18
    [   49.049438] ads7846 spi2.0: ignored 1 pressure 18
    [   49.067077] ads7846 spi2.0: ignored 1 pressure 22
    [   49.078369] ads7846 spi2.0: UP

    The LCD display is off and no debug for request_suspend_state: wakeup(3->0)

    The kernel is TI's kernel for ICS.

    Regards

    Ali

  • Hello Ali,

    It seems that some processes use SPI and it cannot be suspended.

    My suggestion is before to enter in suspend mode - check the activated task which use SPI. And stop this task, try to suspend device again.

    Best regards,
    Yanko