aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-10-09 16:33:02 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-10-09 16:33:02 -0400
commit3f30a09a612bac2b531a206c2a58a292dd7ff182 (patch)
tree62741c2f78aeb3009c66dbcf014ebff2e034e597 /include
parent9e165acf1b9e37af7c0fa39399b43d0bd8600039 (diff)
parentfda50a1c49ad7483eaa29a268d560422c413933f (diff)
Merge branch 'pxa-all' into devel
Conflicts: arch/arm/mach-pxa/Kconfig arch/arm/mach-pxa/corgi.c arch/arm/mach-pxa/include/mach/hardware.h arch/arm/mach-pxa/spitz.c
Diffstat (limited to 'include')
-rw-r--r--include/linux/lcd.h3
-rw-r--r--include/linux/smc91x.h9
-rw-r--r--include/linux/spi/ads7846.h3
-rw-r--r--include/linux/spi/corgi_lcd.h20
-rw-r--r--include/linux/ucb1400.h161
-rw-r--r--include/linux/wm97xx_batt.h26
-rw-r--r--include/video/metronomefb.h31
7 files changed, 235 insertions, 18 deletions
diff --git a/include/linux/lcd.h b/include/linux/lcd.h
index 173febac6656..c67fecafff90 100644
--- a/include/linux/lcd.h
+++ b/include/linux/lcd.h
@@ -11,6 +11,7 @@
11#include <linux/device.h> 11#include <linux/device.h>
12#include <linux/mutex.h> 12#include <linux/mutex.h>
13#include <linux/notifier.h> 13#include <linux/notifier.h>
14#include <linux/fb.h>
14 15
15/* Notes on locking: 16/* Notes on locking:
16 * 17 *
@@ -45,6 +46,8 @@ struct lcd_ops {
45 int (*get_contrast)(struct lcd_device *); 46 int (*get_contrast)(struct lcd_device *);
46 /* Set LCD panel contrast */ 47 /* Set LCD panel contrast */
47 int (*set_contrast)(struct lcd_device *, int contrast); 48 int (*set_contrast)(struct lcd_device *, int contrast);
49 /* Set LCD panel mode (resolutions ...) */
50 int (*set_mode)(struct lcd_device *, struct fb_videomode *);
48 /* Check if given framebuffer device is the one LCD is bound to; 51 /* Check if given framebuffer device is the one LCD is bound to;
49 return 0 if not, !=0 if it is. If NULL, lcd always matches the fb. */ 52 return 0 if not, !=0 if it is. If NULL, lcd always matches the fb. */
50 int (*check_fb)(struct lcd_device *, struct fb_info *); 53 int (*check_fb)(struct lcd_device *, struct fb_info *);
diff --git a/include/linux/smc91x.h b/include/linux/smc91x.h
index ed25483d25d9..bc21db598c06 100644
--- a/include/linux/smc91x.h
+++ b/include/linux/smc91x.h
@@ -16,6 +16,15 @@
16 16
17#define SMC91X_USE_DMA (1 << 6) 17#define SMC91X_USE_DMA (1 << 6)
18 18
19#define RPC_LED_100_10 (0x00) /* LED = 100Mbps OR's with 10Mbps link detect */
20#define RPC_LED_RES (0x01) /* LED = Reserved */
21#define RPC_LED_10 (0x02) /* LED = 10Mbps link detect */
22#define RPC_LED_FD (0x03) /* LED = Full Duplex Mode */
23#define RPC_LED_TX_RX (0x04) /* LED = TX or RX packet occurred */
24#define RPC_LED_100 (0x05) /* LED = 100Mbps link dectect */
25#define RPC_LED_TX (0x06) /* LED = TX packet occurred */
26#define RPC_LED_RX (0x07) /* LED = RX packet occurred */
27
19struct smc91x_platdata { 28struct smc91x_platdata {
20 unsigned long flags; 29 unsigned long flags;
21 unsigned char leda; 30 unsigned char leda;
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h
index daf744017a31..05eab2f11e63 100644
--- a/include/linux/spi/ads7846.h
+++ b/include/linux/spi/ads7846.h
@@ -43,6 +43,9 @@ struct ads7846_platform_data {
43 u16 debounce_tol; /* tolerance used for filtering */ 43 u16 debounce_tol; /* tolerance used for filtering */
44 u16 debounce_rep; /* additional consecutive good readings 44 u16 debounce_rep; /* additional consecutive good readings
45 * required after the first two */ 45 * required after the first two */
46 int gpio_pendown; /* the GPIO used to decide the pendown
47 * state if get_pendown_state == NULL
48 */
46 int (*get_pendown_state)(void); 49 int (*get_pendown_state)(void);
47 int (*filter_init) (struct ads7846_platform_data *pdata, 50 int (*filter_init) (struct ads7846_platform_data *pdata,
48 void **filter_data); 51 void **filter_data);
diff --git a/include/linux/spi/corgi_lcd.h b/include/linux/spi/corgi_lcd.h
new file mode 100644
index 000000000000..6692b3418ccf
--- /dev/null
+++ b/include/linux/spi/corgi_lcd.h
@@ -0,0 +1,20 @@
1#ifndef __LINUX_SPI_CORGI_LCD_H
2#define __LINUX_SPI_CORGI_LCD_H
3
4#define CORGI_LCD_MODE_QVGA 1
5#define CORGI_LCD_MODE_VGA 2
6
7struct corgi_lcd_platform_data {
8 int init_mode;
9 int max_intensity;
10 int default_intensity;
11 int limit_mask;
12
13 int gpio_backlight_on; /* -1 if n/a */
14 int gpio_backlight_cont; /* -1 if n/a */
15
16 void (*notify)(int intensity);
17 void (*kick_battery)(void);
18};
19
20#endif /* __LINUX_SPI_CORGI_LCD_H */
diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h
new file mode 100644
index 000000000000..970473bf8d5a
--- /dev/null
+++ b/include/linux/ucb1400.h
@@ -0,0 +1,161 @@
1/*
2 * Register definitions and functions for:
3 * Philips UCB1400 driver
4 *
5 * Based on ucb1400_ts:
6 * Author: Nicolas Pitre
7 * Created: September 25, 2006
8 * Copyright: MontaVista Software, Inc.
9 *
10 * Spliting done by: Marek Vasut <marek.vasut@gmail.com>
11 * If something doesnt work and it worked before spliting, e-mail me,
12 * dont bother Nicolas please ;-)
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
17 *
18 * This code is heavily based on ucb1x00-*.c copyrighted by Russell King
19 * covering the UCB1100, UCB1200 and UCB1300.. Support for the UCB1400 has
20 * been made separate from ucb1x00-core/ucb1x00-ts on Russell's request.
21 */
22
23#ifndef _LINUX__UCB1400_H
24#define _LINUX__UCB1400_H
25
26#include <sound/ac97_codec.h>
27#include <linux/mutex.h>
28#include <linux/platform_device.h>
29
30/*
31 * UCB1400 AC-link registers
32 */
33
34#define UCB_IO_DATA 0x5a
35#define UCB_IO_DIR 0x5c
36#define UCB_IE_RIS 0x5e
37#define UCB_IE_FAL 0x60
38#define UCB_IE_STATUS 0x62
39#define UCB_IE_CLEAR 0x62
40#define UCB_IE_ADC (1 << 11)
41#define UCB_IE_TSPX (1 << 12)
42
43#define UCB_TS_CR 0x64
44#define UCB_TS_CR_TSMX_POW (1 << 0)
45#define UCB_TS_CR_TSPX_POW (1 << 1)
46#define UCB_TS_CR_TSMY_POW (1 << 2)
47#define UCB_TS_CR_TSPY_POW (1 << 3)
48#define UCB_TS_CR_TSMX_GND (1 << 4)
49#define UCB_TS_CR_TSPX_GND (1 << 5)
50#define UCB_TS_CR_TSMY_GND (1 << 6)
51#define UCB_TS_CR_TSPY_GND (1 << 7)
52#define UCB_TS_CR_MODE_INT (0 << 8)
53#define UCB_TS_CR_MODE_PRES (1 << 8)
54#define UCB_TS_CR_MODE_POS (2 << 8)
55#define UCB_TS_CR_BIAS_ENA (1 << 11)
56#define UCB_TS_CR_TSPX_LOW (1 << 12)
57#define UCB_TS_CR_TSMX_LOW (1 << 13)
58
59#define UCB_ADC_CR 0x66
60#define UCB_ADC_SYNC_ENA (1 << 0)
61#define UCB_ADC_VREFBYP_CON (1 << 1)
62#define UCB_ADC_INP_TSPX (0 << 2)
63#define UCB_ADC_INP_TSMX (1 << 2)
64#define UCB_ADC_INP_TSPY (2 << 2)
65#define UCB_ADC_INP_TSMY (3 << 2)
66#define UCB_ADC_INP_AD0 (4 << 2)
67#define UCB_ADC_INP_AD1 (5 << 2)
68#define UCB_ADC_INP_AD2 (6 << 2)
69#define UCB_ADC_INP_AD3 (7 << 2)
70#define UCB_ADC_EXT_REF (1 << 5)
71#define UCB_ADC_START (1 << 7)
72#define UCB_ADC_ENA (1 << 15)
73
74#define UCB_ADC_DATA 0x68
75#define UCB_ADC_DAT_VALID (1 << 15)
76#define UCB_ADC_DAT_MASK 0x3ff
77
78#define UCB_ID 0x7e
79#define UCB_ID_1400 0x4304
80
81struct ucb1400_ts {
82 struct input_dev *ts_idev;
83 struct task_struct *ts_task;
84 int id;
85 wait_queue_head_t ts_wait;
86 unsigned int ts_restart:1;
87 int irq;
88 unsigned int irq_pending; /* not bit field shared */
89 struct snd_ac97 *ac97;
90};
91
92struct ucb1400 {
93 struct platform_device *ucb1400_ts;
94};
95
96static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg)
97{
98 return ac97->bus->ops->read(ac97, reg);
99}
100
101static inline void ucb1400_reg_write(struct snd_ac97 *ac97, u16 reg, u16 val)
102{
103 ac97->bus->ops->write(ac97, reg, val);
104}
105
106static inline u16 ucb1400_gpio_get_value(struct snd_ac97 *ac97, u16 gpio)
107{
108 return ucb1400_reg_read(ac97, UCB_IO_DATA) & (1 << gpio);
109}
110
111static inline void ucb1400_gpio_set_value(struct snd_ac97 *ac97, u16 gpio,
112 u16 val)
113{
114 ucb1400_reg_write(ac97, UCB_IO_DATA, val ?
115 ucb1400_reg_read(ac97, UCB_IO_DATA) | (1 << gpio) :
116 ucb1400_reg_read(ac97, UCB_IO_DATA) & ~(1 << gpio));
117}
118
119static inline u16 ucb1400_gpio_get_direction(struct snd_ac97 *ac97, u16 gpio)
120{
121 return ucb1400_reg_read(ac97, UCB_IO_DIR) & (1 << gpio);
122}
123
124static inline void ucb1400_gpio_set_direction(struct snd_ac97 *ac97, u16 gpio,
125 u16 dir)
126{
127 ucb1400_reg_write(ac97, UCB_IO_DIR, dir ?
128 ucb1400_reg_read(ac97, UCB_IO_DIR) | (1 << gpio) :
129 ucb1400_reg_read(ac97, UCB_IO_DIR) & ~(1 << gpio));
130}
131
132static inline void ucb1400_adc_enable(struct snd_ac97 *ac97)
133{
134 ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA);
135}
136
137static unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel,
138 int adcsync)
139{
140 unsigned int val;
141
142 if (adcsync)
143 adc_channel |= UCB_ADC_SYNC_ENA;
144
145 ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA | adc_channel);
146 ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA | adc_channel |
147 UCB_ADC_START);
148
149 while (!((val = ucb1400_reg_read(ac97, UCB_ADC_DATA))
150 & UCB_ADC_DAT_VALID))
151 schedule_timeout_uninterruptible(1);
152
153 return val & UCB_ADC_DAT_MASK;
154}
155
156static inline void ucb1400_adc_disable(struct snd_ac97 *ac97)
157{
158 ucb1400_reg_write(ac97, UCB_ADC_CR, 0);
159}
160
161#endif
diff --git a/include/linux/wm97xx_batt.h b/include/linux/wm97xx_batt.h
new file mode 100644
index 000000000000..9681d1ab0e4f
--- /dev/null
+++ b/include/linux/wm97xx_batt.h
@@ -0,0 +1,26 @@
1#ifndef _LINUX_WM97XX_BAT_H
2#define _LINUX_WM97XX_BAT_H
3
4#include <linux/wm97xx.h>
5
6struct wm97xx_batt_info {
7 int batt_aux;
8 int temp_aux;
9 int charge_gpio;
10 int min_voltage;
11 int max_voltage;
12 int batt_div;
13 int batt_mult;
14 int temp_div;
15 int temp_mult;
16 int batt_tech;
17 char *batt_name;
18};
19
20#ifdef CONFIG_BATTERY_WM97XX
21void __init wm97xx_bat_set_pdata(struct wm97xx_batt_info *data);
22#else
23static inline void wm97xx_bat_set_pdata(struct wm97xx_batt_info *data) {}
24#endif
25
26#endif
diff --git a/include/video/metronomefb.h b/include/video/metronomefb.h
index dab04b4fad7f..9863f4b6d418 100644
--- a/include/video/metronomefb.h
+++ b/include/video/metronomefb.h
@@ -12,14 +12,6 @@
12#ifndef _LINUX_METRONOMEFB_H_ 12#ifndef _LINUX_METRONOMEFB_H_
13#define _LINUX_METRONOMEFB_H_ 13#define _LINUX_METRONOMEFB_H_
14 14
15/* address and control descriptors used by metronome controller */
16struct metromem_desc {
17 u32 mFDADR0;
18 u32 mFSADR0;
19 u32 mFIDR0;
20 u32 mLDCMD0;
21};
22
23/* command structure used by metronome controller */ 15/* command structure used by metronome controller */
24struct metromem_cmd { 16struct metromem_cmd {
25 u16 opcode; 17 u16 opcode;
@@ -29,34 +21,37 @@ struct metromem_cmd {
29 21
30/* struct used by metronome. board specific stuff comes from *board */ 22/* struct used by metronome. board specific stuff comes from *board */
31struct metronomefb_par { 23struct metronomefb_par {
32 unsigned char *metromem;
33 struct metromem_desc *metromem_desc;
34 struct metromem_cmd *metromem_cmd; 24 struct metromem_cmd *metromem_cmd;
35 unsigned char *metromem_wfm; 25 unsigned char *metromem_wfm;
36 unsigned char *metromem_img; 26 unsigned char *metromem_img;
37 u16 *metromem_img_csum; 27 u16 *metromem_img_csum;
38 u16 *csum_table; 28 u16 *csum_table;
39 int metromemsize;
40 dma_addr_t metromem_dma; 29 dma_addr_t metromem_dma;
41 dma_addr_t metromem_desc_dma;
42 struct fb_info *info; 30 struct fb_info *info;
43 struct metronome_board *board; 31 struct metronome_board *board;
44 wait_queue_head_t waitq; 32 wait_queue_head_t waitq;
45 u8 frame_count; 33 u8 frame_count;
34 int extra_size;
35 int dt;
46}; 36};
47 37
48/* board specific routines */ 38/* board specific routines and data */
49struct metronome_board { 39struct metronome_board {
50 struct module *owner; 40 struct module *owner; /* the platform device */
51 void (*free_irq)(struct fb_info *);
52 void (*init_gpio_regs)(struct metronomefb_par *);
53 void (*init_lcdc_regs)(struct metronomefb_par *);
54 void (*post_dma_setup)(struct metronomefb_par *);
55 void (*set_rst)(struct metronomefb_par *, int); 41 void (*set_rst)(struct metronomefb_par *, int);
56 void (*set_stdby)(struct metronomefb_par *, int); 42 void (*set_stdby)(struct metronomefb_par *, int);
43 void (*cleanup)(struct metronomefb_par *);
57 int (*met_wait_event)(struct metronomefb_par *); 44 int (*met_wait_event)(struct metronomefb_par *);
58 int (*met_wait_event_intr)(struct metronomefb_par *); 45 int (*met_wait_event_intr)(struct metronomefb_par *);
59 int (*setup_irq)(struct fb_info *); 46 int (*setup_irq)(struct fb_info *);
47 int (*setup_fb)(struct metronomefb_par *);
48 int (*setup_io)(struct metronomefb_par *);
49 int (*get_panel_type)(void);
50 unsigned char *metromem;
51 int fw;
52 int fh;
53 int wfm_size;
54 struct fb_info *host_fbinfo; /* the host LCD controller's fbi */
60}; 55};
61 56
62#endif 57#endif