aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/include/asm/scatterlist.h3
-rw-r--r--arch/arm/mach-davinci/include/mach/mmc.h3
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c4
-rw-r--r--arch/arm/mach-omap2/board-ldp.c3
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c4
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c4
-rw-r--r--arch/arm/mach-omap2/board-omap3touchbook.c3
-rw-r--r--arch/arm/plat-omap/gpio.c104
8 files changed, 58 insertions, 70 deletions
diff --git a/arch/arm/include/asm/scatterlist.h b/arch/arm/include/asm/scatterlist.h
index bcda59f39941..2f87870d9347 100644
--- a/arch/arm/include/asm/scatterlist.h
+++ b/arch/arm/include/asm/scatterlist.h
@@ -3,9 +3,6 @@
3 3
4#include <asm/memory.h> 4#include <asm/memory.h>
5#include <asm/types.h> 5#include <asm/types.h>
6
7#include <asm-generic/scatterlist.h> 6#include <asm-generic/scatterlist.h>
8 7
9#undef ARCH_HAS_SG_CHAIN
10
11#endif /* _ASMARM_SCATTERLIST_H */ 8#endif /* _ASMARM_SCATTERLIST_H */
diff --git a/arch/arm/mach-davinci/include/mach/mmc.h b/arch/arm/mach-davinci/include/mach/mmc.h
index 5a85e24f3673..d4f1e9675069 100644
--- a/arch/arm/mach-davinci/include/mach/mmc.h
+++ b/arch/arm/mach-davinci/include/mach/mmc.h
@@ -22,6 +22,9 @@ struct davinci_mmc_config {
22 22
23 /* Version of the MMC/SD controller */ 23 /* Version of the MMC/SD controller */
24 u8 version; 24 u8 version;
25
26 /* Number of sg segments */
27 u8 nr_sg;
25}; 28};
26void davinci_setup_mmc(int module, struct davinci_mmc_config *config); 29void davinci_setup_mmc(int module, struct davinci_mmc_config *config);
27 30
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index e7d629b3c76a..f474a80b8867 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -137,9 +137,7 @@ static void ads7846_dev_init(void)
137 } 137 }
138 138
139 gpio_direction_input(ts_gpio); 139 gpio_direction_input(ts_gpio);
140 140 gpio_set_debounce(ts_gpio, 310);
141 omap_set_gpio_debounce(ts_gpio, 1);
142 omap_set_gpio_debounce_time(ts_gpio, 0xa);
143} 141}
144 142
145static int ads7846_get_pendown_state(void) 143static int ads7846_get_pendown_state(void)
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 5fcb52e71298..fefd7e6e9779 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -209,8 +209,7 @@ static void ads7846_dev_init(void)
209 } 209 }
210 210
211 gpio_direction_input(ts_gpio); 211 gpio_direction_input(ts_gpio);
212 omap_set_gpio_debounce(ts_gpio, 1); 212 gpio_set_debounce(ts_gpio, 310);
213 omap_set_gpio_debounce_time(ts_gpio, 0xa);
214} 213}
215 214
216static int ads7846_get_pendown_state(void) 215static int ads7846_get_pendown_state(void)
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 81bba194b030..b95261013812 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -579,9 +579,7 @@ static void ads7846_dev_init(void)
579 printk(KERN_ERR "can't get ads7846 pen down GPIO\n"); 579 printk(KERN_ERR "can't get ads7846 pen down GPIO\n");
580 580
581 gpio_direction_input(OMAP3_EVM_TS_GPIO); 581 gpio_direction_input(OMAP3_EVM_TS_GPIO);
582 582 gpio_set_debounce(OMAP3_EVM_TS_GPIO, 310);
583 omap_set_gpio_debounce(OMAP3_EVM_TS_GPIO, 1);
584 omap_set_gpio_debounce_time(OMAP3_EVM_TS_GPIO, 0xa);
585} 583}
586 584
587static int ads7846_get_pendown_state(void) 585static int ads7846_get_pendown_state(void)
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 395d049bf010..db06dc910ba7 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -130,8 +130,8 @@ static struct platform_device pandora_keys_gpio = {
130static void __init pandora_keys_gpio_init(void) 130static void __init pandora_keys_gpio_init(void)
131{ 131{
132 /* set debounce time for GPIO banks 4 and 6 */ 132 /* set debounce time for GPIO banks 4 and 6 */
133 omap_set_gpio_debounce_time(32 * 3, GPIO_DEBOUNCE_TIME); 133 gpio_set_debounce(32 * 3, GPIO_DEBOUNCE_TIME);
134 omap_set_gpio_debounce_time(32 * 5, GPIO_DEBOUNCE_TIME); 134 gpio_set_debounce(32 * 5, GPIO_DEBOUNCE_TIME);
135} 135}
136 136
137static int board_keymap[] = { 137static int board_keymap[] = {
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 2504d41f923e..2f5f8233dd5b 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -328,8 +328,7 @@ static void __init omap3_ads7846_init(void)
328 } 328 }
329 329
330 gpio_direction_input(OMAP3_TS_GPIO); 330 gpio_direction_input(OMAP3_TS_GPIO);
331 omap_set_gpio_debounce(OMAP3_TS_GPIO, 1); 331 gpio_set_debounce(OMAP3_TS_GPIO, 310);
332 omap_set_gpio_debounce_time(OMAP3_TS_GPIO, 0xa);
333} 332}
334 333
335static struct ads7846_platform_data ads7846_config = { 334static struct ads7846_platform_data ads7846_config = {
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index dc2ac42d6319..393e9219a5b6 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -624,79 +624,58 @@ do { \
624 __raw_writel(l, base + reg); \ 624 __raw_writel(l, base + reg); \
625} while(0) 625} while(0)
626 626
627void omap_set_gpio_debounce(int gpio, int enable) 627/**
628 * _set_gpio_debounce - low level gpio debounce time
629 * @bank: the gpio bank we're acting upon
630 * @gpio: the gpio number on this @gpio
631 * @debounce: debounce time to use
632 *
633 * OMAP's debounce time is in 31us steps so we need
634 * to convert and round up to the closest unit.
635 */
636static void _set_gpio_debounce(struct gpio_bank *bank, unsigned gpio,
637 unsigned debounce)
628{ 638{
629 struct gpio_bank *bank; 639 void __iomem *reg = bank->base;
630 void __iomem *reg; 640 u32 val;
631 unsigned long flags; 641 u32 l;
632 u32 val, l = 1 << get_gpio_index(gpio); 642
643 if (debounce < 32)
644 debounce = 0x01;
645 else if (debounce > 7936)
646 debounce = 0xff;
647 else
648 debounce = (debounce / 0x1f) - 1;
633 649
634 if (cpu_class_is_omap1()) 650 l = 1 << get_gpio_index(gpio);
635 return;
636 651
637 bank = get_gpio_bank(gpio); 652 if (cpu_is_omap44xx())
638 reg = bank->base; 653 reg += OMAP4_GPIO_DEBOUNCINGTIME;
654 else
655 reg += OMAP24XX_GPIO_DEBOUNCE_VAL;
656
657 __raw_writel(debounce, reg);
639 658
659 reg = bank->base;
640 if (cpu_is_omap44xx()) 660 if (cpu_is_omap44xx())
641 reg += OMAP4_GPIO_DEBOUNCENABLE; 661 reg += OMAP4_GPIO_DEBOUNCENABLE;
642 else 662 else
643 reg += OMAP24XX_GPIO_DEBOUNCE_EN; 663 reg += OMAP24XX_GPIO_DEBOUNCE_EN;
644 664
645 if (!(bank->mod_usage & l)) {
646 printk(KERN_ERR "GPIO %d not requested\n", gpio);
647 return;
648 }
649
650 spin_lock_irqsave(&bank->lock, flags);
651 val = __raw_readl(reg); 665 val = __raw_readl(reg);
652 666
653 if (enable && !(val & l)) 667 if (debounce) {
654 val |= l; 668 val |= l;
655 else if (!enable && (val & l)) 669 if (cpu_is_omap34xx() || cpu_is_omap44xx())
656 val &= ~l;
657 else
658 goto done;
659
660 if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
661 bank->dbck_enable_mask = val;
662 if (enable)
663 clk_enable(bank->dbck); 670 clk_enable(bank->dbck);
664 else 671 } else {
672 val &= ~l;
673 if (cpu_is_omap34xx() || cpu_is_omap44xx())
665 clk_disable(bank->dbck); 674 clk_disable(bank->dbck);
666 } 675 }
667 676
668 __raw_writel(val, reg); 677 __raw_writel(val, reg);
669done:
670 spin_unlock_irqrestore(&bank->lock, flags);
671} 678}
672EXPORT_SYMBOL(omap_set_gpio_debounce);
673
674void omap_set_gpio_debounce_time(int gpio, int enc_time)
675{
676 struct gpio_bank *bank;
677 void __iomem *reg;
678
679 if (cpu_class_is_omap1())
680 return;
681
682 bank = get_gpio_bank(gpio);
683 reg = bank->base;
684
685 if (!bank->mod_usage) {
686 printk(KERN_ERR "GPIO not requested\n");
687 return;
688 }
689
690 enc_time &= 0xff;
691
692 if (cpu_is_omap44xx())
693 reg += OMAP4_GPIO_DEBOUNCINGTIME;
694 else
695 reg += OMAP24XX_GPIO_DEBOUNCE_VAL;
696
697 __raw_writel(enc_time, reg);
698}
699EXPORT_SYMBOL(omap_set_gpio_debounce_time);
700 679
701#ifdef CONFIG_ARCH_OMAP2PLUS 680#ifdef CONFIG_ARCH_OMAP2PLUS
702static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio, 681static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio,
@@ -1656,6 +1635,20 @@ static int gpio_output(struct gpio_chip *chip, unsigned offset, int value)
1656 return 0; 1635 return 0;
1657} 1636}
1658 1637
1638static int gpio_debounce(struct gpio_chip *chip, unsigned offset,
1639 unsigned debounce)
1640{
1641 struct gpio_bank *bank;
1642 unsigned long flags;
1643
1644 bank = container_of(chip, struct gpio_bank, chip);
1645 spin_lock_irqsave(&bank->lock, flags);
1646 _set_gpio_debounce(bank, offset, debounce);
1647 spin_unlock_irqrestore(&bank->lock, flags);
1648
1649 return 0;
1650}
1651
1659static void gpio_set(struct gpio_chip *chip, unsigned offset, int value) 1652static void gpio_set(struct gpio_chip *chip, unsigned offset, int value)
1660{ 1653{
1661 struct gpio_bank *bank; 1654 struct gpio_bank *bank;
@@ -1909,6 +1902,7 @@ static int __init _omap_gpio_init(void)
1909 bank->chip.direction_input = gpio_input; 1902 bank->chip.direction_input = gpio_input;
1910 bank->chip.get = gpio_get; 1903 bank->chip.get = gpio_get;
1911 bank->chip.direction_output = gpio_output; 1904 bank->chip.direction_output = gpio_output;
1905 bank->chip.set_debounce = gpio_debounce;
1912 bank->chip.set = gpio_set; 1906 bank->chip.set = gpio_set;
1913 bank->chip.to_irq = gpio_2irq; 1907 bank->chip.to_irq = gpio_2irq;
1914 if (bank_is_mpuio(bank)) { 1908 if (bank_is_mpuio(bank)) {