summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/spitz_pm.c
Commit message (Collapse)AuthorAgeFilesLines
* ARM: pxa: fix GPIO double shiftsRobert Jarzmik2016-09-091-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit 9bf448c66d4b ("ARM: pxa: use generic gpio operation instead of gpio register") from Oct 17, 2011, leads to the following static checker warning: arch/arm/mach-pxa/spitz_pm.c:172 spitz_charger_wakeup() warn: double left shift '!gpio_get_value(SPITZ_GPIO_KEY_INT) << (1 << ((SPITZ_GPIO_KEY_INT) & 31))' As Dan reported, the value is shifted three times : - once by gpio_get_value(), which returns either 0 or BIT(gpio) - once by the shift operation '<<' - a last time by GPIO_bit(gpio) which is BIT(gpio) Therefore the calculation lead to a chained or operator of : - (1 << gpio) << (1 << gpio) = (2^gpio)^gpio = 2 ^ (gpio * gpio) It is be sheer luck the former statement works, only because each gpio used is strictly smaller than 6, and therefore 2^(gpio^2) never overflows a 32 bits value, and because it is used as a boolean value to check a gpio activation. As the xxx_charger_wakeup() functions are used as a true/false detection mechanism, take that opportunity to change their prototypes from integer return value to boolean one. Fixes: 9bf448c66d4b ("ARM: pxa: use generic gpio operation instead of gpio register") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
* ARM: pxa: make more mach/*.h files localArnd Bergmann2015-12-011-2/+2
| | | | | | | | Lots of header files are never included outside of a mach-pxa directory and do not need to be made visible in include/mach, so let's just move them all down one level. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* ARM: drivers: remove __dev* attributes.Greg Kroah-Hartman2013-01-031-1/+1
| | | | | | | | | | | | | | | CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, __devinitdata, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: Russell King <linux@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* ARM: pxa/spitz_pm: Fix hang when resuming from STRMarko Katic2012-10-281-6/+2
| | | | | | | | | | | | | | | | Devices that use spitz_pm.c will fail to resume from STR (Suspend To Ram) when the charger plug is inserted or removed when a device is in STR mode. The culprit is a misconfigured gpio line - GPIO18. GPIO18 should be configured as a regular GPIO input but it gets configured as an alternate function GPIO18_RDY. And then later in postsuspend() it gets configured as a regular GPIO18 input line. Fix this by removing the GPIO18_RDY configuration so that GPIO18 only gets configured as a regular gpio input. Signed-off-by: Marko Katic <dromede@gmail.com> Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
* ARM: pxa: fix wrong parsing gpio event on spitzHaojian Zhuang2012-02-161-3/+2
| | | | | | | | | | | | (~GPLR0 & GPIO_bit(SPITZ_GPIO_KEY_INT)) | (GPLR0 & GPIO_bit(SPITZ_GPIO_SYNC)); After using gpio_get_value, the statement should be in below. ((!gpio_get_value(SPITZ_GPIO_KEY_INT) << GPIO_bit(SPITZ_GPIO_KEY_INT)) | gpio_get_value(SPITZ_GPIO_SYNC)); Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
* ARM: pxa: fix build error for GPIO_bit()Haojian Zhuang2011-12-081-0/+1
| | | | | | | | | | | | arch/arm/mach-pxa/spitz_pm.c: In function ‘spitz_presuspend’: arch/arm/mach-pxa/spitz_pm.c:112:2: error: implicit declaration of function ‘GPIO_bit’ make[1]: *** [arch/arm/mach-pxa/spitz_pm.o] Error 1 GPIO_bit() is moved into <linux/gpio-pxa.h>. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* ARM: pxa: use generic gpio operation instead of gpio registerHaojian Zhuang2011-11-141-2/+8
| | | | | | | Remove the code of accessing gpio register. Use the generic read operation instead. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
* gpio: include linux/gpio.h where neededRandy Dunlap2011-06-161-0/+1
| | | | | | | | | Some files use GPIOF_ macros but don't include the header file for them. These macros are being moved to <linux/gpio.h>, so add includes for <linux/gpio.h> where needed. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* [ARM] pxa: removed mostly unused and confusing two sharpsl.hEric Miao2010-08-051-2/+1
| | | | | | Only a small part of used code is moved into sharpsl_pm.h. Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
* [ARM] pxa: use generic gpio_get_value() instead of READ_GPIO_BIT()Eric Miao2010-08-051-3/+3
| | | | | | | READ_GPIO_BIT() is no way generic by accessing GPIO registers directly, replace it with gpio_get_value(). Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
* [ARM] pxa: removing dead BACKLIGHT_CORGIChristoph Egger2010-08-051-2/+0
| | | | | | | | | BACKLIGHT_CORGI was later renamed to BACKLIGHT_GENERIC and has not been used since then. As it's now safe to completely transition to LCD_CORGI driver, which incorprates both the LCD and backlight device. Signed-off-by: Christoph Egger <siccegge@cs.fau.de> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
* [ARM] pxa/spitz: use generic GPIO API and remove pxa_gpio_mode()Eric Miao2010-05-111-7/+21
| | | | | | | | REVISIT: change to GPIO18 is ugly, need to make sure whether that's really necessary - GPIO18_RDY as an VLIO input signal - we don't normally need to do such kind of trick during low power mode. Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
* [ARM] pxa/zaurus: rename spitz_battery_levels_* to sharpsl_*Pavel Machek2009-12-011-2/+2
| | | | | | | | Battery power levels are shared between spitz and corgi, rename variable to reflect it. Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
* [ARM] pxa/zaurus: cleanup sharpsl_pm.cPavel Machek2009-12-011-5/+5
| | | | | | | | This fixes checkpatch/style problems in sharpsl_pm.c, allowing me to submit real fixes next. Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
* [ARM] pxa/sharpsl_pm: merge pxa-specific code into generic oneDmitry Eremin-Solenikov2009-06-111-2/+1
| | | | | | | | As pxa now is the only user of sharpsl_pm we can drop several startup functions into generic code thus dropping several global functions. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Eric Miao <eric.miao@marvell.com>
* [ARM] pxa: separate definitions from pxa-regs.h and remove it finallyEric Miao2009-03-091-1/+0
| | | | | | | | | | | | | | | | | | | The remaining registers are separated into: - <mach/regs-ost.h> - <mach/regs-rtc.h> - <mach/regs-intc.h> and then we can remove pxa-regs.h completely. Instead of #include this file, let's: 1. include the specific <mach/regs-*.h> with care (if that's absolutely necessary) 2. define the registers in the driver, make cleanly defined API to expose the register access to external with sufficient reason Signed-off-by: Eric Miao <eric.miao@marvell.com>
* [ARM] corgi_lcd: fix simultaneous compilation with corgi_blDmitry Baryshkov2008-10-291-1/+3
| | | | | | | | corgi_lcd has symbol conflict with corgi_bl driver. Fix it by renaming common symbol in new corgi_lcd driver. Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com> Signed-off-by: Eric Miao <eric.miao@marvell.com>
* [ARM] pxa/spitz: use generic GPIO API for SCOOP1/SCOOP2 GPIOsEric Miao2008-09-231-19/+9
| | | | | | | | | Original patch from Dmitry Baryshkov's inital scoop gpio conversion work at http://git.infradead.org/users/dbaryshkov/zaurus-2.6.git. Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com> Signed-off-by: Eric Miao <eric.miao@marvell.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/machRussell King2008-08-071-6/+6
| | | | | | This just leaves include/asm-arm/plat-* to deal with. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] Remove asm/hardware.h, use asm/arch/hardware.h insteadRussell King2008-08-071-1/+1
| | | | | | | | | Remove includes of asm/hardware.h in addition to asm/arch/hardware.h. Then, since asm/hardware.h only exists to include asm/arch/hardware.h, update everything to directly include asm/arch/hardware.h and remove asm/hardware.h. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] 5073/1: spitz_pm: don't register devices on non-spitz machinesDmitry Baryshkov2008-06-021-0/+5
| | | | | | Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com> Acked-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] pxa: corgibl_limit_intensity build errorsRussell King2008-05-191-0/+2
| | | | | | | | | | | | If CONFIG_BACKLIGHT_CORGI is not selected, then corgibl_limit_intensity() is not present. However, both corgi_pm.c and sharp_pm.c reference this symbol, resulting in a link error. Wrap the references with the relevant ifdefs, and avoid the resulting NULL pointer dereference by making the code in sharpsl_pm.c also conditional on the config symbol. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] pxa: Fix RCSR handlingRussell King2008-05-081-3/+0
| | | | | | | | | | | | | | Related to d3930614e68bdf83a120d904c039a64e9f75dba1. RCSR is only present on PXA2xx CPUs, not on PXA3xx CPUs. Therefore, we should not be unconditionally writing to RCSR from generic code. Since we now clear the RCSR status from the SoC specific PXA PM code and before reset in the arch_reset() function, the duplication in the corgi, poodle, spitz and tosa code can be removed. Acked-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.heric miao2008-04-191-0/+1
| | | | | | | | | | | | | two reasons: 1. GPIO namings and their mode definitions are conceptually not part of the PXA register definitions 2. this is actually a temporary move in the transition of PXA2xx to use MFP-alike APIs (as what PXA3xx is now doing), so that legacy code will still work and new code can be added in step by step Signed-off-by: eric miao <eric.miao@marvell.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] Yet more asm/apm-emulation.h stuffRussell King2007-03-021-1/+2
| | | | Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [APM] ARM: Convert to use shared APM emulation.Ralf Baechle2007-02-091-1/+1
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* [ARM] 3564/1: sharpsl_pm: Abstract some machine specific parametersRichard Purdie2006-06-191-0/+15
| | | | | | | | | | | Patch from Richard Purdie Abstract some machine specific parameters from the sharpsl_pm core into the machine specific drivers. This allows the core to support tosa/poodle. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] 3235/1: SharpSL PM: Fix a gcc4 build errorRichard Purdie2006-01-071-1/+0
| | | | | | | | | | Patch from Richard Purdie Fix a gcc4 build error (incomplete element type) in the pxa SharpSL PM code. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] 3228/1: SharpSL: Move PM code to arch/arm/commonRichard Purdie2006-01-051-21/+26
| | | | | | | | | | | | Patch from Richard Purdie This patch moves a large chunk of the sharpsl_pm driver to arch/arm/common so that it can be reused on other devices such as the SL-5500 (collie). It also abstracts some functions from the core into the machine and platform specific parts of the driver to aid reuse. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* [ARM] 3159/1: SharpSL: Add PM device driver for the SL-Cx00 machines.Richard Purdie2005-11-131-0/+233
Patch from Richard Purdie Add a SharpSL PM device driver for the SL-Cxx00 machines. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
OpenPOWER on IntegriCloud