1284345Ssjg/*	$Id: at91cfvar.h,v 1.2 2008/07/03 01:15:38 matt Exp $	*/
2284345Ssjg/*	$NetBSD$	*/
3284345Ssjg
4284345Ssjg/*
5284345Ssjg * Copyright (c) 2007 Embedtronics Oy. All rights reserved.
6284345Ssjg *
7284345Ssjg * Based on arch/arm/ep93xx/eppcicvar.h,
8284345Ssjg * Copyright (c) 2005 HAMAJIMA Katsuomi. All rights reserved.
9284345Ssjg *
10284345Ssjg * Redistribution and use in source and binary forms, with or without
11284345Ssjg * modification, are permitted provided that the following conditions
12284345Ssjg * are met:
13284345Ssjg * 1. Redistributions of source code must retain the above copyright
14284345Ssjg *    notice, this list of conditions and the following disclaimer.
15284345Ssjg * 2. Redistributions in binary form must reproduce the above copyright
16284345Ssjg *    notice, this list of conditions and the following disclaimer in the
17284345Ssjg *    documentation and/or other materials provided with the distribution.
18284345Ssjg *
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 */
31
32#ifndef	_AT91CFVAR_H_
33#define	_AT91CFVAR_H_
34
35struct at91cf_chipset_tag {
36	int	(*power_ctl)(void *self, int onoff);
37#define	POWER_OFF	0
38#define	POWER_ON	1
39	int	(*card_detect)(void *self);
40	int	(*irq_line)(void *self);
41	void *	(*intr_establish)(void *self, int which, int ipl, int (*ih_func)(void *), void *arg);
42	void	(*intr_disestablish)(void *self, int wich, void *cookie);
43#define	CD_IRQ	0	// card detect change interrupt
44#define	CF_IRQ	1	// compact flash card interrupt
45};
46
47typedef struct at91cf_chipset_tag *at91cf_chipset_tag_t;
48
49struct at91cf_handle;
50
51struct at91cf_softc {
52	device_t		sc_dev;
53	bus_space_tag_t		sc_iot;
54	bus_space_handle_t	sc_memory_ioh, sc_common_ioh, sc_io_ioh;
55	struct at91cf_handle	*sc_ph;
56	at91cf_chipset_tag_t	sc_cscf;
57	int			sc_enable;
58};
59
60void at91cf_attach_common(device_t, device_t, void *,
61			   at91cf_chipset_tag_t);
62
63#endif	/* _AT91CFVAR_H_ */
64