]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - drivers/cbus/tahvo.h
Merge branch 'omap-fixes'
[linux-2.6-omap-h63xx.git] / drivers / cbus / tahvo.h
1 /*
2  * drivers/cbus/tahvo.h
3  *
4  * Copyright (C) 2004, 2005 Nokia Corporation
5  *
6  * Written by Juha Yrjölä <juha.yrjola@nokia.com> and
7  *            David Weinehall <david.weinehall@nokia.com>
8  *
9  * This file is subject to the terms and conditions of the GNU General
10  * Public License. See the file "COPYING" in the main directory of this
11  * archive for more details.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #ifndef __DRIVERS_CBUS_TAHVO_H
24 #define __DRIVERS_CBUS_TAHVO_H
25
26 #include <linux/types.h>
27
28 /* Registers */
29 #define TAHVO_REG_ASICR         0x00    /* ASIC ID & revision */
30 #define TAHVO_REG_IDR           0x01    /* Interrupt ID */
31 #define TAHVO_REG_IDSR          0x02    /* Interrupt status */
32 #define TAHVO_REG_IMR           0x03    /* Interrupt mask */
33 #define TAHVO_REG_LEDPWMR       0x05    /* LED PWM */
34 #define TAHVO_REG_USBR          0x06    /* USB control */
35 #define TAHVO_REG_MAX           0x0d
36
37 /* Interrupt sources */
38 #define TAHVO_INT_VBUSON        0
39
40 #define MAX_TAHVO_IRQ_HANDLERS  8
41
42 int tahvo_read_reg(int reg);
43 void tahvo_write_reg(int reg, u16 val);
44 void tahvo_set_clear_reg_bits(int reg, u16 set, u16 clear);
45 int tahvo_request_irq(int id, void *irq_handler, unsigned long arg, char *name);
46 void tahvo_free_irq(int id);
47 void tahvo_enable_irq(int id);
48 void tahvo_disable_irq(int id);
49 void tahvo_ack_irq(int id);
50 int tahvo_get_backlight_level(void);
51 int tahvo_get_max_backlight_level(void);
52 void tahvo_set_backlight_level(int level);
53
54 #ifdef CONFIG_CBUS_TAHVO_USER
55 int tahvo_user_init(void);
56 void tahvo_user_cleanup(void);
57 #endif
58
59 extern spinlock_t tahvo_lock;
60
61 #endif /* __DRIVERS_CBUS_TAHVO_H */