summaryrefslogtreecommitdiff
path: root/arch/arm/plat-mxs/include/mach/device.h
blob: 7083baa89245485a3a2af6e273a74cbb0c48eb71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
 * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#ifndef __ASM_ARM_ARCH_DEVICE_H
#define __ASM_ARM_ARCH_DEVICE_H

#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/ioport.h>

#include <asm/mach/time.h>

#define MXS_MAX_DEVICES 128

struct mxs_sys_timer {
	struct sys_timer timer;
	unsigned char id;
	unsigned char clk_sel;
	unsigned char resv[2];
	int irq;
	struct clk *clk;
	void __iomem *base;
};

struct mxs_dev_lookup {
	char *name;
	unsigned long lock;
	int size;
	struct platform_device *pdev;
};

/* Define the Platform special structure for each device type*/
struct mxs_dma_plat_data {
	unsigned int burst8:1;
	unsigned int burst:1;
	unsigned int chan_base;
	unsigned int chan_num;
};

struct mxs_i2c_plat_data {
	unsigned int pioqueue_mode:1;
};

struct mxs_lradc_plat_data {
	unsigned int vddio_voltage;
	unsigned int battery_voltage;
};

extern void mxs_timer_init(struct mxs_sys_timer *timer);

extern void mxs_nop_release(struct device *dev);
extern int mxs_add_devices(struct platform_device *, int num, int level);
extern int mxs_add_device(struct platform_device *, int level);
extern struct platform_device *mxs_get_device(char *name, int id);
extern struct mxs_dev_lookup *mxs_get_devices(char *name);

/* mxs ssp sd/mmc data definitons */
struct mxs_mmc_platform_data {
	int (*hw_init)(void);
	void (*hw_release)(void);
	void (*cmd_pullup)(int enable);
	int (*get_wp)(void);
	unsigned long (*setclock)(unsigned long hz);
	unsigned int caps;
	unsigned int min_clk;
	unsigned int max_clk;
	int read_uA;
	int write_uA;
	char *power_mmc;
	char *clock_mmc;
};
/* end of mxs ssp sd/mmc data definitions */

#ifdef CONFIG_MXS_ICOLL
extern void __init avic_init_irq(void __iomem *base, int nr_irqs);
#endif

#endif