diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-08 11:12:43 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-08 11:12:43 -0500 |
commit | 79c9601c2e0dbbe69895d302de4d19f3a31fbd30 (patch) | |
tree | 78d4be2df851b2b4106adcfd736622a90cecf9e9 /drivers | |
parent | 41440ffe21f29bdb985cab76b2d0b06d83e63b19 (diff) | |
parent | 3d14b5beba35250c548d3851a2b84fce742d8311 (diff) |
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (272 commits)
Fix soc_common PCMCIA configuration
ARM: 5827/1: SA1100: h3100/h3600: emit messages on failed gpio_request
ARM: 5826/1: SA1100: h3100/h3600: always build htc-egpio driver
ARM: 5825/1: SA1100: h3600: update defconfig
ARM: 5824/1: SA1100: reuse h3600 PCMCIA driver on h3100
ARM: 5823/1: SA1100: h3100/h3600: add support for gpio-keys
ARM: 5822/1: SA1100: h3100/h3600: clean up #includes
ARM: 5821/1: SA1100: h3100/h3600: revise copyright boilerplates
ARM: 5820/1: SA1100: h3100/h3600: split h3600.c
ARM: 5819/1: SA1100: h3100/h3600: merge h3600.h and h3600_gpio.h into h3xxx.h
ARM: 5818/1: SA1100: h3100/h3600: drop old GPIO definitions
ARM: 5817/1: SA1100: h3100/h3600: configure all unused gpios as inputs
ARM: 5816/1: SA1100: h3600: remove IRQ_GPIO_* definitions
ARM: 5815/1: SA1100: h3100/h3600: remove now unused assign_h3600_egpio handlers
ARM: 5814/1: SA1100: h3100/h3600: convert all users of assign_h3600_egpio to gpiolib
ARM: 5813/1: SA1100: h3100/h3600: add htc-egpio driver
ARM: 5812/1: SA1100: h3100/h3600: separate machine-specific LCD helpers
ARM: 5811/2: pcmcia: convert sa1100_h3600 driver to gpiolib
ARM: 5799/1: SA1100: h3600: stop setting direction for LCD pins
ARM: 5798/1: SA1100: h3600: remove unused cruft from h3600.h
...
Diffstat (limited to 'drivers')
31 files changed, 751 insertions, 389 deletions
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index b401dadad4a8..eb140ff38c27 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig | |||
@@ -54,7 +54,7 @@ config DW_DMAC | |||
54 | 54 | ||
55 | config AT_HDMAC | 55 | config AT_HDMAC |
56 | tristate "Atmel AHB DMA support" | 56 | tristate "Atmel AHB DMA support" |
57 | depends on ARCH_AT91SAM9RL | 57 | depends on ARCH_AT91SAM9RL || ARCH_AT91SAM9G45 |
58 | select DMA_ENGINE | 58 | select DMA_ENGINE |
59 | help | 59 | help |
60 | Support the Atmel AHB DMA controller. This can be integrated in | 60 | Support the Atmel AHB DMA controller. This can be integrated in |
diff --git a/drivers/leds/leds-locomo.c b/drivers/leds/leds-locomo.c index 5d91362e3066..1f7c10f6b7f2 100644 --- a/drivers/leds/leds-locomo.c +++ b/drivers/leds/leds-locomo.c | |||
@@ -44,7 +44,7 @@ static void locomoled_brightness_set1(struct led_classdev *led_cdev, | |||
44 | 44 | ||
45 | static struct led_classdev locomo_led0 = { | 45 | static struct led_classdev locomo_led0 = { |
46 | .name = "locomo:amber:charge", | 46 | .name = "locomo:amber:charge", |
47 | .default_trigger = "sharpsl-charge", | 47 | .default_trigger = "main-battery-charging", |
48 | .brightness_set = locomoled_brightness_set0, | 48 | .brightness_set = locomoled_brightness_set0, |
49 | }; | 49 | }; |
50 | 50 | ||
diff --git a/drivers/mfd/mcp-core.c b/drivers/mfd/mcp-core.c index 57271cb3b316..84815f9ef636 100644 --- a/drivers/mfd/mcp-core.c +++ b/drivers/mfd/mcp-core.c | |||
@@ -17,11 +17,11 @@ | |||
17 | #include <linux/device.h> | 17 | #include <linux/device.h> |
18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
19 | #include <linux/string.h> | 19 | #include <linux/string.h> |
20 | #include <linux/mfd/mcp.h> | ||
20 | 21 | ||
21 | #include <mach/dma.h> | 22 | #include <mach/dma.h> |
22 | #include <asm/system.h> | 23 | #include <asm/system.h> |
23 | 24 | ||
24 | #include "mcp.h" | ||
25 | 25 | ||
26 | #define to_mcp(d) container_of(d, struct mcp, attached_device) | 26 | #define to_mcp(d) container_of(d, struct mcp, attached_device) |
27 | #define to_mcp_driver(d) container_of(d, struct mcp_driver, drv) | 27 | #define to_mcp_driver(d) container_of(d, struct mcp_driver, drv) |
diff --git a/drivers/mfd/mcp-sa11x0.c b/drivers/mfd/mcp-sa11x0.c index 62b32dabf629..258427232728 100644 --- a/drivers/mfd/mcp-sa11x0.c +++ b/drivers/mfd/mcp-sa11x0.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/spinlock.h> | 19 | #include <linux/spinlock.h> |
20 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
22 | #include <linux/mfd/mcp.h> | ||
22 | 23 | ||
23 | #include <mach/dma.h> | 24 | #include <mach/dma.h> |
24 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
@@ -28,7 +29,6 @@ | |||
28 | 29 | ||
29 | #include <mach/assabet.h> | 30 | #include <mach/assabet.h> |
30 | 31 | ||
31 | #include "mcp.h" | ||
32 | 32 | ||
33 | struct mcp_sa11x0 { | 33 | struct mcp_sa11x0 { |
34 | u32 mccr0; | 34 | u32 mccr0; |
@@ -163,6 +163,7 @@ static int mcp_sa11x0_probe(struct platform_device *pdev) | |||
163 | mcp->dma_audio_wr = DMA_Ser4MCP0Wr; | 163 | mcp->dma_audio_wr = DMA_Ser4MCP0Wr; |
164 | mcp->dma_telco_rd = DMA_Ser4MCP1Rd; | 164 | mcp->dma_telco_rd = DMA_Ser4MCP1Rd; |
165 | mcp->dma_telco_wr = DMA_Ser4MCP1Wr; | 165 | mcp->dma_telco_wr = DMA_Ser4MCP1Wr; |
166 | mcp->gpio_base = data->gpio_base; | ||
166 | 167 | ||
167 | platform_set_drvdata(pdev, mcp); | 168 | platform_set_drvdata(pdev, mcp); |
168 | 169 | ||
diff --git a/drivers/mfd/mcp.h b/drivers/mfd/mcp.h deleted file mode 100644 index c093a93b8808..000000000000 --- a/drivers/mfd/mcp.h +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | /* | ||
2 | * linux/drivers/mfd/mcp.h | ||
3 | * | ||
4 | * Copyright (C) 2001 Russell King, All Rights Reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License. | ||
9 | */ | ||
10 | #ifndef MCP_H | ||
11 | #define MCP_H | ||
12 | |||
13 | struct mcp_ops; | ||
14 | |||
15 | struct mcp { | ||
16 | struct module *owner; | ||
17 | struct mcp_ops *ops; | ||
18 | spinlock_t lock; | ||
19 | int use_count; | ||
20 | unsigned int sclk_rate; | ||
21 | unsigned int rw_timeout; | ||
22 | dma_device_t dma_audio_rd; | ||
23 | dma_device_t dma_audio_wr; | ||
24 | dma_device_t dma_telco_rd; | ||
25 | dma_device_t dma_telco_wr; | ||
26 | struct device attached_device; | ||
27 | }; | ||
28 | |||
29 | struct mcp_ops { | ||
30 | void (*set_telecom_divisor)(struct mcp *, unsigned int); | ||
31 | void (*set_audio_divisor)(struct mcp *, unsigned int); | ||
32 | void (*reg_write)(struct mcp *, unsigned int, unsigned int); | ||
33 | unsigned int (*reg_read)(struct mcp *, unsigned int); | ||
34 | void (*enable)(struct mcp *); | ||
35 | void (*disable)(struct mcp *); | ||
36 | }; | ||
37 | |||
38 | void mcp_set_telecom_divisor(struct mcp *, unsigned int); | ||
39 | void mcp_set_audio_divisor(struct mcp *, unsigned int); | ||
40 | void mcp_reg_write(struct mcp *, unsigned int, unsigned int); | ||
41 | unsigned int mcp_reg_read(struct mcp *, unsigned int); | ||
42 | void mcp_enable(struct mcp *); | ||
43 | void mcp_disable(struct mcp *); | ||
44 | #define mcp_get_sclk_rate(mcp) ((mcp)->sclk_rate) | ||
45 | |||
46 | struct mcp *mcp_host_alloc(struct device *, size_t); | ||
47 | int mcp_host_register(struct mcp *); | ||
48 | void mcp_host_unregister(struct mcp *); | ||
49 | |||
50 | struct mcp_driver { | ||
51 | struct device_driver drv; | ||
52 | int (*probe)(struct mcp *); | ||
53 | void (*remove)(struct mcp *); | ||
54 | int (*suspend)(struct mcp *, pm_message_t); | ||
55 | int (*resume)(struct mcp *); | ||
56 | }; | ||
57 | |||
58 | int mcp_driver_register(struct mcp_driver *); | ||
59 | void mcp_driver_unregister(struct mcp_driver *); | ||
60 | |||
61 | #define mcp_get_drvdata(mcp) dev_get_drvdata(&(mcp)->attached_device) | ||
62 | #define mcp_set_drvdata(mcp,d) dev_set_drvdata(&(mcp)->attached_device, d) | ||
63 | |||
64 | #define mcp_priv(mcp) ((void *)((mcp)+1)) | ||
65 | |||
66 | #endif | ||
diff --git a/drivers/mfd/ucb1x00-assabet.c b/drivers/mfd/ucb1x00-assabet.c index 86fed4870f93..cea9da60850d 100644 --- a/drivers/mfd/ucb1x00-assabet.c +++ b/drivers/mfd/ucb1x00-assabet.c | |||
@@ -14,10 +14,10 @@ | |||
14 | #include <linux/fs.h> | 14 | #include <linux/fs.h> |
15 | #include <linux/proc_fs.h> | 15 | #include <linux/proc_fs.h> |
16 | #include <linux/device.h> | 16 | #include <linux/device.h> |
17 | #include <linux/mfd/ucb1x00.h> | ||
17 | 18 | ||
18 | #include <mach/dma.h> | 19 | #include <mach/dma.h> |
19 | 20 | ||
20 | #include "ucb1x00.h" | ||
21 | 21 | ||
22 | #define UCB1X00_ATTR(name,input)\ | 22 | #define UCB1X00_ATTR(name,input)\ |
23 | static ssize_t name##_show(struct device *dev, struct device_attribute *attr, \ | 23 | static ssize_t name##_show(struct device *dev, struct device_attribute *attr, \ |
diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c index 60c3988f3cf3..252b74188ec2 100644 --- a/drivers/mfd/ucb1x00-core.c +++ b/drivers/mfd/ucb1x00-core.c | |||
@@ -25,12 +25,12 @@ | |||
25 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
26 | #include <linux/device.h> | 26 | #include <linux/device.h> |
27 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
28 | #include <linux/mfd/ucb1x00.h> | ||
29 | #include <linux/gpio.h> | ||
28 | 30 | ||
29 | #include <mach/dma.h> | 31 | #include <mach/dma.h> |
30 | #include <mach/hardware.h> | 32 | #include <mach/hardware.h> |
31 | 33 | ||
32 | #include "ucb1x00.h" | ||
33 | |||
34 | static DEFINE_MUTEX(ucb1x00_mutex); | 34 | static DEFINE_MUTEX(ucb1x00_mutex); |
35 | static LIST_HEAD(ucb1x00_drivers); | 35 | static LIST_HEAD(ucb1x00_drivers); |
36 | static LIST_HEAD(ucb1x00_devices); | 36 | static LIST_HEAD(ucb1x00_devices); |
@@ -108,6 +108,60 @@ unsigned int ucb1x00_io_read(struct ucb1x00 *ucb) | |||
108 | return ucb1x00_reg_read(ucb, UCB_IO_DATA); | 108 | return ucb1x00_reg_read(ucb, UCB_IO_DATA); |
109 | } | 109 | } |
110 | 110 | ||
111 | static void ucb1x00_gpio_set(struct gpio_chip *chip, unsigned offset, int value) | ||
112 | { | ||
113 | struct ucb1x00 *ucb = container_of(chip, struct ucb1x00, gpio); | ||
114 | unsigned long flags; | ||
115 | |||
116 | spin_lock_irqsave(&ucb->io_lock, flags); | ||
117 | if (value) | ||
118 | ucb->io_out |= 1 << offset; | ||
119 | else | ||
120 | ucb->io_out &= ~(1 << offset); | ||
121 | |||
122 | ucb1x00_reg_write(ucb, UCB_IO_DATA, ucb->io_out); | ||
123 | spin_unlock_irqrestore(&ucb->io_lock, flags); | ||
124 | } | ||
125 | |||
126 | static int ucb1x00_gpio_get(struct gpio_chip *chip, unsigned offset) | ||
127 | { | ||
128 | struct ucb1x00 *ucb = container_of(chip, struct ucb1x00, gpio); | ||
129 | return ucb1x00_reg_read(ucb, UCB_IO_DATA) & (1 << offset); | ||
130 | } | ||
131 | |||
132 | static int ucb1x00_gpio_direction_input(struct gpio_chip *chip, unsigned offset) | ||
133 | { | ||
134 | struct ucb1x00 *ucb = container_of(chip, struct ucb1x00, gpio); | ||
135 | unsigned long flags; | ||
136 | |||
137 | spin_lock_irqsave(&ucb->io_lock, flags); | ||
138 | ucb->io_dir &= ~(1 << offset); | ||
139 | ucb1x00_reg_write(ucb, UCB_IO_DIR, ucb->io_dir); | ||
140 | spin_unlock_irqrestore(&ucb->io_lock, flags); | ||
141 | |||
142 | return 0; | ||
143 | } | ||
144 | |||
145 | static int ucb1x00_gpio_direction_output(struct gpio_chip *chip, unsigned offset | ||
146 | , int value) | ||
147 | { | ||
148 | struct ucb1x00 *ucb = container_of(chip, struct ucb1x00, gpio); | ||
149 | unsigned long flags; | ||
150 | |||
151 | spin_lock_irqsave(&ucb->io_lock, flags); | ||
152 | ucb->io_dir |= (1 << offset); | ||
153 | ucb1x00_reg_write(ucb, UCB_IO_DIR, ucb->io_dir); | ||
154 | |||
155 | if (value) | ||
156 | ucb->io_out |= 1 << offset; | ||
157 | else | ||
158 | ucb->io_out &= ~(1 << offset); | ||
159 | ucb1x00_reg_write(ucb, UCB_IO_DATA, ucb->io_out); | ||
160 | spin_unlock_irqrestore(&ucb->io_lock, flags); | ||
161 | |||
162 | return 0; | ||
163 | } | ||
164 | |||
111 | /* | 165 | /* |
112 | * UCB1300 data sheet says we must: | 166 | * UCB1300 data sheet says we must: |
113 | * 1. enable ADC => 5us (including reference startup time) | 167 | * 1. enable ADC => 5us (including reference startup time) |
@@ -476,6 +530,7 @@ static int ucb1x00_probe(struct mcp *mcp) | |||
476 | struct ucb1x00_driver *drv; | 530 | struct ucb1x00_driver *drv; |
477 | unsigned int id; | 531 | unsigned int id; |
478 | int ret = -ENODEV; | 532 | int ret = -ENODEV; |
533 | int temp; | ||
479 | 534 | ||
480 | mcp_enable(mcp); | 535 | mcp_enable(mcp); |
481 | id = mcp_reg_read(mcp, UCB_ID); | 536 | id = mcp_reg_read(mcp, UCB_ID); |
@@ -508,12 +563,27 @@ static int ucb1x00_probe(struct mcp *mcp) | |||
508 | goto err_free; | 563 | goto err_free; |
509 | } | 564 | } |
510 | 565 | ||
566 | ucb->gpio.base = -1; | ||
567 | if (mcp->gpio_base != 0) { | ||
568 | ucb->gpio.label = dev_name(&ucb->dev); | ||
569 | ucb->gpio.base = mcp->gpio_base; | ||
570 | ucb->gpio.ngpio = 10; | ||
571 | ucb->gpio.set = ucb1x00_gpio_set; | ||
572 | ucb->gpio.get = ucb1x00_gpio_get; | ||
573 | ucb->gpio.direction_input = ucb1x00_gpio_direction_input; | ||
574 | ucb->gpio.direction_output = ucb1x00_gpio_direction_output; | ||
575 | ret = gpiochip_add(&ucb->gpio); | ||
576 | if (ret) | ||
577 | goto err_free; | ||
578 | } else | ||
579 | dev_info(&ucb->dev, "gpio_base not set so no gpiolib support"); | ||
580 | |||
511 | ret = request_irq(ucb->irq, ucb1x00_irq, IRQF_TRIGGER_RISING, | 581 | ret = request_irq(ucb->irq, ucb1x00_irq, IRQF_TRIGGER_RISING, |
512 | "UCB1x00", ucb); | 582 | "UCB1x00", ucb); |
513 | if (ret) { | 583 | if (ret) { |
514 | printk(KERN_ERR "ucb1x00: unable to grab irq%d: %d\n", | 584 | printk(KERN_ERR "ucb1x00: unable to grab irq%d: %d\n", |
515 | ucb->irq, ret); | 585 | ucb->irq, ret); |
516 | goto err_free; | 586 | goto err_gpio; |
517 | } | 587 | } |
518 | 588 | ||
519 | mcp_set_drvdata(mcp, ucb); | 589 | mcp_set_drvdata(mcp, ucb); |
@@ -522,6 +592,7 @@ static int ucb1x00_probe(struct mcp *mcp) | |||
522 | if (ret) | 592 | if (ret) |
523 | goto err_irq; | 593 | goto err_irq; |
524 | 594 | ||
595 | |||
525 | INIT_LIST_HEAD(&ucb->devs); | 596 | INIT_LIST_HEAD(&ucb->devs); |
526 | mutex_lock(&ucb1x00_mutex); | 597 | mutex_lock(&ucb1x00_mutex); |
527 | list_add(&ucb->node, &ucb1x00_devices); | 598 | list_add(&ucb->node, &ucb1x00_devices); |
@@ -529,10 +600,14 @@ static int ucb1x00_probe(struct mcp *mcp) | |||
529 | ucb1x00_add_dev(ucb, drv); | 600 | ucb1x00_add_dev(ucb, drv); |
530 | } | 601 | } |
531 | mutex_unlock(&ucb1x00_mutex); | 602 | mutex_unlock(&ucb1x00_mutex); |
603 | |||
532 | goto out; | 604 | goto out; |
533 | 605 | ||
534 | err_irq: | 606 | err_irq: |
535 | free_irq(ucb->irq, ucb); | 607 | free_irq(ucb->irq, ucb); |
608 | err_gpio: | ||
609 | if (ucb->gpio.base != -1) | ||
610 | temp = gpiochip_remove(&ucb->gpio); | ||
536 | err_free: | 611 | err_free: |
537 | kfree(ucb); | 612 | kfree(ucb); |
538 | err_disable: | 613 | err_disable: |
@@ -545,6 +620,7 @@ static void ucb1x00_remove(struct mcp *mcp) | |||
545 | { | 620 | { |
546 | struct ucb1x00 *ucb = mcp_get_drvdata(mcp); | 621 | struct ucb1x00 *ucb = mcp_get_drvdata(mcp); |
547 | struct list_head *l, *n; | 622 | struct list_head *l, *n; |
623 | int ret; | ||
548 | 624 | ||
549 | mutex_lock(&ucb1x00_mutex); | 625 | mutex_lock(&ucb1x00_mutex); |
550 | list_del(&ucb->node); | 626 | list_del(&ucb->node); |
@@ -554,6 +630,12 @@ static void ucb1x00_remove(struct mcp *mcp) | |||
554 | } | 630 | } |
555 | mutex_unlock(&ucb1x00_mutex); | 631 | mutex_unlock(&ucb1x00_mutex); |
556 | 632 | ||
633 | if (ucb->gpio.base != -1) { | ||
634 | ret = gpiochip_remove(&ucb->gpio); | ||
635 | if (ret) | ||
636 | dev_err(&ucb->dev, "Can't remove gpio chip: %d\n", ret); | ||
637 | } | ||
638 | |||
557 | free_irq(ucb->irq, ucb); | 639 | free_irq(ucb->irq, ucb); |
558 | device_unregister(&ucb->dev); | 640 | device_unregister(&ucb->dev); |
559 | } | 641 | } |
@@ -604,6 +686,7 @@ static int ucb1x00_resume(struct mcp *mcp) | |||
604 | struct ucb1x00 *ucb = mcp_get_drvdata(mcp); | 686 | struct ucb1x00 *ucb = mcp_get_drvdata(mcp); |
605 | struct ucb1x00_dev *dev; | 687 | struct ucb1x00_dev *dev; |
606 | 688 | ||
689 | ucb1x00_reg_write(ucb, UCB_IO_DIR, ucb->io_dir); | ||
607 | mutex_lock(&ucb1x00_mutex); | 690 | mutex_lock(&ucb1x00_mutex); |
608 | list_for_each_entry(dev, &ucb->devs, dev_node) { | 691 | list_for_each_entry(dev, &ucb->devs, dev_node) { |
609 | if (dev->drv->resume) | 692 | if (dev->drv->resume) |
diff --git a/drivers/mfd/ucb1x00-ts.c b/drivers/mfd/ucb1x00-ts.c index 61b7d3eb9a2f..000cb414a78a 100644 --- a/drivers/mfd/ucb1x00-ts.c +++ b/drivers/mfd/ucb1x00-ts.c | |||
@@ -30,12 +30,12 @@ | |||
30 | #include <linux/freezer.h> | 30 | #include <linux/freezer.h> |
31 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
32 | #include <linux/kthread.h> | 32 | #include <linux/kthread.h> |
33 | #include <linux/mfd/ucb1x00.h> | ||
33 | 34 | ||
34 | #include <mach/dma.h> | 35 | #include <mach/dma.h> |
35 | #include <mach/collie.h> | 36 | #include <mach/collie.h> |
36 | #include <asm/mach-types.h> | 37 | #include <asm/mach-types.h> |
37 | 38 | ||
38 | #include "ucb1x00.h" | ||
39 | 39 | ||
40 | 40 | ||
41 | struct ucb1x00_ts { | 41 | struct ucb1x00_ts { |
diff --git a/drivers/mfd/ucb1x00.h b/drivers/mfd/ucb1x00.h deleted file mode 100644 index a8ad8a0ed5db..000000000000 --- a/drivers/mfd/ucb1x00.h +++ /dev/null | |||
@@ -1,255 +0,0 @@ | |||
1 | /* | ||
2 | * linux/drivers/mfd/ucb1x00.h | ||
3 | * | ||
4 | * Copyright (C) 2001 Russell King, All Rights Reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License. | ||
9 | */ | ||
10 | #ifndef UCB1200_H | ||
11 | #define UCB1200_H | ||
12 | |||
13 | #define UCB_IO_DATA 0x00 | ||
14 | #define UCB_IO_DIR 0x01 | ||
15 | |||
16 | #define UCB_IO_0 (1 << 0) | ||
17 | #define UCB_IO_1 (1 << 1) | ||
18 | #define UCB_IO_2 (1 << 2) | ||
19 | #define UCB_IO_3 (1 << 3) | ||
20 | #define UCB_IO_4 (1 << 4) | ||
21 | #define UCB_IO_5 (1 << 5) | ||
22 | #define UCB_IO_6 (1 << 6) | ||
23 | #define UCB_IO_7 (1 << 7) | ||
24 | #define UCB_IO_8 (1 << 8) | ||
25 | #define UCB_IO_9 (1 << 9) | ||
26 | |||
27 | #define UCB_IE_RIS 0x02 | ||
28 | #define UCB_IE_FAL 0x03 | ||
29 | #define UCB_IE_STATUS 0x04 | ||
30 | #define UCB_IE_CLEAR 0x04 | ||
31 | #define UCB_IE_ADC (1 << 11) | ||
32 | #define UCB_IE_TSPX (1 << 12) | ||
33 | #define UCB_IE_TSMX (1 << 13) | ||
34 | #define UCB_IE_TCLIP (1 << 14) | ||
35 | #define UCB_IE_ACLIP (1 << 15) | ||
36 | |||
37 | #define UCB_IRQ_TSPX 12 | ||
38 | |||
39 | #define UCB_TC_A 0x05 | ||
40 | #define UCB_TC_A_LOOP (1 << 7) /* UCB1200 */ | ||
41 | #define UCB_TC_A_AMPL (1 << 7) /* UCB1300 */ | ||
42 | |||
43 | #define UCB_TC_B 0x06 | ||
44 | #define UCB_TC_B_VOICE_ENA (1 << 3) | ||
45 | #define UCB_TC_B_CLIP (1 << 4) | ||
46 | #define UCB_TC_B_ATT (1 << 6) | ||
47 | #define UCB_TC_B_SIDE_ENA (1 << 11) | ||
48 | #define UCB_TC_B_MUTE (1 << 13) | ||
49 | #define UCB_TC_B_IN_ENA (1 << 14) | ||
50 | #define UCB_TC_B_OUT_ENA (1 << 15) | ||
51 | |||
52 | #define UCB_AC_A 0x07 | ||
53 | #define UCB_AC_B 0x08 | ||
54 | #define UCB_AC_B_LOOP (1 << 8) | ||
55 | #define UCB_AC_B_MUTE (1 << 13) | ||
56 | #define UCB_AC_B_IN_ENA (1 << 14) | ||
57 | #define UCB_AC_B_OUT_ENA (1 << 15) | ||
58 | |||
59 | #define UCB_TS_CR 0x09 | ||
60 | #define UCB_TS_CR_TSMX_POW (1 << 0) | ||
61 | #define UCB_TS_CR_TSPX_POW (1 << 1) | ||
62 | #define UCB_TS_CR_TSMY_POW (1 << 2) | ||
63 | #define UCB_TS_CR_TSPY_POW (1 << 3) | ||
64 | #define UCB_TS_CR_TSMX_GND (1 << 4) | ||
65 | #define UCB_TS_CR_TSPX_GND (1 << 5) | ||
66 | #define UCB_TS_CR_TSMY_GND (1 << 6) | ||
67 | #define UCB_TS_CR_TSPY_GND (1 << 7) | ||
68 | #define UCB_TS_CR_MODE_INT (0 << 8) | ||
69 | #define UCB_TS_CR_MODE_PRES (1 << 8) | ||
70 | #define UCB_TS_CR_MODE_POS (2 << 8) | ||
71 | #define UCB_TS_CR_BIAS_ENA (1 << 11) | ||
72 | #define UCB_TS_CR_TSPX_LOW (1 << 12) | ||
73 | #define UCB_TS_CR_TSMX_LOW (1 << 13) | ||
74 | |||
75 | #define UCB_ADC_CR 0x0a | ||
76 | #define UCB_ADC_SYNC_ENA (1 << 0) | ||
77 | #define UCB_ADC_VREFBYP_CON (1 << 1) | ||
78 | #define UCB_ADC_INP_TSPX (0 << 2) | ||
79 | #define UCB_ADC_INP_TSMX (1 << 2) | ||
80 | #define UCB_ADC_INP_TSPY (2 << 2) | ||
81 | #define UCB_ADC_INP_TSMY (3 << 2) | ||
82 | #define UCB_ADC_INP_AD0 (4 << 2) | ||
83 | #define UCB_ADC_INP_AD1 (5 << 2) | ||
84 | #define UCB_ADC_INP_AD2 (6 << 2) | ||
85 | #define UCB_ADC_INP_AD3 (7 << 2) | ||
86 | #define UCB_ADC_EXT_REF (1 << 5) | ||
87 | #define UCB_ADC_START (1 << 7) | ||
88 | #define UCB_ADC_ENA (1 << 15) | ||
89 | |||
90 | #define UCB_ADC_DATA 0x0b | ||
91 | #define UCB_ADC_DAT_VAL (1 << 15) | ||
92 | #define UCB_ADC_DAT(x) (((x) & 0x7fe0) >> 5) | ||
93 | |||
94 | #define UCB_ID 0x0c | ||
95 | #define UCB_ID_1200 0x1004 | ||
96 | #define UCB_ID_1300 0x1005 | ||
97 | #define UCB_ID_TC35143 0x9712 | ||
98 | |||
99 | #define UCB_MODE 0x0d | ||
100 | #define UCB_MODE_DYN_VFLAG_ENA (1 << 12) | ||
101 | #define UCB_MODE_AUD_OFF_CAN (1 << 13) | ||
102 | |||
103 | #include "mcp.h" | ||
104 | |||
105 | struct ucb1x00_irq { | ||
106 | void *devid; | ||
107 | void (*fn)(int, void *); | ||
108 | }; | ||
109 | |||
110 | struct ucb1x00 { | ||
111 | spinlock_t lock; | ||
112 | struct mcp *mcp; | ||
113 | unsigned int irq; | ||
114 | struct semaphore adc_sem; | ||
115 | spinlock_t io_lock; | ||
116 | u16 id; | ||
117 | u16 io_dir; | ||
118 | u16 io_out; | ||
119 | u16 adc_cr; | ||
120 | u16 irq_fal_enbl; | ||
121 | u16 irq_ris_enbl; | ||
122 | struct ucb1x00_irq irq_handler[16]; | ||
123 | struct device dev; | ||
124 | struct list_head node; | ||
125 | struct list_head devs; | ||
126 | }; | ||
127 | |||
128 | struct ucb1x00_driver; | ||
129 | |||
130 | struct ucb1x00_dev { | ||
131 | struct list_head dev_node; | ||
132 | struct list_head drv_node; | ||
133 | struct ucb1x00 *ucb; | ||
134 | struct ucb1x00_driver *drv; | ||
135 | void *priv; | ||
136 | }; | ||
137 | |||
138 | struct ucb1x00_driver { | ||
139 | struct list_head node; | ||
140 | struct list_head devs; | ||
141 | int (*add)(struct ucb1x00_dev *dev); | ||
142 | void (*remove)(struct ucb1x00_dev *dev); | ||
143 | int (*suspend)(struct ucb1x00_dev *dev, pm_message_t state); | ||
144 | int (*resume)(struct ucb1x00_dev *dev); | ||
145 | }; | ||
146 | |||
147 | #define classdev_to_ucb1x00(cd) container_of(cd, struct ucb1x00, dev) | ||
148 | |||
149 | int ucb1x00_register_driver(struct ucb1x00_driver *); | ||
150 | void ucb1x00_unregister_driver(struct ucb1x00_driver *); | ||
151 | |||
152 | /** | ||
153 | * ucb1x00_clkrate - return the UCB1x00 SIB clock rate | ||
154 | * @ucb: UCB1x00 structure describing chip | ||
155 | * | ||
156 | * Return the SIB clock rate in Hz. | ||
157 | */ | ||
158 | static inline unsigned int ucb1x00_clkrate(struct ucb1x00 *ucb) | ||
159 | { | ||
160 | return mcp_get_sclk_rate(ucb->mcp); | ||
161 | } | ||
162 | |||
163 | /** | ||
164 | * ucb1x00_enable - enable the UCB1x00 SIB clock | ||
165 | * @ucb: UCB1x00 structure describing chip | ||
166 | * | ||
167 | * Enable the SIB clock. This can be called multiple times. | ||
168 | */ | ||
169 | static inline void ucb1x00_enable(struct ucb1x00 *ucb) | ||
170 | { | ||
171 | mcp_enable(ucb->mcp); | ||
172 | } | ||
173 | |||
174 | /** | ||
175 | * ucb1x00_disable - disable the UCB1x00 SIB clock | ||
176 | * @ucb: UCB1x00 structure describing chip | ||
177 | * | ||
178 | * Disable the SIB clock. The SIB clock will only be disabled | ||
179 | * when the number of ucb1x00_enable calls match the number of | ||
180 | * ucb1x00_disable calls. | ||
181 | */ | ||
182 | static inline void ucb1x00_disable(struct ucb1x00 *ucb) | ||
183 | { | ||
184 | mcp_disable(ucb->mcp); | ||
185 | } | ||
186 | |||
187 | /** | ||
188 | * ucb1x00_reg_write - write a UCB1x00 register | ||
189 | * @ucb: UCB1x00 structure describing chip | ||
190 | * @reg: UCB1x00 4-bit register index to write | ||
191 | * @val: UCB1x00 16-bit value to write | ||
192 | * | ||
193 | * Write the UCB1x00 register @reg with value @val. The SIB | ||
194 | * clock must be running for this function to return. | ||
195 | */ | ||
196 | static inline void ucb1x00_reg_write(struct ucb1x00 *ucb, unsigned int reg, unsigned int val) | ||
197 | { | ||
198 | mcp_reg_write(ucb->mcp, reg, val); | ||
199 | } | ||
200 | |||
201 | /** | ||
202 | * ucb1x00_reg_read - read a UCB1x00 register | ||
203 | * @ucb: UCB1x00 structure describing chip | ||
204 | * @reg: UCB1x00 4-bit register index to write | ||
205 | * | ||
206 | * Read the UCB1x00 register @reg and return its value. The SIB | ||
207 | * clock must be running for this function to return. | ||
208 | */ | ||
209 | static inline unsigned int ucb1x00_reg_read(struct ucb1x00 *ucb, unsigned int reg) | ||
210 | { | ||
211 | return mcp_reg_read(ucb->mcp, reg); | ||
212 | } | ||
213 | /** | ||
214 | * ucb1x00_set_audio_divisor - | ||
215 | * @ucb: UCB1x00 structure describing chip | ||
216 | * @div: SIB clock divisor | ||
217 | */ | ||
218 | static inline void ucb1x00_set_audio_divisor(struct ucb1x00 *ucb, unsigned int div) | ||
219 | { | ||
220 | mcp_set_audio_divisor(ucb->mcp, div); | ||
221 | } | ||
222 | |||
223 | /** | ||
224 | * ucb1x00_set_telecom_divisor - | ||
225 | * @ucb: UCB1x00 structure describing chip | ||
226 | * @div: SIB clock divisor | ||
227 | */ | ||
228 | static inline void ucb1x00_set_telecom_divisor(struct ucb1x00 *ucb, unsigned int div) | ||
229 | { | ||
230 | mcp_set_telecom_divisor(ucb->mcp, div); | ||
231 | } | ||
232 | |||
233 | void ucb1x00_io_set_dir(struct ucb1x00 *ucb, unsigned int, unsigned int); | ||
234 | void ucb1x00_io_write(struct ucb1x00 *ucb, unsigned int, unsigned int); | ||
235 | unsigned int ucb1x00_io_read(struct ucb1x00 *ucb); | ||
236 | |||
237 | #define UCB_NOSYNC (0) | ||
238 | #define UCB_SYNC (1) | ||
239 | |||
240 | unsigned int ucb1x00_adc_read(struct ucb1x00 *ucb, int adc_channel, int sync); | ||
241 | void ucb1x00_adc_enable(struct ucb1x00 *ucb); | ||
242 | void ucb1x00_adc_disable(struct ucb1x00 *ucb); | ||
243 | |||
244 | /* | ||
245 | * Which edges of the IRQ do you want to control today? | ||
246 | */ | ||
247 | #define UCB_RISING (1 << 0) | ||
248 | #define UCB_FALLING (1 << 1) | ||
249 | |||
250 | int ucb1x00_hook_irq(struct ucb1x00 *ucb, unsigned int idx, void (*fn)(int, void *), void *devid); | ||
251 | void ucb1x00_enable_irq(struct ucb1x00 *ucb, unsigned int idx, int edges); | ||
252 | void ucb1x00_disable_irq(struct ucb1x00 *ucb, unsigned int idx, int edges); | ||
253 | int ucb1x00_free_irq(struct ucb1x00 *ucb, unsigned int idx, void *devid); | ||
254 | |||
255 | #endif | ||
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 705a5894a6bb..90d168ad03b6 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -56,7 +56,7 @@ static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired) | |||
56 | clk = 255; | 56 | clk = 255; |
57 | host->cclk = host->mclk / (2 * (clk + 1)); | 57 | host->cclk = host->mclk / (2 * (clk + 1)); |
58 | } | 58 | } |
59 | if (host->hw_designer == 0x80) | 59 | if (host->hw_designer == AMBA_VENDOR_ST) |
60 | clk |= MCI_FCEN; /* Bug fix in ST IP block */ | 60 | clk |= MCI_FCEN; /* Bug fix in ST IP block */ |
61 | clk |= MCI_CLK_ENABLE; | 61 | clk |= MCI_CLK_ENABLE; |
62 | /* This hasn't proven to be worthwhile */ | 62 | /* This hasn't proven to be worthwhile */ |
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c index 9fb480bb0e0a..bb47ff465c04 100644 --- a/drivers/mmc/host/pxamci.c +++ b/drivers/mmc/host/pxamci.c | |||
@@ -43,6 +43,9 @@ | |||
43 | #define NR_SG 1 | 43 | #define NR_SG 1 |
44 | #define CLKRT_OFF (~0) | 44 | #define CLKRT_OFF (~0) |
45 | 45 | ||
46 | #define mmc_has_26MHz() (cpu_is_pxa300() || cpu_is_pxa310() \ | ||
47 | || cpu_is_pxa935()) | ||
48 | |||
46 | struct pxamci_host { | 49 | struct pxamci_host { |
47 | struct mmc_host *mmc; | 50 | struct mmc_host *mmc; |
48 | spinlock_t lock; | 51 | spinlock_t lock; |
@@ -457,7 +460,7 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
457 | clk_enable(host->clk); | 460 | clk_enable(host->clk); |
458 | 461 | ||
459 | if (ios->clock == 26000000) { | 462 | if (ios->clock == 26000000) { |
460 | /* to support 26MHz on pxa300/pxa310 */ | 463 | /* to support 26MHz */ |
461 | host->clkrt = 7; | 464 | host->clkrt = 7; |
462 | } else { | 465 | } else { |
463 | /* to handle (19.5MHz, 26MHz) */ | 466 | /* to handle (19.5MHz, 26MHz) */ |
@@ -608,8 +611,7 @@ static int pxamci_probe(struct platform_device *pdev) | |||
608 | * Calculate minimum clock rate, rounding up. | 611 | * Calculate minimum clock rate, rounding up. |
609 | */ | 612 | */ |
610 | mmc->f_min = (host->clkrate + 63) / 64; | 613 | mmc->f_min = (host->clkrate + 63) / 64; |
611 | mmc->f_max = (cpu_is_pxa300() || cpu_is_pxa310()) ? 26000000 | 614 | mmc->f_max = (mmc_has_26MHz()) ? 26000000 : host->clkrate; |
612 | : host->clkrate; | ||
613 | 615 | ||
614 | pxamci_init_ocr(host); | 616 | pxamci_init_ocr(host); |
615 | 617 | ||
@@ -618,7 +620,7 @@ static int pxamci_probe(struct platform_device *pdev) | |||
618 | if (!cpu_is_pxa25x()) { | 620 | if (!cpu_is_pxa25x()) { |
619 | mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ; | 621 | mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ; |
620 | host->cmdat |= CMDAT_SDIO_INT_EN; | 622 | host->cmdat |= CMDAT_SDIO_INT_EN; |
621 | if (cpu_is_pxa300() || cpu_is_pxa310()) | 623 | if (mmc_has_26MHz()) |
622 | mmc->caps |= MMC_CAP_MMC_HIGHSPEED | | 624 | mmc->caps |= MMC_CAP_MMC_HIGHSPEED | |
623 | MMC_CAP_SD_HIGHSPEED; | 625 | MMC_CAP_SD_HIGHSPEED; |
624 | } | 626 | } |
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig index 2fda0b615246..8f8e87b7ed64 100644 --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig | |||
@@ -358,7 +358,7 @@ endchoice | |||
358 | 358 | ||
359 | config MTD_NAND_PXA3xx | 359 | config MTD_NAND_PXA3xx |
360 | tristate "Support for NAND flash devices on PXA3xx" | 360 | tristate "Support for NAND flash devices on PXA3xx" |
361 | depends on MTD_NAND && PXA3xx | 361 | depends on MTD_NAND && (PXA3xx || ARCH_MMP) |
362 | help | 362 | help |
363 | This enables the driver for the NAND flash device found on | 363 | This enables the driver for the NAND flash device found on |
364 | PXA3xx processors | 364 | PXA3xx processors |
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 6ea520ae2410..1a5a0365c983 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c | |||
@@ -9,6 +9,7 @@ | |||
9 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/kernel.h> | ||
12 | #include <linux/module.h> | 13 | #include <linux/module.h> |
13 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
14 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
@@ -22,7 +23,7 @@ | |||
22 | #include <linux/irq.h> | 23 | #include <linux/irq.h> |
23 | 24 | ||
24 | #include <mach/dma.h> | 25 | #include <mach/dma.h> |
25 | #include <mach/pxa3xx_nand.h> | 26 | #include <plat/pxa3xx_nand.h> |
26 | 27 | ||
27 | #define CHIP_DELAY_TIMEOUT (2 * HZ/10) | 28 | #define CHIP_DELAY_TIMEOUT (2 * HZ/10) |
28 | 29 | ||
@@ -84,10 +85,6 @@ | |||
84 | #define NDCB0_CMD1_MASK (0xff) | 85 | #define NDCB0_CMD1_MASK (0xff) |
85 | #define NDCB0_ADDR_CYC_SHIFT (16) | 86 | #define NDCB0_ADDR_CYC_SHIFT (16) |
86 | 87 | ||
87 | /* dma-able I/O address for the NAND data and commands */ | ||
88 | #define NDCB0_DMA_ADDR (0x43100048) | ||
89 | #define NDDB_DMA_ADDR (0x43100040) | ||
90 | |||
91 | /* macros for registers read/write */ | 88 | /* macros for registers read/write */ |
92 | #define nand_writel(info, off, val) \ | 89 | #define nand_writel(info, off, val) \ |
93 | __raw_writel((val), (info)->mmio_base + (off)) | 90 | __raw_writel((val), (info)->mmio_base + (off)) |
@@ -123,6 +120,7 @@ struct pxa3xx_nand_info { | |||
123 | 120 | ||
124 | struct clk *clk; | 121 | struct clk *clk; |
125 | void __iomem *mmio_base; | 122 | void __iomem *mmio_base; |
123 | unsigned long mmio_phys; | ||
126 | 124 | ||
127 | unsigned int buf_start; | 125 | unsigned int buf_start; |
128 | unsigned int buf_count; | 126 | unsigned int buf_count; |
@@ -228,13 +226,35 @@ static struct pxa3xx_nand_flash samsung512MbX16 = { | |||
228 | .chip_id = 0x46ec, | 226 | .chip_id = 0x46ec, |
229 | }; | 227 | }; |
230 | 228 | ||
229 | static struct pxa3xx_nand_flash samsung2GbX8 = { | ||
230 | .timing = &samsung512MbX16_timing, | ||
231 | .cmdset = &smallpage_cmdset, | ||
232 | .page_per_block = 64, | ||
233 | .page_size = 2048, | ||
234 | .flash_width = 8, | ||
235 | .dfc_width = 8, | ||
236 | .num_blocks = 2048, | ||
237 | .chip_id = 0xdaec, | ||
238 | }; | ||
239 | |||
240 | static struct pxa3xx_nand_flash samsung32GbX8 = { | ||
241 | .timing = &samsung512MbX16_timing, | ||
242 | .cmdset = &smallpage_cmdset, | ||
243 | .page_per_block = 128, | ||
244 | .page_size = 4096, | ||
245 | .flash_width = 8, | ||
246 | .dfc_width = 8, | ||
247 | .num_blocks = 8192, | ||
248 | .chip_id = 0xd7ec, | ||
249 | }; | ||
250 | |||
231 | static struct pxa3xx_nand_timing micron_timing = { | 251 | static struct pxa3xx_nand_timing micron_timing = { |
232 | .tCH = 10, | 252 | .tCH = 10, |
233 | .tCS = 25, | 253 | .tCS = 25, |
234 | .tWH = 15, | 254 | .tWH = 15, |
235 | .tWP = 25, | 255 | .tWP = 25, |
236 | .tRH = 15, | 256 | .tRH = 15, |
237 | .tRP = 25, | 257 | .tRP = 30, |
238 | .tR = 25000, | 258 | .tR = 25000, |
239 | .tWHR = 60, | 259 | .tWHR = 60, |
240 | .tAR = 10, | 260 | .tAR = 10, |
@@ -262,6 +282,28 @@ static struct pxa3xx_nand_flash micron1GbX16 = { | |||
262 | .chip_id = 0xb12c, | 282 | .chip_id = 0xb12c, |
263 | }; | 283 | }; |
264 | 284 | ||
285 | static struct pxa3xx_nand_flash micron4GbX8 = { | ||
286 | .timing = µn_timing, | ||
287 | .cmdset = &largepage_cmdset, | ||
288 | .page_per_block = 64, | ||
289 | .page_size = 2048, | ||
290 | .flash_width = 8, | ||
291 | .dfc_width = 8, | ||
292 | .num_blocks = 4096, | ||
293 | .chip_id = 0xdc2c, | ||
294 | }; | ||
295 | |||
296 | static struct pxa3xx_nand_flash micron4GbX16 = { | ||
297 | .timing = µn_timing, | ||
298 | .cmdset = &largepage_cmdset, | ||
299 | .page_per_block = 64, | ||
300 | .page_size = 2048, | ||
301 | .flash_width = 16, | ||
302 | .dfc_width = 16, | ||
303 | .num_blocks = 4096, | ||
304 | .chip_id = 0xcc2c, | ||
305 | }; | ||
306 | |||
265 | static struct pxa3xx_nand_timing stm2GbX16_timing = { | 307 | static struct pxa3xx_nand_timing stm2GbX16_timing = { |
266 | .tCH = 10, | 308 | .tCH = 10, |
267 | .tCS = 35, | 309 | .tCS = 35, |
@@ -287,8 +329,12 @@ static struct pxa3xx_nand_flash stm2GbX16 = { | |||
287 | 329 | ||
288 | static struct pxa3xx_nand_flash *builtin_flash_types[] = { | 330 | static struct pxa3xx_nand_flash *builtin_flash_types[] = { |
289 | &samsung512MbX16, | 331 | &samsung512MbX16, |
332 | &samsung2GbX8, | ||
333 | &samsung32GbX8, | ||
290 | µn1GbX8, | 334 | µn1GbX8, |
291 | µn1GbX16, | 335 | µn1GbX16, |
336 | µn4GbX8, | ||
337 | µn4GbX16, | ||
292 | &stm2GbX16, | 338 | &stm2GbX16, |
293 | }; | 339 | }; |
294 | #endif /* CONFIG_MTD_NAND_PXA3xx_BUILTIN */ | 340 | #endif /* CONFIG_MTD_NAND_PXA3xx_BUILTIN */ |
@@ -489,7 +535,7 @@ static int handle_data_pio(struct pxa3xx_nand_info *info) | |||
489 | switch (info->state) { | 535 | switch (info->state) { |
490 | case STATE_PIO_WRITING: | 536 | case STATE_PIO_WRITING: |
491 | __raw_writesl(info->mmio_base + NDDB, info->data_buff, | 537 | __raw_writesl(info->mmio_base + NDDB, info->data_buff, |
492 | info->data_size << 2); | 538 | DIV_ROUND_UP(info->data_size, 4)); |
493 | 539 | ||
494 | enable_int(info, NDSR_CS0_BBD | NDSR_CS0_CMDD); | 540 | enable_int(info, NDSR_CS0_BBD | NDSR_CS0_CMDD); |
495 | 541 | ||
@@ -501,7 +547,7 @@ static int handle_data_pio(struct pxa3xx_nand_info *info) | |||
501 | break; | 547 | break; |
502 | case STATE_PIO_READING: | 548 | case STATE_PIO_READING: |
503 | __raw_readsl(info->mmio_base + NDDB, info->data_buff, | 549 | __raw_readsl(info->mmio_base + NDDB, info->data_buff, |
504 | info->data_size << 2); | 550 | DIV_ROUND_UP(info->data_size, 4)); |
505 | break; | 551 | break; |
506 | default: | 552 | default: |
507 | printk(KERN_ERR "%s: invalid state %d\n", __func__, | 553 | printk(KERN_ERR "%s: invalid state %d\n", __func__, |
@@ -523,11 +569,11 @@ static void start_data_dma(struct pxa3xx_nand_info *info, int dir_out) | |||
523 | 569 | ||
524 | if (dir_out) { | 570 | if (dir_out) { |
525 | desc->dsadr = info->data_buff_phys; | 571 | desc->dsadr = info->data_buff_phys; |
526 | desc->dtadr = NDDB_DMA_ADDR; | 572 | desc->dtadr = info->mmio_phys + NDDB; |
527 | desc->dcmd |= DCMD_INCSRCADDR | DCMD_FLOWTRG; | 573 | desc->dcmd |= DCMD_INCSRCADDR | DCMD_FLOWTRG; |
528 | } else { | 574 | } else { |
529 | desc->dtadr = info->data_buff_phys; | 575 | desc->dtadr = info->data_buff_phys; |
530 | desc->dsadr = NDDB_DMA_ADDR; | 576 | desc->dsadr = info->mmio_phys + NDDB; |
531 | desc->dcmd |= DCMD_INCTRGADDR | DCMD_FLOWSRC; | 577 | desc->dcmd |= DCMD_INCTRGADDR | DCMD_FLOWSRC; |
532 | } | 578 | } |
533 | 579 | ||
@@ -669,6 +715,7 @@ static void pxa3xx_nand_cmdfunc(struct mtd_info *mtd, unsigned command, | |||
669 | /* disable HW ECC to get all the OOB data */ | 715 | /* disable HW ECC to get all the OOB data */ |
670 | info->buf_count = mtd->writesize + mtd->oobsize; | 716 | info->buf_count = mtd->writesize + mtd->oobsize; |
671 | info->buf_start = mtd->writesize + column; | 717 | info->buf_start = mtd->writesize + column; |
718 | memset(info->data_buff, 0xFF, info->buf_count); | ||
672 | 719 | ||
673 | if (prepare_read_prog_cmd(info, cmdset->read1, column, page_addr)) | 720 | if (prepare_read_prog_cmd(info, cmdset->read1, column, page_addr)) |
674 | break; | 721 | break; |
@@ -1239,13 +1286,17 @@ static int pxa3xx_nand_probe(struct platform_device *pdev) | |||
1239 | ret = -ENODEV; | 1286 | ret = -ENODEV; |
1240 | goto fail_free_res; | 1287 | goto fail_free_res; |
1241 | } | 1288 | } |
1289 | info->mmio_phys = r->start; | ||
1242 | 1290 | ||
1243 | ret = pxa3xx_nand_init_buff(info); | 1291 | ret = pxa3xx_nand_init_buff(info); |
1244 | if (ret) | 1292 | if (ret) |
1245 | goto fail_free_io; | 1293 | goto fail_free_io; |
1246 | 1294 | ||
1247 | ret = request_irq(IRQ_NAND, pxa3xx_nand_irq, IRQF_DISABLED, | 1295 | /* initialize all interrupts to be disabled */ |
1248 | pdev->name, info); | 1296 | disable_int(info, NDSR_MASK); |
1297 | |||
1298 | ret = request_irq(irq, pxa3xx_nand_irq, IRQF_DISABLED, | ||
1299 | pdev->name, info); | ||
1249 | if (ret < 0) { | 1300 | if (ret < 0) { |
1250 | dev_err(&pdev->dev, "failed to request IRQ\n"); | 1301 | dev_err(&pdev->dev, "failed to request IRQ\n"); |
1251 | goto fail_free_buf; | 1302 | goto fail_free_buf; |
@@ -1271,7 +1322,7 @@ static int pxa3xx_nand_probe(struct platform_device *pdev) | |||
1271 | return add_mtd_partitions(mtd, pdata->parts, pdata->nr_parts); | 1322 | return add_mtd_partitions(mtd, pdata->parts, pdata->nr_parts); |
1272 | 1323 | ||
1273 | fail_free_irq: | 1324 | fail_free_irq: |
1274 | free_irq(IRQ_NAND, info); | 1325 | free_irq(irq, info); |
1275 | fail_free_buf: | 1326 | fail_free_buf: |
1276 | if (use_dma) { | 1327 | if (use_dma) { |
1277 | pxa_free_dma(info->data_dma_ch); | 1328 | pxa_free_dma(info->data_dma_ch); |
@@ -1296,12 +1347,15 @@ static int pxa3xx_nand_remove(struct platform_device *pdev) | |||
1296 | struct mtd_info *mtd = platform_get_drvdata(pdev); | 1347 | struct mtd_info *mtd = platform_get_drvdata(pdev); |
1297 | struct pxa3xx_nand_info *info = mtd->priv; | 1348 | struct pxa3xx_nand_info *info = mtd->priv; |
1298 | struct resource *r; | 1349 | struct resource *r; |
1350 | int irq; | ||
1299 | 1351 | ||
1300 | platform_set_drvdata(pdev, NULL); | 1352 | platform_set_drvdata(pdev, NULL); |
1301 | 1353 | ||
1302 | del_mtd_device(mtd); | 1354 | del_mtd_device(mtd); |
1303 | del_mtd_partitions(mtd); | 1355 | del_mtd_partitions(mtd); |
1304 | free_irq(IRQ_NAND, info); | 1356 | irq = platform_get_irq(pdev, 0); |
1357 | if (irq >= 0) | ||
1358 | free_irq(irq, info); | ||
1305 | if (use_dma) { | 1359 | if (use_dma) { |
1306 | pxa_free_dma(info->data_dma_ch); | 1360 | pxa_free_dma(info->data_dma_ch); |
1307 | dma_free_writecombine(&pdev->dev, info->data_buff_size, | 1361 | dma_free_writecombine(&pdev->dev, info->data_buff_size, |
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig index f3ccbccf5f21..cd5082d3ca19 100644 --- a/drivers/pcmcia/Kconfig +++ b/drivers/pcmcia/Kconfig | |||
@@ -179,7 +179,7 @@ config PCMCIA_BCM63XX | |||
179 | depends on BCM63XX && PCMCIA | 179 | depends on BCM63XX && PCMCIA |
180 | 180 | ||
181 | config PCMCIA_SOC_COMMON | 181 | config PCMCIA_SOC_COMMON |
182 | bool | 182 | tristate |
183 | 183 | ||
184 | config PCMCIA_SA1100 | 184 | config PCMCIA_SA1100 |
185 | tristate "SA1100 support" | 185 | tristate "SA1100 support" |
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c index 11cc3ba1260a..8db86b90c200 100644 --- a/drivers/pcmcia/sa1100_generic.c +++ b/drivers/pcmcia/sa1100_generic.c | |||
@@ -51,7 +51,7 @@ static int (*sa11x0_pcmcia_hw_init[])(struct device *dev) = { | |||
51 | #ifdef CONFIG_SA1100_CERF | 51 | #ifdef CONFIG_SA1100_CERF |
52 | pcmcia_cerf_init, | 52 | pcmcia_cerf_init, |
53 | #endif | 53 | #endif |
54 | #ifdef CONFIG_SA1100_H3600 | 54 | #if defined(CONFIG_SA1100_H3100) || defined(CONFIG_SA1100_H3600) |
55 | pcmcia_h3600_init, | 55 | pcmcia_h3600_init, |
56 | #endif | 56 | #endif |
57 | #ifdef CONFIG_SA1100_SHANNON | 57 | #ifdef CONFIG_SA1100_SHANNON |
diff --git a/drivers/pcmcia/sa1100_h3600.c b/drivers/pcmcia/sa1100_h3600.c index 3a121ac697d6..56329ad575a9 100644 --- a/drivers/pcmcia/sa1100_h3600.c +++ b/drivers/pcmcia/sa1100_h3600.c | |||
@@ -10,47 +10,139 @@ | |||
10 | #include <linux/interrupt.h> | 10 | #include <linux/interrupt.h> |
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/delay.h> | 12 | #include <linux/delay.h> |
13 | #include <linux/gpio.h> | ||
13 | 14 | ||
14 | #include <mach/hardware.h> | 15 | #include <mach/hardware.h> |
15 | #include <asm/irq.h> | 16 | #include <asm/irq.h> |
16 | #include <asm/mach-types.h> | 17 | #include <asm/mach-types.h> |
17 | #include <mach/h3600.h> | 18 | #include <mach/h3xxx.h> |
18 | 19 | ||
19 | #include "sa1100_generic.h" | 20 | #include "sa1100_generic.h" |
20 | 21 | ||
21 | static struct pcmcia_irqs irqs[] = { | 22 | static struct pcmcia_irqs irqs[] = { |
22 | { 0, IRQ_GPIO_H3600_PCMCIA_CD0, "PCMCIA CD0" }, | 23 | { .sock = 0, .str = "PCMCIA CD0" }, /* .irq will be filled later */ |
23 | { 1, IRQ_GPIO_H3600_PCMCIA_CD1, "PCMCIA CD1" } | 24 | { .sock = 1, .str = "PCMCIA CD1" } |
24 | }; | 25 | }; |
25 | 26 | ||
26 | static int h3600_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | 27 | static int h3600_pcmcia_hw_init(struct soc_pcmcia_socket *skt) |
27 | { | 28 | { |
28 | skt->socket.pci_irq = skt->nr ? IRQ_GPIO_H3600_PCMCIA_IRQ1 | 29 | int err; |
29 | : IRQ_GPIO_H3600_PCMCIA_IRQ0; | ||
30 | 30 | ||
31 | switch (skt->nr) { | ||
32 | case 0: | ||
33 | err = gpio_request(H3XXX_GPIO_PCMCIA_IRQ0, "PCMCIA IRQ0"); | ||
34 | if (err) | ||
35 | goto err00; | ||
36 | err = gpio_direction_input(H3XXX_GPIO_PCMCIA_IRQ0); | ||
37 | if (err) | ||
38 | goto err01; | ||
39 | skt->socket.pci_irq = gpio_to_irq(H3XXX_GPIO_PCMCIA_IRQ0); | ||
40 | |||
41 | err = gpio_request(H3XXX_GPIO_PCMCIA_CD0, "PCMCIA CD0"); | ||
42 | if (err) | ||
43 | goto err01; | ||
44 | err = gpio_direction_input(H3XXX_GPIO_PCMCIA_CD0); | ||
45 | if (err) | ||
46 | goto err02; | ||
47 | irqs[0].irq = gpio_to_irq(H3XXX_GPIO_PCMCIA_CD0); | ||
48 | |||
49 | err = gpio_request(H3XXX_EGPIO_OPT_NVRAM_ON, "OPT NVRAM ON"); | ||
50 | if (err) | ||
51 | goto err02; | ||
52 | err = gpio_direction_output(H3XXX_EGPIO_OPT_NVRAM_ON, 0); | ||
53 | if (err) | ||
54 | goto err03; | ||
55 | err = gpio_request(H3XXX_EGPIO_OPT_ON, "OPT ON"); | ||
56 | if (err) | ||
57 | goto err03; | ||
58 | err = gpio_direction_output(H3XXX_EGPIO_OPT_ON, 0); | ||
59 | if (err) | ||
60 | goto err04; | ||
61 | err = gpio_request(H3XXX_EGPIO_OPT_RESET, "OPT RESET"); | ||
62 | if (err) | ||
63 | goto err04; | ||
64 | err = gpio_direction_output(H3XXX_EGPIO_OPT_RESET, 0); | ||
65 | if (err) | ||
66 | goto err05; | ||
67 | err = gpio_request(H3XXX_EGPIO_CARD_RESET, "PCMCIA CARD RESET"); | ||
68 | if (err) | ||
69 | goto err05; | ||
70 | err = gpio_direction_output(H3XXX_EGPIO_CARD_RESET, 0); | ||
71 | if (err) | ||
72 | goto err06; | ||
73 | err = soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); | ||
74 | if (err) | ||
75 | goto err06; | ||
76 | break; | ||
77 | case 1: | ||
78 | err = gpio_request(H3XXX_GPIO_PCMCIA_IRQ1, "PCMCIA IRQ1"); | ||
79 | if (err) | ||
80 | goto err10; | ||
81 | err = gpio_direction_input(H3XXX_GPIO_PCMCIA_IRQ1); | ||
82 | if (err) | ||
83 | goto err11; | ||
84 | skt->socket.pci_irq = gpio_to_irq(H3XXX_GPIO_PCMCIA_IRQ1); | ||
85 | |||
86 | err = gpio_request(H3XXX_GPIO_PCMCIA_CD1, "PCMCIA CD1"); | ||
87 | if (err) | ||
88 | goto err11; | ||
89 | err = gpio_direction_input(H3XXX_GPIO_PCMCIA_CD1); | ||
90 | if (err) | ||
91 | goto err12; | ||
92 | irqs[1].irq = gpio_to_irq(H3XXX_GPIO_PCMCIA_CD1); | ||
93 | |||
94 | err = soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); | ||
95 | if (err) | ||
96 | goto err12; | ||
97 | break; | ||
98 | } | ||
99 | return 0; | ||
31 | 100 | ||
32 | return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); | 101 | err06: gpio_free(H3XXX_EGPIO_CARD_RESET); |
102 | err05: gpio_free(H3XXX_EGPIO_OPT_RESET); | ||
103 | err04: gpio_free(H3XXX_EGPIO_OPT_ON); | ||
104 | err03: gpio_free(H3XXX_EGPIO_OPT_NVRAM_ON); | ||
105 | err02: gpio_free(H3XXX_GPIO_PCMCIA_CD0); | ||
106 | err01: gpio_free(H3XXX_GPIO_PCMCIA_IRQ0); | ||
107 | err00: return err; | ||
108 | |||
109 | err12: gpio_free(H3XXX_GPIO_PCMCIA_CD0); | ||
110 | err11: gpio_free(H3XXX_GPIO_PCMCIA_IRQ0); | ||
111 | err10: return err; | ||
33 | } | 112 | } |
34 | 113 | ||
35 | static void h3600_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) | 114 | static void h3600_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) |
36 | { | 115 | { |
37 | soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs)); | 116 | soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs)); |
38 | 117 | ||
39 | /* Disable CF bus: */ | 118 | switch (skt->nr) { |
40 | assign_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON, 0); | 119 | case 0: |
41 | assign_h3600_egpio(IPAQ_EGPIO_OPT_ON, 0); | 120 | /* Disable CF bus: */ |
42 | assign_h3600_egpio(IPAQ_EGPIO_OPT_RESET, 1); | 121 | gpio_set_value(H3XXX_EGPIO_OPT_NVRAM_ON, 0); |
122 | gpio_set_value(H3XXX_EGPIO_OPT_ON, 0); | ||
123 | gpio_set_value(H3XXX_EGPIO_OPT_RESET, 1); | ||
124 | |||
125 | gpio_free(H3XXX_EGPIO_CARD_RESET); | ||
126 | gpio_free(H3XXX_EGPIO_OPT_RESET); | ||
127 | gpio_free(H3XXX_EGPIO_OPT_ON); | ||
128 | gpio_free(H3XXX_EGPIO_OPT_NVRAM_ON); | ||
129 | gpio_free(H3XXX_GPIO_PCMCIA_CD0); | ||
130 | gpio_free(H3XXX_GPIO_PCMCIA_IRQ0); | ||
131 | break; | ||
132 | case 1: | ||
133 | gpio_free(H3XXX_GPIO_PCMCIA_CD1); | ||
134 | gpio_free(H3XXX_GPIO_PCMCIA_IRQ1); | ||
135 | break; | ||
136 | } | ||
43 | } | 137 | } |
44 | 138 | ||
45 | static void | 139 | static void |
46 | h3600_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) | 140 | h3600_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) |
47 | { | 141 | { |
48 | unsigned long levels = GPLR; | ||
49 | |||
50 | switch (skt->nr) { | 142 | switch (skt->nr) { |
51 | case 0: | 143 | case 0: |
52 | state->detect = levels & GPIO_H3600_PCMCIA_CD0 ? 0 : 1; | 144 | state->detect = !gpio_get_value(H3XXX_GPIO_PCMCIA_CD0); |
53 | state->ready = levels & GPIO_H3600_PCMCIA_IRQ0 ? 1 : 0; | 145 | state->ready = !!gpio_get_value(H3XXX_GPIO_PCMCIA_IRQ0); |
54 | state->bvd1 = 0; | 146 | state->bvd1 = 0; |
55 | state->bvd2 = 0; | 147 | state->bvd2 = 0; |
56 | state->wrprot = 0; /* Not available on H3600. */ | 148 | state->wrprot = 0; /* Not available on H3600. */ |
@@ -59,8 +151,8 @@ h3600_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *st | |||
59 | break; | 151 | break; |
60 | 152 | ||
61 | case 1: | 153 | case 1: |
62 | state->detect = levels & GPIO_H3600_PCMCIA_CD1 ? 0 : 1; | 154 | state->detect = !gpio_get_value(H3XXX_GPIO_PCMCIA_CD1); |
63 | state->ready = levels & GPIO_H3600_PCMCIA_IRQ1 ? 1 : 0; | 155 | state->ready = !!gpio_get_value(H3XXX_GPIO_PCMCIA_IRQ1); |
64 | state->bvd1 = 0; | 156 | state->bvd1 = 0; |
65 | state->bvd2 = 0; | 157 | state->bvd2 = 0; |
66 | state->wrprot = 0; /* Not available on H3600. */ | 158 | state->wrprot = 0; /* Not available on H3600. */ |
@@ -79,7 +171,7 @@ h3600_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_ | |||
79 | return -1; | 171 | return -1; |
80 | } | 172 | } |
81 | 173 | ||
82 | assign_h3600_egpio(IPAQ_EGPIO_CARD_RESET, !!(state->flags & SS_RESET)); | 174 | gpio_set_value(H3XXX_EGPIO_CARD_RESET, !!(state->flags & SS_RESET)); |
83 | 175 | ||
84 | /* Silently ignore Vpp, output enable, speaker enable. */ | 176 | /* Silently ignore Vpp, output enable, speaker enable. */ |
85 | 177 | ||
@@ -89,9 +181,9 @@ h3600_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_ | |||
89 | static void h3600_pcmcia_socket_init(struct soc_pcmcia_socket *skt) | 181 | static void h3600_pcmcia_socket_init(struct soc_pcmcia_socket *skt) |
90 | { | 182 | { |
91 | /* Enable CF bus: */ | 183 | /* Enable CF bus: */ |
92 | assign_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON, 1); | 184 | gpio_set_value(H3XXX_EGPIO_OPT_NVRAM_ON, 1); |
93 | assign_h3600_egpio(IPAQ_EGPIO_OPT_ON, 1); | 185 | gpio_set_value(H3XXX_EGPIO_OPT_ON, 1); |
94 | assign_h3600_egpio(IPAQ_EGPIO_OPT_RESET, 0); | 186 | gpio_set_value(H3XXX_EGPIO_OPT_RESET, 0); |
95 | 187 | ||
96 | msleep(10); | 188 | msleep(10); |
97 | 189 | ||
@@ -109,10 +201,10 @@ static void h3600_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) | |||
109 | * socket 0 then socket 1. | 201 | * socket 0 then socket 1. |
110 | */ | 202 | */ |
111 | if (skt->nr == 1) { | 203 | if (skt->nr == 1) { |
112 | assign_h3600_egpio(IPAQ_EGPIO_OPT_ON, 0); | 204 | gpio_set_value(H3XXX_EGPIO_OPT_ON, 0); |
113 | assign_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON, 0); | 205 | gpio_set_value(H3XXX_EGPIO_OPT_NVRAM_ON, 0); |
114 | /* hmm, does this suck power? */ | 206 | /* hmm, does this suck power? */ |
115 | assign_h3600_egpio(IPAQ_EGPIO_OPT_RESET, 1); | 207 | gpio_set_value(H3XXX_EGPIO_OPT_RESET, 1); |
116 | } | 208 | } |
117 | } | 209 | } |
118 | 210 | ||
@@ -131,7 +223,7 @@ int __init pcmcia_h3600_init(struct device *dev) | |||
131 | { | 223 | { |
132 | int ret = -ENODEV; | 224 | int ret = -ENODEV; |
133 | 225 | ||
134 | if (machine_is_h3600()) | 226 | if (machine_is_h3600() || machine_is_h3100()) |
135 | ret = sa11xx_drv_pcmcia_probe(dev, &h3600_pcmcia_ops, 0, 2); | 227 | ret = sa11xx_drv_pcmcia_probe(dev, &h3600_pcmcia_ops, 0, 2); |
136 | 228 | ||
137 | return ret; | 229 | return ret; |
diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig index cea6cef27e89..118674925516 100644 --- a/drivers/power/Kconfig +++ b/drivers/power/Kconfig | |||
@@ -77,6 +77,13 @@ config BATTERY_TOSA | |||
77 | Say Y to enable support for the battery on the Sharp Zaurus | 77 | Say Y to enable support for the battery on the Sharp Zaurus |
78 | SL-6000 (tosa) models. | 78 | SL-6000 (tosa) models. |
79 | 79 | ||
80 | config BATTERY_COLLIE | ||
81 | tristate "Sharp SL-5500 (collie) battery" | ||
82 | depends on SA1100_COLLIE && MCP_UCB1200 | ||
83 | help | ||
84 | Say Y to enable support for the battery on the Sharp Zaurus | ||
85 | SL-5500 (collie) models. | ||
86 | |||
80 | config BATTERY_WM97XX | 87 | config BATTERY_WM97XX |
81 | bool "WM97xx generic battery driver" | 88 | bool "WM97xx generic battery driver" |
82 | depends on TOUCHSCREEN_WM97XX=y | 89 | depends on TOUCHSCREEN_WM97XX=y |
diff --git a/drivers/power/Makefile b/drivers/power/Makefile index b96f29d91c28..356cdfd3c8b2 100644 --- a/drivers/power/Makefile +++ b/drivers/power/Makefile | |||
@@ -24,6 +24,7 @@ obj-$(CONFIG_BATTERY_DS2782) += ds2782_battery.o | |||
24 | obj-$(CONFIG_BATTERY_PMU) += pmu_battery.o | 24 | obj-$(CONFIG_BATTERY_PMU) += pmu_battery.o |
25 | obj-$(CONFIG_BATTERY_OLPC) += olpc_battery.o | 25 | obj-$(CONFIG_BATTERY_OLPC) += olpc_battery.o |
26 | obj-$(CONFIG_BATTERY_TOSA) += tosa_battery.o | 26 | obj-$(CONFIG_BATTERY_TOSA) += tosa_battery.o |
27 | obj-$(CONFIG_BATTERY_COLLIE) += collie_battery.o | ||
27 | obj-$(CONFIG_BATTERY_WM97XX) += wm97xx_battery.o | 28 | obj-$(CONFIG_BATTERY_WM97XX) += wm97xx_battery.o |
28 | obj-$(CONFIG_BATTERY_BQ27x00) += bq27x00_battery.o | 29 | obj-$(CONFIG_BATTERY_BQ27x00) += bq27x00_battery.o |
29 | obj-$(CONFIG_BATTERY_DA9030) += da9030_battery.o | 30 | obj-$(CONFIG_BATTERY_DA9030) += da9030_battery.o |
diff --git a/drivers/power/collie_battery.c b/drivers/power/collie_battery.c new file mode 100644 index 000000000000..039f41ae217d --- /dev/null +++ b/drivers/power/collie_battery.c | |||
@@ -0,0 +1,418 @@ | |||
1 | /* | ||
2 | * Battery and Power Management code for the Sharp SL-5x00 | ||
3 | * | ||
4 | * Copyright (C) 2009 Thomas Kunze | ||
5 | * | ||
6 | * based on tosa_battery.c | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | */ | ||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/module.h> | ||
15 | #include <linux/power_supply.h> | ||
16 | #include <linux/delay.h> | ||
17 | #include <linux/spinlock.h> | ||
18 | #include <linux/interrupt.h> | ||
19 | #include <linux/gpio.h> | ||
20 | #include <linux/mfd/ucb1x00.h> | ||
21 | |||
22 | #include <asm/mach/sharpsl_param.h> | ||
23 | #include <asm/mach-types.h> | ||
24 | #include <mach/collie.h> | ||
25 | |||
26 | static DEFINE_MUTEX(bat_lock); /* protects gpio pins */ | ||
27 | static struct work_struct bat_work; | ||
28 | static struct ucb1x00 *ucb; | ||
29 | |||
30 | struct collie_bat { | ||
31 | int status; | ||
32 | struct power_supply psy; | ||
33 | int full_chrg; | ||
34 | |||
35 | struct mutex work_lock; /* protects data */ | ||
36 | |||
37 | bool (*is_present)(struct collie_bat *bat); | ||
38 | int gpio_full; | ||
39 | int gpio_charge_on; | ||
40 | |||
41 | int technology; | ||
42 | |||
43 | int gpio_bat; | ||
44 | int adc_bat; | ||
45 | int adc_bat_divider; | ||
46 | int bat_max; | ||
47 | int bat_min; | ||
48 | |||
49 | int gpio_temp; | ||
50 | int adc_temp; | ||
51 | int adc_temp_divider; | ||
52 | }; | ||
53 | |||
54 | static struct collie_bat collie_bat_main; | ||
55 | |||
56 | static unsigned long collie_read_bat(struct collie_bat *bat) | ||
57 | { | ||
58 | unsigned long value = 0; | ||
59 | |||
60 | if (bat->gpio_bat < 0 || bat->adc_bat < 0) | ||
61 | return 0; | ||
62 | mutex_lock(&bat_lock); | ||
63 | gpio_set_value(bat->gpio_bat, 1); | ||
64 | msleep(5); | ||
65 | ucb1x00_adc_enable(ucb); | ||
66 | value = ucb1x00_adc_read(ucb, bat->adc_bat, UCB_SYNC); | ||
67 | ucb1x00_adc_disable(ucb); | ||
68 | gpio_set_value(bat->gpio_bat, 0); | ||
69 | mutex_unlock(&bat_lock); | ||
70 | value = value * 1000000 / bat->adc_bat_divider; | ||
71 | |||
72 | return value; | ||
73 | } | ||
74 | |||
75 | static unsigned long collie_read_temp(struct collie_bat *bat) | ||
76 | { | ||
77 | unsigned long value = 0; | ||
78 | if (bat->gpio_temp < 0 || bat->adc_temp < 0) | ||
79 | return 0; | ||
80 | |||
81 | mutex_lock(&bat_lock); | ||
82 | gpio_set_value(bat->gpio_temp, 1); | ||
83 | msleep(5); | ||
84 | ucb1x00_adc_enable(ucb); | ||
85 | value = ucb1x00_adc_read(ucb, bat->adc_temp, UCB_SYNC); | ||
86 | ucb1x00_adc_disable(ucb); | ||
87 | gpio_set_value(bat->gpio_temp, 0); | ||
88 | mutex_unlock(&bat_lock); | ||
89 | |||
90 | value = value * 10000 / bat->adc_temp_divider; | ||
91 | |||
92 | return value; | ||
93 | } | ||
94 | |||
95 | static int collie_bat_get_property(struct power_supply *psy, | ||
96 | enum power_supply_property psp, | ||
97 | union power_supply_propval *val) | ||
98 | { | ||
99 | int ret = 0; | ||
100 | struct collie_bat *bat = container_of(psy, struct collie_bat, psy); | ||
101 | |||
102 | if (bat->is_present && !bat->is_present(bat) | ||
103 | && psp != POWER_SUPPLY_PROP_PRESENT) { | ||
104 | return -ENODEV; | ||
105 | } | ||
106 | |||
107 | switch (psp) { | ||
108 | case POWER_SUPPLY_PROP_STATUS: | ||
109 | val->intval = bat->status; | ||
110 | break; | ||
111 | case POWER_SUPPLY_PROP_TECHNOLOGY: | ||
112 | val->intval = bat->technology; | ||
113 | break; | ||
114 | case POWER_SUPPLY_PROP_VOLTAGE_NOW: | ||
115 | val->intval = collie_read_bat(bat); | ||
116 | break; | ||
117 | case POWER_SUPPLY_PROP_VOLTAGE_MAX: | ||
118 | if (bat->full_chrg == -1) | ||
119 | val->intval = bat->bat_max; | ||
120 | else | ||
121 | val->intval = bat->full_chrg; | ||
122 | break; | ||
123 | case POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN: | ||
124 | val->intval = bat->bat_max; | ||
125 | break; | ||
126 | case POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN: | ||
127 | val->intval = bat->bat_min; | ||
128 | break; | ||
129 | case POWER_SUPPLY_PROP_TEMP: | ||
130 | val->intval = collie_read_temp(bat); | ||
131 | break; | ||
132 | case POWER_SUPPLY_PROP_PRESENT: | ||
133 | val->intval = bat->is_present ? bat->is_present(bat) : 1; | ||
134 | break; | ||
135 | default: | ||
136 | ret = -EINVAL; | ||
137 | break; | ||
138 | } | ||
139 | return ret; | ||
140 | } | ||
141 | |||
142 | static void collie_bat_external_power_changed(struct power_supply *psy) | ||
143 | { | ||
144 | schedule_work(&bat_work); | ||
145 | } | ||
146 | |||
147 | static irqreturn_t collie_bat_gpio_isr(int irq, void *data) | ||
148 | { | ||
149 | pr_info("collie_bat_gpio irq: %d\n", gpio_get_value(irq_to_gpio(irq))); | ||
150 | schedule_work(&bat_work); | ||
151 | return IRQ_HANDLED; | ||
152 | } | ||
153 | |||
154 | static void collie_bat_update(struct collie_bat *bat) | ||
155 | { | ||
156 | int old; | ||
157 | struct power_supply *psy = &bat->psy; | ||
158 | |||
159 | mutex_lock(&bat->work_lock); | ||
160 | |||
161 | old = bat->status; | ||
162 | |||
163 | if (bat->is_present && !bat->is_present(bat)) { | ||
164 | printk(KERN_NOTICE "%s not present\n", psy->name); | ||
165 | bat->status = POWER_SUPPLY_STATUS_UNKNOWN; | ||
166 | bat->full_chrg = -1; | ||
167 | } else if (power_supply_am_i_supplied(psy)) { | ||
168 | if (bat->status == POWER_SUPPLY_STATUS_DISCHARGING) { | ||
169 | gpio_set_value(bat->gpio_charge_on, 1); | ||
170 | mdelay(15); | ||
171 | } | ||
172 | |||
173 | if (gpio_get_value(bat->gpio_full)) { | ||
174 | if (old == POWER_SUPPLY_STATUS_CHARGING || | ||
175 | bat->full_chrg == -1) | ||
176 | bat->full_chrg = collie_read_bat(bat); | ||
177 | |||
178 | gpio_set_value(bat->gpio_charge_on, 0); | ||
179 | bat->status = POWER_SUPPLY_STATUS_FULL; | ||
180 | } else { | ||
181 | gpio_set_value(bat->gpio_charge_on, 1); | ||
182 | bat->status = POWER_SUPPLY_STATUS_CHARGING; | ||
183 | } | ||
184 | } else { | ||
185 | gpio_set_value(bat->gpio_charge_on, 0); | ||
186 | bat->status = POWER_SUPPLY_STATUS_DISCHARGING; | ||
187 | } | ||
188 | |||
189 | if (old != bat->status) | ||
190 | power_supply_changed(psy); | ||
191 | |||
192 | mutex_unlock(&bat->work_lock); | ||
193 | } | ||
194 | |||
195 | static void collie_bat_work(struct work_struct *work) | ||
196 | { | ||
197 | collie_bat_update(&collie_bat_main); | ||
198 | } | ||
199 | |||
200 | |||
201 | static enum power_supply_property collie_bat_main_props[] = { | ||
202 | POWER_SUPPLY_PROP_STATUS, | ||
203 | POWER_SUPPLY_PROP_TECHNOLOGY, | ||
204 | POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN, | ||
205 | POWER_SUPPLY_PROP_VOLTAGE_NOW, | ||
206 | POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN, | ||
207 | POWER_SUPPLY_PROP_VOLTAGE_MAX, | ||
208 | POWER_SUPPLY_PROP_PRESENT, | ||
209 | POWER_SUPPLY_PROP_TEMP, | ||
210 | }; | ||
211 | |||
212 | static enum power_supply_property collie_bat_bu_props[] = { | ||
213 | POWER_SUPPLY_PROP_STATUS, | ||
214 | POWER_SUPPLY_PROP_TECHNOLOGY, | ||
215 | POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN, | ||
216 | POWER_SUPPLY_PROP_VOLTAGE_NOW, | ||
217 | POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN, | ||
218 | POWER_SUPPLY_PROP_VOLTAGE_MAX, | ||
219 | POWER_SUPPLY_PROP_PRESENT, | ||
220 | }; | ||
221 | |||
222 | static struct collie_bat collie_bat_main = { | ||
223 | .status = POWER_SUPPLY_STATUS_DISCHARGING, | ||
224 | .full_chrg = -1, | ||
225 | .psy = { | ||
226 | .name = "main-battery", | ||
227 | .type = POWER_SUPPLY_TYPE_BATTERY, | ||
228 | .properties = collie_bat_main_props, | ||
229 | .num_properties = ARRAY_SIZE(collie_bat_main_props), | ||
230 | .get_property = collie_bat_get_property, | ||
231 | .external_power_changed = collie_bat_external_power_changed, | ||
232 | .use_for_apm = 1, | ||
233 | }, | ||
234 | |||
235 | .gpio_full = COLLIE_GPIO_CO, | ||
236 | .gpio_charge_on = COLLIE_GPIO_CHARGE_ON, | ||
237 | |||
238 | .technology = POWER_SUPPLY_TECHNOLOGY_LIPO, | ||
239 | |||
240 | .gpio_bat = COLLIE_GPIO_MBAT_ON, | ||
241 | .adc_bat = UCB_ADC_INP_AD1, | ||
242 | .adc_bat_divider = 155, | ||
243 | .bat_max = 4310000, | ||
244 | .bat_min = 1551 * 1000000 / 414, | ||
245 | |||
246 | .gpio_temp = COLLIE_GPIO_TMP_ON, | ||
247 | .adc_temp = UCB_ADC_INP_AD0, | ||
248 | .adc_temp_divider = 10000, | ||
249 | }; | ||
250 | |||
251 | static struct collie_bat collie_bat_bu = { | ||
252 | .status = POWER_SUPPLY_STATUS_UNKNOWN, | ||
253 | .full_chrg = -1, | ||
254 | |||
255 | .psy = { | ||
256 | .name = "backup-battery", | ||
257 | .type = POWER_SUPPLY_TYPE_BATTERY, | ||
258 | .properties = collie_bat_bu_props, | ||
259 | .num_properties = ARRAY_SIZE(collie_bat_bu_props), | ||
260 | .get_property = collie_bat_get_property, | ||
261 | .external_power_changed = collie_bat_external_power_changed, | ||
262 | }, | ||
263 | |||
264 | .gpio_full = -1, | ||
265 | .gpio_charge_on = -1, | ||
266 | |||
267 | .technology = POWER_SUPPLY_TECHNOLOGY_LiMn, | ||
268 | |||
269 | .gpio_bat = COLLIE_GPIO_BBAT_ON, | ||
270 | .adc_bat = UCB_ADC_INP_AD1, | ||
271 | .adc_bat_divider = 155, | ||
272 | .bat_max = 3000000, | ||
273 | .bat_min = 1900000, | ||
274 | |||
275 | .gpio_temp = -1, | ||
276 | .adc_temp = -1, | ||
277 | .adc_temp_divider = -1, | ||
278 | }; | ||
279 | |||
280 | static struct { | ||
281 | int gpio; | ||
282 | char *name; | ||
283 | bool output; | ||
284 | int value; | ||
285 | } gpios[] = { | ||
286 | { COLLIE_GPIO_CO, "main battery full", 0, 0 }, | ||
287 | { COLLIE_GPIO_MAIN_BAT_LOW, "main battery low", 0, 0 }, | ||
288 | { COLLIE_GPIO_CHARGE_ON, "main charge on", 1, 0 }, | ||
289 | { COLLIE_GPIO_MBAT_ON, "main battery", 1, 0 }, | ||
290 | { COLLIE_GPIO_TMP_ON, "main battery temp", 1, 0 }, | ||
291 | { COLLIE_GPIO_BBAT_ON, "backup battery", 1, 0 }, | ||
292 | }; | ||
293 | |||
294 | #ifdef CONFIG_PM | ||
295 | static int collie_bat_suspend(struct ucb1x00_dev *dev, pm_message_t state) | ||
296 | { | ||
297 | /* flush all pending status updates */ | ||
298 | flush_scheduled_work(); | ||
299 | return 0; | ||
300 | } | ||
301 | |||
302 | static int collie_bat_resume(struct ucb1x00_dev *dev) | ||
303 | { | ||
304 | /* things may have changed while we were away */ | ||
305 | schedule_work(&bat_work); | ||
306 | return 0; | ||
307 | } | ||
308 | #else | ||
309 | #define collie_bat_suspend NULL | ||
310 | #define collie_bat_resume NULL | ||
311 | #endif | ||
312 | |||
313 | static int __devinit collie_bat_probe(struct ucb1x00_dev *dev) | ||
314 | { | ||
315 | int ret; | ||
316 | int i; | ||
317 | |||
318 | if (!machine_is_collie()) | ||
319 | return -ENODEV; | ||
320 | |||
321 | ucb = dev->ucb; | ||
322 | |||
323 | for (i = 0; i < ARRAY_SIZE(gpios); i++) { | ||
324 | ret = gpio_request(gpios[i].gpio, gpios[i].name); | ||
325 | if (ret) { | ||
326 | i--; | ||
327 | goto err_gpio; | ||
328 | } | ||
329 | |||
330 | if (gpios[i].output) | ||
331 | ret = gpio_direction_output(gpios[i].gpio, | ||
332 | gpios[i].value); | ||
333 | else | ||
334 | ret = gpio_direction_input(gpios[i].gpio); | ||
335 | |||
336 | if (ret) | ||
337 | goto err_gpio; | ||
338 | } | ||
339 | |||
340 | mutex_init(&collie_bat_main.work_lock); | ||
341 | |||
342 | INIT_WORK(&bat_work, collie_bat_work); | ||
343 | |||
344 | ret = power_supply_register(&dev->ucb->dev, &collie_bat_main.psy); | ||
345 | if (ret) | ||
346 | goto err_psy_reg_main; | ||
347 | ret = power_supply_register(&dev->ucb->dev, &collie_bat_bu.psy); | ||
348 | if (ret) | ||
349 | goto err_psy_reg_bu; | ||
350 | |||
351 | ret = request_irq(gpio_to_irq(COLLIE_GPIO_CO), | ||
352 | collie_bat_gpio_isr, | ||
353 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, | ||
354 | "main full", &collie_bat_main); | ||
355 | if (!ret) { | ||
356 | schedule_work(&bat_work); | ||
357 | return 0; | ||
358 | } | ||
359 | power_supply_unregister(&collie_bat_bu.psy); | ||
360 | err_psy_reg_bu: | ||
361 | power_supply_unregister(&collie_bat_main.psy); | ||
362 | err_psy_reg_main: | ||
363 | |||
364 | /* see comment in collie_bat_remove */ | ||
365 | flush_scheduled_work(); | ||
366 | |||
367 | i--; | ||
368 | err_gpio: | ||
369 | for (; i >= 0; i--) | ||
370 | gpio_free(gpios[i].gpio); | ||
371 | |||
372 | return ret; | ||
373 | } | ||
374 | |||
375 | static void __devexit collie_bat_remove(struct ucb1x00_dev *dev) | ||
376 | { | ||
377 | int i; | ||
378 | |||
379 | free_irq(gpio_to_irq(COLLIE_GPIO_CO), &collie_bat_main); | ||
380 | |||
381 | power_supply_unregister(&collie_bat_bu.psy); | ||
382 | power_supply_unregister(&collie_bat_main.psy); | ||
383 | |||
384 | /* | ||
385 | * now flush all pending work. | ||
386 | * we won't get any more schedules, since all | ||
387 | * sources (isr and external_power_changed) | ||
388 | * are unregistered now. | ||
389 | */ | ||
390 | flush_scheduled_work(); | ||
391 | |||
392 | for (i = ARRAY_SIZE(gpios) - 1; i >= 0; i--) | ||
393 | gpio_free(gpios[i].gpio); | ||
394 | } | ||
395 | |||
396 | static struct ucb1x00_driver collie_bat_driver = { | ||
397 | .add = collie_bat_probe, | ||
398 | .remove = __devexit_p(collie_bat_remove), | ||
399 | .suspend = collie_bat_suspend, | ||
400 | .resume = collie_bat_resume, | ||
401 | }; | ||
402 | |||
403 | static int __init collie_bat_init(void) | ||
404 | { | ||
405 | return ucb1x00_register_driver(&collie_bat_driver); | ||
406 | } | ||
407 | |||
408 | static void __exit collie_bat_exit(void) | ||
409 | { | ||
410 | ucb1x00_unregister_driver(&collie_bat_driver); | ||
411 | } | ||
412 | |||
413 | module_init(collie_bat_init); | ||
414 | module_exit(collie_bat_exit); | ||
415 | |||
416 | MODULE_LICENSE("GPL"); | ||
417 | MODULE_AUTHOR("Thomas Kunze"); | ||
418 | MODULE_DESCRIPTION("Collie battery driver"); | ||
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index 3c20dae43ce2..e11e1cda4ba2 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig | |||
@@ -780,7 +780,7 @@ config RTC_DRV_TX4939 | |||
780 | 780 | ||
781 | config RTC_DRV_MV | 781 | config RTC_DRV_MV |
782 | tristate "Marvell SoC RTC" | 782 | tristate "Marvell SoC RTC" |
783 | depends on ARCH_KIRKWOOD | 783 | depends on ARCH_KIRKWOOD || ARCH_DOVE |
784 | help | 784 | help |
785 | If you say yes here you will get support for the in-chip RTC | 785 | If you say yes here you will get support for the in-chip RTC |
786 | that can be found in some of Marvell's SoC devices, such as | 786 | that can be found in some of Marvell's SoC devices, such as |
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c index c99f0821cae3..73f089d3efd6 100644 --- a/drivers/serial/s3c2410.c +++ b/drivers/serial/s3c2410.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * | 2 | * |
3 | * Driver for Samsung S3C2410 SoC onboard UARTs. | 3 | * Driver for Samsung S3C2410 SoC onboard UARTs. |
4 | * | 4 | * |
5 | * Ben Dooks, Copyright (c) 2003-2005,2008 Simtec Electronics | 5 | * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics |
6 | * http://armlinux.simtec.co.uk/ | 6 | * http://armlinux.simtec.co.uk/ |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
diff --git a/drivers/serial/s3c2412.c b/drivers/serial/s3c2412.c index 6e057d8809d3..ce75e28e36ef 100644 --- a/drivers/serial/s3c2412.c +++ b/drivers/serial/s3c2412.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * | 2 | * |
3 | * Driver for Samsung S3C2412 and S3C2413 SoC onboard UARTs. | 3 | * Driver for Samsung S3C2412 and S3C2413 SoC onboard UARTs. |
4 | * | 4 | * |
5 | * Ben Dooks, Copyright (c) 2003-2005,2008 Simtec Electronics | 5 | * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics |
6 | * http://armlinux.simtec.co.uk/ | 6 | * http://armlinux.simtec.co.uk/ |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
diff --git a/drivers/serial/s3c2440.c b/drivers/serial/s3c2440.c index 69ff5d340f04..094cc3904b13 100644 --- a/drivers/serial/s3c2440.c +++ b/drivers/serial/s3c2440.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * | 2 | * |
3 | * Driver for Samsung S3C2440 and S3C2442 SoC onboard UARTs. | 3 | * Driver for Samsung S3C2440 and S3C2442 SoC onboard UARTs. |
4 | * | 4 | * |
5 | * Ben Dooks, Copyright (c) 2003-2005,2008 Simtec Electronics | 5 | * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics |
6 | * http://armlinux.simtec.co.uk/ | 6 | * http://armlinux.simtec.co.uk/ |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
diff --git a/drivers/serial/s3c24a0.c b/drivers/serial/s3c24a0.c index 26c49e18bdd1..fad6083ca427 100644 --- a/drivers/serial/s3c24a0.c +++ b/drivers/serial/s3c24a0.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * | 6 | * |
7 | * Author: Sandeep Patil <sandeep.patil@azingo.com> | 7 | * Author: Sandeep Patil <sandeep.patil@azingo.com> |
8 | * | 8 | * |
9 | * Ben Dooks, Copyright (c) 2003-2005,2008 Simtec Electronics | 9 | * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics |
10 | * http://armlinux.simtec.co.uk/ | 10 | * http://armlinux.simtec.co.uk/ |
11 | * | 11 | * |
12 | * This program is free software; you can redistribute it and/or modify | 12 | * This program is free software; you can redistribute it and/or modify |
diff --git a/drivers/serial/samsung.c b/drivers/serial/samsung.c index 1523e8d9ae77..52e3df113ec0 100644 --- a/drivers/serial/samsung.c +++ b/drivers/serial/samsung.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * | 2 | * |
3 | * Driver core for Samsung SoC onboard UARTs. | 3 | * Driver core for Samsung SoC onboard UARTs. |
4 | * | 4 | * |
5 | * Ben Dooks, Copyright (c) 2003-2005,2008 Simtec Electronics | 5 | * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics |
6 | * http://armlinux.simtec.co.uk/ | 6 | * http://armlinux.simtec.co.uk/ |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
diff --git a/drivers/serial/samsung.h b/drivers/serial/samsung.h index d3fe315969f6..1fb22343df42 100644 --- a/drivers/serial/samsung.h +++ b/drivers/serial/samsung.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * | 2 | * |
3 | * Driver for Samsung SoC onboard UARTs. | 3 | * Driver for Samsung SoC onboard UARTs. |
4 | * | 4 | * |
5 | * Ben Dooks, Copyright (c) 2003-2005,2008 Simtec Electronics | 5 | * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics |
6 | * http://armlinux.simtec.co.uk/ | 6 | * http://armlinux.simtec.co.uk/ |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 188e1ba3b69f..6b89eb55ed32 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig | |||
@@ -5,6 +5,9 @@ | |||
5 | menu "Graphics support" | 5 | menu "Graphics support" |
6 | depends on HAS_IOMEM | 6 | depends on HAS_IOMEM |
7 | 7 | ||
8 | config HAVE_FB_ATMEL | ||
9 | bool | ||
10 | |||
8 | source "drivers/char/agp/Kconfig" | 11 | source "drivers/char/agp/Kconfig" |
9 | 12 | ||
10 | source "drivers/gpu/vga/Kconfig" | 13 | source "drivers/gpu/vga/Kconfig" |
@@ -937,7 +940,7 @@ config FB_S1D13XXX | |||
937 | 940 | ||
938 | config FB_ATMEL | 941 | config FB_ATMEL |
939 | tristate "AT91/AT32 LCD Controller support" | 942 | tristate "AT91/AT32 LCD Controller support" |
940 | depends on FB && (ARCH_AT91SAM9261 || ARCH_AT91SAM9G10 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91SAM9G45 || ARCH_AT91CAP9 || AVR32) | 943 | depends on FB && HAVE_FB_ATMEL |
941 | select FB_CFB_FILLRECT | 944 | select FB_CFB_FILLRECT |
942 | select FB_CFB_COPYAREA | 945 | select FB_CFB_COPYAREA |
943 | select FB_CFB_IMAGEBLIT | 946 | select FB_CFB_IMAGEBLIT |
diff --git a/drivers/video/backlight/da903x_bl.c b/drivers/video/backlight/da903x_bl.c index 701a1081e199..7fcb0eb54c60 100644 --- a/drivers/video/backlight/da903x_bl.c +++ b/drivers/video/backlight/da903x_bl.c | |||
@@ -25,6 +25,7 @@ | |||
25 | 25 | ||
26 | #define DA9034_WLED_CONTROL1 0x3C | 26 | #define DA9034_WLED_CONTROL1 0x3C |
27 | #define DA9034_WLED_CONTROL2 0x3D | 27 | #define DA9034_WLED_CONTROL2 0x3D |
28 | #define DA9034_WLED_ISET(x) ((x) & 0x1f) | ||
28 | 29 | ||
29 | #define DA9034_WLED_BOOST_EN (1 << 5) | 30 | #define DA9034_WLED_BOOST_EN (1 << 5) |
30 | 31 | ||
@@ -101,6 +102,7 @@ static struct backlight_ops da903x_backlight_ops = { | |||
101 | 102 | ||
102 | static int da903x_backlight_probe(struct platform_device *pdev) | 103 | static int da903x_backlight_probe(struct platform_device *pdev) |
103 | { | 104 | { |
105 | struct da9034_backlight_pdata *pdata = pdev->dev.platform_data; | ||
104 | struct da903x_backlight_data *data; | 106 | struct da903x_backlight_data *data; |
105 | struct backlight_device *bl; | 107 | struct backlight_device *bl; |
106 | int max_brightness; | 108 | int max_brightness; |
@@ -127,6 +129,11 @@ static int da903x_backlight_probe(struct platform_device *pdev) | |||
127 | data->da903x_dev = pdev->dev.parent; | 129 | data->da903x_dev = pdev->dev.parent; |
128 | data->current_brightness = 0; | 130 | data->current_brightness = 0; |
129 | 131 | ||
132 | /* adjust the WLED output current */ | ||
133 | if (pdata) | ||
134 | da903x_write(data->da903x_dev, DA9034_WLED_CONTROL2, | ||
135 | DA9034_WLED_ISET(pdata->output_current)); | ||
136 | |||
130 | bl = backlight_device_register(pdev->name, data->da903x_dev, | 137 | bl = backlight_device_register(pdev->name, data->da903x_dev, |
131 | data, &da903x_backlight_ops); | 138 | data, &da903x_backlight_ops); |
132 | if (IS_ERR(bl)) { | 139 | if (IS_ERR(bl)) { |
diff --git a/drivers/video/backlight/tdo24m.c b/drivers/video/backlight/tdo24m.c index bbfb502add67..4a3d46e08016 100644 --- a/drivers/video/backlight/tdo24m.c +++ b/drivers/video/backlight/tdo24m.c | |||
@@ -367,6 +367,7 @@ static int __devinit tdo24m_probe(struct spi_device *spi) | |||
367 | 367 | ||
368 | spi_message_init(m); | 368 | spi_message_init(m); |
369 | 369 | ||
370 | x->cs_change = 1; | ||
370 | x->tx_buf = &lcd->buf[0]; | 371 | x->tx_buf = &lcd->buf[0]; |
371 | spi_message_add_tail(x, m); | 372 | spi_message_add_tail(x, m); |
372 | 373 | ||
diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c index 84d8327e47db..75285d3f393c 100644 --- a/drivers/video/pxa168fb.c +++ b/drivers/video/pxa168fb.c | |||
@@ -687,6 +687,7 @@ static int __init pxa168fb_probe(struct platform_device *pdev) | |||
687 | } | 687 | } |
688 | 688 | ||
689 | info->fix.smem_start = (unsigned long)fbi->fb_start_dma; | 689 | info->fix.smem_start = (unsigned long)fbi->fb_start_dma; |
690 | set_graphics_start(info, 0, 0); | ||
690 | 691 | ||
691 | /* | 692 | /* |
692 | * Set video mode according to platform data. | 693 | * Set video mode according to platform data. |
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index 1820c4a24434..f58a3aae6ea6 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c | |||
@@ -80,7 +80,8 @@ | |||
80 | static int pxafb_activate_var(struct fb_var_screeninfo *var, | 80 | static int pxafb_activate_var(struct fb_var_screeninfo *var, |
81 | struct pxafb_info *); | 81 | struct pxafb_info *); |
82 | static void set_ctrlr_state(struct pxafb_info *fbi, u_int state); | 82 | static void set_ctrlr_state(struct pxafb_info *fbi, u_int state); |
83 | static void setup_base_frame(struct pxafb_info *fbi, int branch); | 83 | static void setup_base_frame(struct pxafb_info *fbi, |
84 | struct fb_var_screeninfo *var, int branch); | ||
84 | static int setup_frame_dma(struct pxafb_info *fbi, int dma, int pal, | 85 | static int setup_frame_dma(struct pxafb_info *fbi, int dma, int pal, |
85 | unsigned long offset, size_t size); | 86 | unsigned long offset, size_t size); |
86 | 87 | ||
@@ -397,6 +398,7 @@ static void pxafb_setmode(struct fb_var_screeninfo *var, | |||
397 | var->lower_margin = mode->lower_margin; | 398 | var->lower_margin = mode->lower_margin; |
398 | var->sync = mode->sync; | 399 | var->sync = mode->sync; |
399 | var->grayscale = mode->cmap_greyscale; | 400 | var->grayscale = mode->cmap_greyscale; |
401 | var->transp.length = mode->transparency; | ||
400 | 402 | ||
401 | /* set the initial RGBA bitfields */ | 403 | /* set the initial RGBA bitfields */ |
402 | pxafb_set_pixfmt(var, mode->depth); | 404 | pxafb_set_pixfmt(var, mode->depth); |
@@ -531,12 +533,22 @@ static int pxafb_pan_display(struct fb_var_screeninfo *var, | |||
531 | struct fb_info *info) | 533 | struct fb_info *info) |
532 | { | 534 | { |
533 | struct pxafb_info *fbi = (struct pxafb_info *)info; | 535 | struct pxafb_info *fbi = (struct pxafb_info *)info; |
536 | struct fb_var_screeninfo newvar; | ||
534 | int dma = DMA_MAX + DMA_BASE; | 537 | int dma = DMA_MAX + DMA_BASE; |
535 | 538 | ||
536 | if (fbi->state != C_ENABLE) | 539 | if (fbi->state != C_ENABLE) |
537 | return 0; | 540 | return 0; |
538 | 541 | ||
539 | setup_base_frame(fbi, 1); | 542 | /* Only take .xoffset, .yoffset and .vmode & FB_VMODE_YWRAP from what |
543 | * was passed in and copy the rest from the old screeninfo. | ||
544 | */ | ||
545 | memcpy(&newvar, &fbi->fb.var, sizeof(newvar)); | ||
546 | newvar.xoffset = var->xoffset; | ||
547 | newvar.yoffset = var->yoffset; | ||
548 | newvar.vmode &= ~FB_VMODE_YWRAP; | ||
549 | newvar.vmode |= var->vmode & FB_VMODE_YWRAP; | ||
550 | |||
551 | setup_base_frame(fbi, &newvar, 1); | ||
540 | 552 | ||
541 | if (fbi->lccr0 & LCCR0_SDS) | 553 | if (fbi->lccr0 & LCCR0_SDS) |
542 | lcd_writel(fbi, FBR1, fbi->fdadr[dma + 1] | 0x1); | 554 | lcd_writel(fbi, FBR1, fbi->fdadr[dma + 1] | 0x1); |
@@ -1052,9 +1064,10 @@ static int setup_frame_dma(struct pxafb_info *fbi, int dma, int pal, | |||
1052 | return 0; | 1064 | return 0; |
1053 | } | 1065 | } |
1054 | 1066 | ||
1055 | static void setup_base_frame(struct pxafb_info *fbi, int branch) | 1067 | static void setup_base_frame(struct pxafb_info *fbi, |
1068 | struct fb_var_screeninfo *var, | ||
1069 | int branch) | ||
1056 | { | 1070 | { |
1057 | struct fb_var_screeninfo *var = &fbi->fb.var; | ||
1058 | struct fb_fix_screeninfo *fix = &fbi->fb.fix; | 1071 | struct fb_fix_screeninfo *fix = &fbi->fb.fix; |
1059 | int nbytes, dma, pal, bpp = var->bits_per_pixel; | 1072 | int nbytes, dma, pal, bpp = var->bits_per_pixel; |
1060 | unsigned long offset; | 1073 | unsigned long offset; |
@@ -1332,7 +1345,7 @@ static int pxafb_activate_var(struct fb_var_screeninfo *var, | |||
1332 | #endif | 1345 | #endif |
1333 | setup_parallel_timing(fbi, var); | 1346 | setup_parallel_timing(fbi, var); |
1334 | 1347 | ||
1335 | setup_base_frame(fbi, 0); | 1348 | setup_base_frame(fbi, var, 0); |
1336 | 1349 | ||
1337 | fbi->reg_lccr0 = fbi->lccr0 | | 1350 | fbi->reg_lccr0 = fbi->lccr0 | |
1338 | (LCCR0_LDM | LCCR0_SFM | LCCR0_IUM | LCCR0_EFM | | 1351 | (LCCR0_LDM | LCCR0_SFM | LCCR0_IUM | LCCR0_EFM | |