4 * Copyright (C) 2004, 2005 Nokia Corporation
6 * Written by Juha Yrjölä <juha.yrjola@nokia.com> and
7 * David Weinehall <david.weinehall@nokia.com>
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.
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.
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
23 #ifndef __DRIVERS_CBUS_TAHVO_H
24 #define __DRIVERS_CBUS_TAHVO_H
26 #include <linux/types.h>
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
37 /* Interrupt sources */
38 #define TAHVO_INT_VBUSON 0
40 #define MAX_TAHVO_IRQ_HANDLERS 8
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
);
54 #ifdef CONFIG_CBUS_TAHVO_USER
55 int tahvo_user_init(void);
56 void tahvo_user_cleanup(void);
59 extern spinlock_t tahvo_lock
;
61 #endif /* __DRIVERS_CBUS_TAHVO_H */