1
0
Fork 0
alistair23-linux/drivers/i2c/busses
Oleksandr Dmytryshyn 4368de19ed i2c: omap: correct usage of the interrupt enable register
We've been lucky not to have any interrupts fire during the suspend
path, otherwise we would have unpredictable behaviour in the kernel.

Based on the logic of the kernel code interrupts from i2c should be
prohibited during suspend. Kernel writes 0 to the I2C_IE register in
the omap_i2c_runtime_suspend() function. In the other side kernel
writes saved interrupt flags to the I2C_IE register in
omap_i2c_runtime_resume() function. I.e. interrupts should be disabled
during suspend.

This works for chips with version1 registers scheme. Interrupts are
disabled during suspend. For chips with version2 scheme registers
writting 0 to the I2C_IE register does nothing (because now the
I2C_IRQENABLE_SET register is located at this address). This register
is used to enable interrupts. For disabling interrupts
I2C_IRQENABLE_CLR register should be used.

Because the registers I2C_IRQENABLE_SET and I2C_IE have the same
addresses, the interrupt enabling procedure is unchanged.

I've checked that interrupts in the i2c controller are still enabled
after writting 0 to the I2C_IRQENABLE_SET register. With this patch
interrupts are disabled in the omap_i2c_runtime_suspend() function.

Patch is based on:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
tag: v3.10-rc2

