Select the types of activity you want to include in your feed.
Merge branch 'gpio/merge' of git://git.secretlab.ca/git/linux-2.6
* 'gpio/merge' of git://git.secretlab.ca/git/linux-2.6: gpio/basic_mmio: add missing include of spinlock_types.h gpio/nomadik: fix sleepmode for elder Nomadik
···159159 /* No custom data yet */160160 };161161162162+ if (cpu_is_u8500v2())163163+ pdata.supports_sleepmode = true;164164+162165 dbx500_add_gpios(ARRAY_AND_SIZE(db8500_gpio_base),163166 IRQ_DB8500_GPIO0, &pdata);164167}
+1
arch/arm/plat-nomadik/include/plat/gpio.h
···9090 int num_gpio;9191 u32 (*get_secondary_status)(unsigned int bank);9292 void (*set_ioforce)(bool enable);9393+ bool supports_sleepmode;9394};94959596#endif /* __ASM_PLAT_GPIO_H */
+29-11
drivers/gpio/gpio-nomadik.c
···44 * Copyright (C) 2008,2009 STMicroelectronics55 * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it>66 * Rewritten based on work by Prafulla WADASKAR <prafulla.wadaskar@st.com>77+ * Copyright (C) 2011 Linus Walleij <linus.walleij@linaro.org>78 *89 * This program is free software; you can redistribute it and/or modify910 * it under the terms of the GNU General Public License version 2 as···5049 u32 (*get_secondary_status)(unsigned int bank);5150 void (*set_ioforce)(bool enable);5251 spinlock_t lock;5252+ bool sleepmode;5353 /* Keep track of configured edges */5454 u32 edge_rising;5555 u32 edge_falling;···395393 * @gpio: pin number396394 * @mode: NMK_GPIO_SLPM_INPUT or NMK_GPIO_SLPM_NOCHANGE,397395 *398398- * Sets the sleep mode of a pin. If @mode is NMK_GPIO_SLPM_INPUT, the pin is399399- * changed to an input (with pullup/down enabled) in sleep and deep sleep. If400400- * @mode is NMK_GPIO_SLPM_NOCHANGE, the pin remains in the state it was401401- * configured even when in sleep and deep sleep.396396+ * This register is actually in the pinmux layer, not the GPIO block itself.397397+ * The GPIO1B_SLPM register defines the GPIO mode when SLEEP/DEEP-SLEEP398398+ * mode is entered (i.e. when signal IOFORCE is HIGH by the platform code).399399+ * Each GPIO can be configured to be forced into GPIO mode when IOFORCE is400400+ * HIGH, overriding the normal setting defined by GPIO_AFSELx registers.401401+ * When IOFORCE returns LOW (by software, after SLEEP/DEEP-SLEEP exit),402402+ * the GPIOs return to the normal setting defined by GPIO_AFSELx registers.402403 *403403- * On DB8500v2 onwards, this setting loses the previous meaning and instead404404- * indicates if wakeup detection is enabled on the pin. Note that405405- * enable_irq_wake() will automatically enable wakeup detection.404404+ * If @mode is NMK_GPIO_SLPM_INPUT, the corresponding GPIO is switched to GPIO405405+ * mode when signal IOFORCE is HIGH (i.e. when SLEEP/DEEP-SLEEP mode is406406+ * entered) regardless of the altfunction selected. Also wake-up detection is407407+ * ENABLED.408408+ *409409+ * If @mode is NMK_GPIO_SLPM_NOCHANGE, the corresponding GPIO remains410410+ * controlled by NMK_GPIO_DATC, NMK_GPIO_DATS, NMK_GPIO_DIR, NMK_GPIO_PDIS411411+ * (for altfunction GPIO) or respective on-chip peripherals (for other412412+ * altfuncs) when IOFORCE is HIGH. Also wake-up detection DISABLED.413413+ *414414+ * Note that enable_irq_wake() will automatically enable wakeup detection.406415 */407416int nmk_gpio_set_slpm(int gpio, enum nmk_gpio_slpm mode)408417{···564551static void __nmk_gpio_set_wake(struct nmk_gpio_chip *nmk_chip,565552 int gpio, bool on)566553{554554+ if (nmk_chip->sleepmode) {555555+ __nmk_gpio_set_slpm(nmk_chip, gpio - nmk_chip->chip.base,556556+ on ? NMK_GPIO_SLPM_WAKEUP_ENABLE557557+ : NMK_GPIO_SLPM_WAKEUP_DISABLE);558558+ }559559+567560 __nmk_gpio_irq_modify(nmk_chip, gpio, WAKE, on);568561}569562···920901 writel(chip->fwimsc & chip->real_wake,921902 chip->addr + NMK_GPIO_FWIMSC);922903923923- if (cpu_is_u8500v2()) {904904+ if (chip->sleepmode) {924905 chip->slpm = readl(chip->addr + NMK_GPIO_SLPC);925906926907 /* 0 -> wakeup enable */···942923 writel(chip->rwimsc, chip->addr + NMK_GPIO_RWIMSC);943924 writel(chip->fwimsc, chip->addr + NMK_GPIO_FWIMSC);944925945945- if (cpu_is_u8500v2())926926+ if (chip->sleepmode)946927 writel(chip->slpm, chip->addr + NMK_GPIO_SLPC);947928 }948929}···10291010 nmk_chip->secondary_parent_irq = secondary_irq;10301011 nmk_chip->get_secondary_status = pdata->get_secondary_status;10311012 nmk_chip->set_ioforce = pdata->set_ioforce;10131013+ nmk_chip->sleepmode = pdata->supports_sleepmode;10321014 spin_lock_init(&nmk_chip->lock);1033101510341016 chip = &nmk_chip->chip;···10851065MODULE_AUTHOR("Prafulla WADASKAR and Alessandro Rubini");10861066MODULE_DESCRIPTION("Nomadik GPIO Driver");10871067MODULE_LICENSE("GPL");10881088-10891089-
+1
include/linux/basic_mmio_gpio.h
···1616#include <linux/gpio.h>1717#include <linux/types.h>1818#include <linux/compiler.h>1919+#include <linux/spinlock_types.h>19202021struct bgpio_pdata {2122 int base;