aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-sa1100/h3100.c
diff options
context:
space:
mode:
authorDmitry Artamonow <mad_soft@inbox.ru>2009-11-27 06:10:55 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-12-06 11:52:56 -0500
commit86e5e38c46b1d188c897f131d3f015ca73677f03 (patch)
tree8d2c1a00e5638395baa3cce8ac94afe73b128cad /arch/arm/mach-sa1100/h3100.c
parent8715b29db2787f7c70f662b7b4d5b01017c61948 (diff)
ARM: 5820/1: SA1100: h3100/h3600: split h3600.c
Split common h3600.c into three separate files: h3100.c, h3600.c and h3xxx.c (the latter contains common code for h3100/h3600) Copyright boilerplates and #includes are copied intact and will be cleaned up later. Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-sa1100/h3100.c')
-rw-r--r--arch/arm/mach-sa1100/h3100.c119
1 files changed, 119 insertions, 0 deletions
diff --git a/arch/arm/mach-sa1100/h3100.c b/arch/arm/mach-sa1100/h3100.c
new file mode 100644
index 000000000000..4c7778ee57aa
--- /dev/null
+++ b/arch/arm/mach-sa1100/h3100.c
@@ -0,0 +1,119 @@
1/*
2 * Hardware definitions for Compaq iPAQ H3xxx Handheld Computers
3 *
4 * Copyright 2000,1 Compaq Computer Corporation.
5 *
6 * Use consistent with the GNU GPL is permitted,
7 * provided that this copyright notice is
8 * preserved in its entirety in all copies and derived works.
9 *
10 * COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
11 * AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
12 * FITNESS FOR ANY PARTICULAR PURPOSE.
13 *
14 * Author: Jamey Hicks.
15 *
16 * History:
17 *
18 * 2001-10-?? Andrew Christian Added support for iPAQ H3800
19 * and abstracted EGPIO interface.
20 *
21 */
22#include <linux/module.h>
23#include <linux/init.h>
24#include <linux/kernel.h>
25#include <linux/tty.h>
26#include <linux/pm.h>
27#include <linux/device.h>
28#include <linux/mfd/htc-egpio.h>
29#include <linux/mtd/mtd.h>
30#include <linux/mtd/partitions.h>
31#include <linux/serial_core.h>
32#include <linux/gpio.h>
33#include <linux/platform_device.h>
34
35#include <asm/irq.h>
36#include <mach/hardware.h>
37#include <asm/mach-types.h>
38#include <asm/setup.h>
39
40#include <asm/mach/irq.h>
41#include <asm/mach/arch.h>
42#include <asm/mach/flash.h>
43#include <asm/mach/irda.h>
44#include <asm/mach/map.h>
45#include <asm/mach/serial_sa1100.h>
46
47#include <mach/h3xxx.h>
48
49#include "generic.h"
50
51/*
52 * helper for sa1100fb
53 */
54static void h3100_lcd_power(int enable)
55{
56 if (!gpio_request(H3XXX_EGPIO_LCD_ON, "LCD ON")) {
57 gpio_set_value(H3100_GPIO_LCD_3V_ON, enable);
58 gpio_direction_output(H3XXX_EGPIO_LCD_ON, enable);
59 gpio_free(H3XXX_EGPIO_LCD_ON);
60 }
61}
62
63
64static void __init h3100_map_io(void)
65{
66 h3xxx_map_io();
67
68 sa1100fb_lcd_power = h3100_lcd_power;
69
70 /* Older bootldrs put GPIO2-9 in alternate mode on the
71 assumption that they are used for video */
72 GAFR &= ~0x000001fb;
73}
74
75/*
76 * This turns the IRDA power on or off on the Compaq H3100
77 */
78static int h3100_irda_set_power(struct device *dev, unsigned int state)
79{
80 gpio_set_value(H3100_GPIO_IR_ON, state);
81 return 0;
82}
83
84static void h3100_irda_set_speed(struct device *dev, unsigned int speed)
85{
86 gpio_set_value(H3100_GPIO_IR_FSEL, !(speed < 4000000));
87}
88
89static struct irda_platform_data h3100_irda_data = {
90 .set_power = h3100_irda_set_power,
91 .set_speed = h3100_irda_set_speed,
92};
93
94static struct gpio_default_state h3100_default_gpio[] = {
95 { H3100_GPIO_IR_ON, GPIO_MODE_OUT0, "IrDA power" },
96 { H3100_GPIO_IR_FSEL, GPIO_MODE_OUT0, "IrDA fsel" },
97 { H3XXX_GPIO_COM_DCD, GPIO_MODE_IN, "COM DCD" },
98 { H3XXX_GPIO_COM_CTS, GPIO_MODE_IN, "COM CTS" },
99 { H3XXX_GPIO_COM_RTS, GPIO_MODE_OUT0, "COM RTS" },
100 { H3100_GPIO_LCD_3V_ON, GPIO_MODE_OUT0, "LCD 3v" },
101};
102
103static void __init h3100_mach_init(void)
104{
105 h3xxx_init_gpio(h3100_default_gpio, ARRAY_SIZE(h3100_default_gpio));
106 h3xxx_mach_init();
107 sa11x0_register_irda(&h3100_irda_data);
108}
109
110MACHINE_START(H3100, "Compaq iPAQ H3100")
111 .phys_io = 0x80000000,
112 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
113 .boot_params = 0xc0000100,
114 .map_io = h3100_map_io,
115 .init_irq = sa1100_init_irq,
116 .timer = &sa1100_timer,
117 .init_machine = h3100_mach_init,
118MACHINE_END
119