Verified on OMAP4430.

Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2013-06-19 12:04:26 +02:00
..
Kconfig i2c: mv64xxx: Add Allwinner sun4i compatible 2013-06-15 13:37:48 +02:00
Makefile i2c: vt8500: Add support for I2C bus on Wondermedia SoCs 2013-06-15 13:37:08 +02:00
i2c-acorn.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
i2c-ali15x3.c i2c: remove __dev* attributes from subsystem 2012-12-22 20:13:45 +01:00
i2c-ali1535.c i2c: remove __dev* attributes from subsystem 2012-12-22 20:13:45 +01:00
i2c-ali1563.c i2c: remove __dev* attributes from subsystem 2012-12-22 20:13:45 +01:00
i2c-amd756-s4882.c i2c: Ignore return value of i2c_del_adapter() 2013-04-02 07:06:03 +02:00
i2c-amd756.c i2c: remove __dev* attributes from subsystem 2012-12-22 20:13:45 +01:00
i2c-amd8111.c i2c: remove __dev* attributes from subsystem 2012-12-22 20:13:45 +01:00
i2c-at91.c i2c: at91: convert to dma_request_slave_channel_compat() 2013-04-16 11:10:14 +02:00
i2c-au1550.c i2c: Remove unneeded xxx_set_drvdata(..., NULL) calls 2013-02-22 00:25:50 +01:00
i2c-bcm2835.c i2c: add bcm2835 driver 2013-02-12 11:33:59 +01:00
i2c-bfin-twi.c i2c: bfin-twi: Read and write the FIFO in loop 2013-06-12 20:39:07 +02:00
i2c-cbus-gpio.c i2c: Ignore return value of i2c_del_adapter() 2013-04-02 07:06:03 +02:00
i2c-cpm.c i2c: use platform_{get,set}_drvdata() 2013-06-12 20:39:07 +02:00
i2c-davinci.c drivers/i2c/busses: don't check resource with devm_ioremap_resource 2013-06-12 20:39:06 +02:00
i2c-designware-core.c i2c: designware: fix race between subsequent xfers 2013-06-15 13:04:32 +02:00
i2c-designware-core.h i2c: designware: fix RX FIFO overrun 2013-05-17 10:33:11 +02:00
i2c-designware-pcidrv.c i2c: designware-pci: drop superfluous {get|put}_device 2013-04-19 20:22:10 +02:00
i2c-designware-platdrv.c drivers/i2c/busses: don't check resource with devm_ioremap_resource 2013-06-12 20:39:06 +02:00
i2c-diolan-u2c.c i2c: diolan-u2c: Fix master_xfer return code 2012-08-18 12:27:27 +02:00
i2c-eg20t.c i2c: Remove unneeded xxx_set_drvdata(..., NULL) calls 2013-02-22 00:25:50 +01:00
i2c-elektor.c i2c: remove __dev* attributes from subsystem 2012-12-22 20:13:45 +01:00
i2c-gpio.c i2c: gpio: Add support for deferred probing 2013-03-27 08:51:50 +01:00
i2c-highlander.c i2c: Remove unneeded xxx_set_drvdata(..., NULL) calls 2013-02-22 00:25:50 +01:00
i2c-hydra.c i2c: remove __dev* attributes from subsystem 2012-12-22 20:13:45 +01:00
i2c-i801.c i2c: i801: Document feature bits in modinfo 2013-05-17 22:49:30 +02:00
i2c-ibm_iic.c i2c: use platform_{get,set}_drvdata() 2013-06-12 20:39:07 +02:00
i2c-ibm_iic.h i2c-ibm_iic: Whitespace cleanup 2008-01-27 18:14:45 +01:00
i2c-imx.c drivers/i2c/busses: don't check resource with devm_ioremap_resource 2013-06-12 20:39:06 +02:00
i2c-iop3xx.c i2c: Remove unneeded xxx_set_drvdata(..., NULL) calls 2013-02-22 00:25:50 +01:00
i2c-iop3xx.h i2c-iop3xx: add iomem annotation 2011-01-04 00:53:37 +00:00
i2c-isch.c i2c: isch: Add module parameter for backbone clock rate if divider is unset 2013-02-11 15:53:49 +01:00
i2c-ismt.c i2c: ismt: remove duplicate const 2013-03-24 10:30:56 +01:00
i2c-mpc.c i2c: use platform_{get,set}_drvdata() 2013-06-12 20:39:07 +02:00
i2c-mv64xxx.c i2c: mv64xxx: Add Allwinner sun4i compatible 2013-06-15 13:37:48 +02:00
i2c-mxs.c i2c: mxs: Let device core handle pinctrl 2013-06-12 20:39:06 +02:00
i2c-nforce2-s4985.c i2c: Ignore return value of i2c_del_adapter() 2013-04-02 07:06:03 +02:00
i2c-nforce2.c i2c: nforce2: fix coding style issues 2013-01-28 05:26:42 +01:00
i2c-nomadik.c i2c: nomadik: allocate adapter number dynamically 2013-06-15 23:16:37 +02:00
i2c-nuc900.c i2c: remove __dev* attributes from subsystem 2012-12-22 20:13:45 +01:00
i2c-ocores.c Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2013-02-26 09:41:53 -08:00
i2c-octeon.c i2c: octeon: use HZ in timeout value 2013-04-23 18:29:11 +02:00
i2c-omap.c i2c: omap: correct usage of the interrupt enable register 2013-06-19 12:04:26 +02:00
i2c-parport-light.c i2c: remove __dev* attributes from subsystem 2012-12-22 20:13:45 +01:00
i2c-parport.c i2c-parport: i2c_parport_irq can be static 2012-10-05 22:23:53 +02:00
i2c-parport.h i2c-parport: Various cleanups 2011-05-24 20:58:49 +02:00
i2c-pasemi.c i2c: remove __dev* attributes from subsystem 2012-12-22 20:13:45 +01:00
i2c-pca-isa.c i2c: remove __dev* attributes from subsystem 2012-12-22 20:13:45 +01:00
i2c-pca-platform.c i2c: Remove unneeded xxx_set_drvdata(..., NULL) calls 2013-02-22 00:25:50 +01:00
i2c-piix4.c i2c: remove __dev* attributes from subsystem 2012-12-22 20:13:45 +01:00
i2c-pmcmsp.c i2c: Remove unneeded xxx_set_drvdata(..., NULL) calls 2013-02-22 00:25:50 +01:00
i2c-pnx.c i2c: Remove unneeded xxx_set_drvdata(..., NULL) calls 2013-02-22 00:25:50 +01:00
i2c-powermac.c i2c: Ignore return value of i2c_del_adapter() 2013-04-02 07:06:03 +02:00
i2c-puv3.c Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2013-05-02 14:38:53 -07:00
i2c-pxa-pci.c i2c: Remove unneeded xxx_set_drvdata(..., NULL) calls 2013-02-22 00:25:50 +01:00
i2c-pxa.c i2c-pxa: prepare clock before use 2013-06-18 18:11:32 +02:00
i2c-rcar.c drivers/i2c/busses: don't check resource with devm_ioremap_resource 2013-06-12 20:39:06 +02:00
i2c-s3c2410.c drivers/i2c/busses: don't check resource with devm_ioremap_resource 2013-05-18 11:55:32 +02:00
i2c-s6000.c i2c: Remove unneeded xxx_set_drvdata(..., NULL) calls 2013-02-22 00:25:50 +01:00
i2c-s6000.h i2c: Change mail address of Oskar Schirmer 2012-05-17 15:15:56 +02:00
i2c-scmi.c ACPI: Remove useless type argument of driver .remove() operation 2013-01-26 00:37:24 +01:00
i2c-sh7760.c i2c: Remove unneeded xxx_set_drvdata(..., NULL) calls 2013-02-22 00:25:50 +01:00
i2c-sh_mobile.c i2c: sh_mobile: don't send a stop condition by default inside transfers 2013-02-10 19:55:24 +01:00
i2c-sibyte.c i2c/mips: Fix error return codes from Sibyte i2c bus driver 2010-07-10 09:42:47 +02:00
i2c-simtec.c i2c/busses: Use module_platform_driver() 2012-01-12 20:32:04 +01:00
i2c-sirf.c drivers/i2c/busses: don't check resource with devm_ioremap_resource 2013-05-18 11:55:32 +02:00
i2c-sis96x.c i2c: remove __dev* attributes from subsystem 2012-12-22 20:13:45 +01:00
i2c-sis630.c i2c: sis630: checkpatch cleanup 2013-02-11 15:59:40 +01:00
i2c-sis5595.c i2c: remove __dev* attributes from subsystem 2012-12-22 20:13:45 +01:00
i2c-stu300.c Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2013-02-26 09:41:53 -08:00
i2c-taos-evm.c i2c: Remove unneeded xxx_set_drvdata(..., NULL) calls 2013-02-22 00:25:50 +01:00
i2c-tegra.c drivers/i2c/busses: don't check resource with devm_ioremap_resource 2013-05-18 11:55:32 +02:00
i2c-tiny-usb.c i2c-tiny-usb: Add support for the Robofuzz OSIF USB/I2C converter 2012-07-24 14:13:59 +02:00
i2c-versatile.c i2c: Remove unneeded xxx_set_drvdata(..., NULL) calls 2013-02-22 00:25:50 +01:00
i2c-via.c i2c: remove __dev* attributes from subsystem 2012-12-22 20:13:45 +01:00
i2c-viapro.c i2c: remove __dev* attributes from subsystem 2012-12-22 20:13:45 +01:00
i2c-viperboard.c i2c: Ignore return value of i2c_del_adapter() 2013-04-02 07:06:03 +02:00
i2c-wmt.c i2c: vt8500: Add support for I2C bus on Wondermedia SoCs 2013-06-15 13:37:08 +02:00
i2c-xiic.c i2c: xiic: must always write 16-bit words to TX_FIFO 2013-04-23 20:18:34 +02:00
i2c-xlr.c Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2013-02-26 09:41:53 -08:00
scx200_acb.c i2c: Remove unneeded xxx_set_drvdata(..., NULL) calls 2013-02-22 00:25:50 +01:00
scx200_i2c.c i2c/scx200_*: Replace printks with pr_<level>s 2012-10-05 22:23:52 +02:00