summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap/include/mach/omap3-devices.h
blob: dd6826a463512a49ba4c643330b201f039f7317a (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
#ifndef __MACH_OMAP3_DEVICES_H
#define __MACH_OMAP3_DEVICES_H

#include <driver.h>
#include <sizes.h>
#include <mach/omap3-silicon.h>
#include <mach/devices.h>
#include <mach/mcspi.h>
#include <mach/omap_hsmmc.h>

/* the device numbering is the same as in the device tree */

static inline struct device_d *omap3_add_spi(int id, resource_size_t start)
{
	return add_generic_device("omap3_spi", id, NULL, start, SZ_4K,
				   IORESOURCE_MEM, NULL);
}

static inline struct device_d *omap3_add_spi1(void)
{
	return omap3_add_spi(1, OMAP3_MCSPI1_BASE);
}

static inline struct device_d *omap3_add_spi2(void)
{
	return omap3_add_spi(2, OMAP3_MCSPI2_BASE);
}

static inline struct device_d *omap3_add_spi3(void)
{
	return omap3_add_spi(3, OMAP3_MCSPI3_BASE);
}

static inline struct device_d *omap3_add_spi4(void)
{
	return omap3_add_spi(4, OMAP3_MCSPI4_BASE);
}

static inline struct device_d *omap3_add_uart1(void)
{
	return omap_add_uart(0, OMAP_UART1_BASE);
}

static inline struct device_d *omap3_add_uart2(void)
{
	return omap_add_uart(1, OMAP_UART2_BASE);
}

static inline struct device_d *omap3_add_uart3(void)
{
	return omap_add_uart(2, OMAP_UART3_BASE);
}

static inline struct device_d *omap3_add_mmc1(struct omap_hsmmc_platform_data *pdata)
{
	return omap_add_mmc(0, OMAP_MMC1_BASE + 0x100, pdata);
}

static inline struct device_d *omap3_add_mmc2(struct omap_hsmmc_platform_data *pdata)
{
	return omap_add_mmc(1, OMAP_MMC2_BASE + 0x100, pdata);
}

static inline struct device_d *omap3_add_mmc3(struct omap_hsmmc_platform_data *pdata)
{
	return omap_add_mmc(2, OMAP_MMC3_BASE + 0x100, pdata);
}

static inline struct device_d *omap3_add_i2c1(void *pdata)
{
	return omap_add_i2c(0, OMAP_I2C1_BASE, pdata);
}

static inline struct device_d *omap3_add_i2c2(void *pdata)
{
	return omap_add_i2c(1, OMAP_I2C2_BASE, pdata);
}

static inline struct device_d *omap3_add_i2c3(void *pdata)
{
	return omap_add_i2c(2, OMAP_I2C3_BASE, pdata);
}

#endif /* __MACH_OMAP3_DEVICES_H */