7e85ef3d9d5ec7dee01acbea3ad13c9205693ec5
[openwrt/openwrt.git] / package / kernel / linux / modules / i2c.mk
1 #
2 # Copyright (C) 2006-2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 I2C_MENU:=I2C support
9
10 ModuleConfVar=$(word 1,$(subst :,$(space),$(1)))
11 ModuleFullPath=$(LINUX_DIR)/$(word 2,$(subst :,$(space),$(1))).ko
12 ModuleKconfig=$(foreach mod,$(1),$(call ModuleConfVar,$(mod)))
13 ModuleFiles=$(foreach mod,$(1),$(call ModuleFullPath,$(mod)))
14 ModuleAuto=$(call AutoLoad,$(1),$(foreach mod,$(2),$(basename $(notdir $(call ModuleFullPath,$(mod))))),$(3))
15
16 define i2c_defaults
17 SUBMENU:=$(I2C_MENU)
18 KCONFIG:=$(call ModuleKconfig,$(1))
19 FILES:=$(call ModuleFiles,$(1))
20 AUTOLOAD:=$(call ModuleAuto,$(2),$(1),$(3))
21 endef
22
23 I2C_CORE_MODULES:= \
24 CONFIG_I2C:drivers/i2c/i2c-core \
25 CONFIG_I2C_CHARDEV:drivers/i2c/i2c-dev
26
27 ifeq ($(CONFIG_OF),y)
28 I2C_CORE_MODULES+=CONFIG_OF_I2C:drivers/of/of_i2c@lt3.12
29 endif
30
31 define KernelPackage/i2c-core
32 $(call i2c_defaults,$(I2C_CORE_MODULES),51)
33 TITLE:=I2C support
34 endef
35
36 define KernelPackage/i2c-core/description
37 Kernel modules for I2C support
38 endef
39
40 $(eval $(call KernelPackage,i2c-core))
41
42
43 I2C_ALGOBIT_MODULES:= \
44 CONFIG_I2C_ALGOBIT:drivers/i2c/algos/i2c-algo-bit
45
46 define KernelPackage/i2c-algo-bit
47 $(call i2c_defaults,$(I2C_ALGOBIT_MODULES),55)
48 TITLE:=I2C bit-banging interfaces
49 DEPENDS:=kmod-i2c-core
50 endef
51
52 define KernelPackage/i2c-algo-bit/description
53 Kernel modules for I2C bit-banging interfaces
54 endef
55
56 $(eval $(call KernelPackage,i2c-algo-bit))
57
58
59 I2C_ALGOPCA_MODULES:= \
60 CONFIG_I2C_ALGOPCA:drivers/i2c/algos/i2c-algo-pca
61
62 define KernelPackage/i2c-algo-pca
63 $(call i2c_defaults,$(I2C_ALGOPCA_MODULES),55)
64 TITLE:=I2C PCA 9564 interfaces
65 DEPENDS:=kmod-i2c-core
66 endef
67
68 define KernelPackage/i2c-algo-pca/description
69 Kernel modules for I2C PCA 9564 interfaces
70 endef
71
72 $(eval $(call KernelPackage,i2c-algo-pca))
73
74
75 I2C_ALGOPCF_MODULES:= \
76 CONFIG_I2C_ALGOPCF:drivers/i2c/algos/i2c-algo-pcf
77
78 define KernelPackage/i2c-algo-pcf
79 $(call i2c_defaults,$(I2C_ALGOPCF_MODULES),55)
80 TITLE:=I2C PCF 8584 interfaces
81 DEPENDS:=kmod-i2c-core
82 endef
83
84 define KernelPackage/i2c-algo-pcf/description
85 Kernel modules for I2C PCF 8584 interfaces
86 endef
87
88 $(eval $(call KernelPackage,i2c-algo-pcf))
89
90
91 I2C_GPIO_MODULES:= \
92 CONFIG_I2C_GPIO:drivers/i2c/busses/i2c-gpio
93
94 define KernelPackage/i2c-gpio
95 $(call i2c_defaults,$(I2C_GPIO_MODULES),59)
96 TITLE:=GPIO-based bitbanging I2C
97 DEPENDS:=@GPIO_SUPPORT +kmod-i2c-algo-bit
98 endef
99
100 define KernelPackage/i2c-gpio/description
101 Kernel modules for a very simple bitbanging I2C driver utilizing the
102 arch-neutral GPIO API to control the SCL and SDA lines.
103 endef
104
105 $(eval $(call KernelPackage,i2c-gpio))
106
107 I2C_TINY_USB_MODULES:= \
108 CONFIG_I2C_TINY_USB:drivers/i2c/busses/i2c-tiny-usb
109
110 define KernelPackage/i2c-tiny-usb
111 $(call i2c_defaults,$(I2C_TINY_USB_MODULES),59)
112 TITLE:=I2C Tiny USB adaptor
113 DEPENDS:=@USB_SUPPORT kmod-i2c-core +kmod-usb-core
114 endef
115
116 define KernelPackage/i2c-tiny-usb/description
117 Kernel module for the I2C Tiny USB adaptor developed
118 by Till Harbaum (http://www.harbaum.org/till/i2c_tiny_usb)
119 endef
120
121 $(eval $(call KernelPackage,i2c-tiny-usb))
122
123
124 I2C_PIIX4_MODULES:= \
125 CONFIG_I2C_PIIX4:drivers/i2c/busses/i2c-piix4
126
127 define KernelPackage/i2c-piix4
128 $(call i2c_defaults,$(I2C_PIIX4_MODULES),59)
129 TITLE:=Intel PIIX4 and compatible I2C interfaces
130 DEPENDS:=@PCI_SUPPORT @(x86||x86_64) kmod-i2c-core
131 endef
132
133 define KernelPackage/i2c-piix4/description
134 Support for the Intel PIIX4 family of mainboard I2C interfaces,
135 specifically Intel PIIX4, Intel 440MX, ATI IXP200, ATI IXP300,
136 ATI IXP400, ATI SB600, ATI SB700/SP5100, ATI SB800, AMD Hudson-2,
137 AMD ML, AMD CZ, Serverworks OSB4, Serverworks CSB5,
138 Serverworks CSB6, Serverworks HT-1000, Serverworks HT-1100 and
139 SMSC Victory66.
140 endef
141
142 $(eval $(call KernelPackage,i2c-piix4))
143
144
145 I2C_MUX_MODULES:= \
146 CONFIG_I2C_MUX:drivers/i2c/i2c-mux
147
148 define KernelPackage/i2c-mux
149 $(call i2c_defaults,$(I2C_MUX_MODULES),51)
150 TITLE:=I2C bus multiplexing support
151 DEPENDS:=kmod-i2c-core
152 endef
153
154 define KernelPackage/i2c-mux/description
155 Kernel modules for I2C bus multiplexing support
156 endef
157
158 $(eval $(call KernelPackage,i2c-mux))
159
160 I2C_MUX_GPIO_MODULES:= \
161 CONFIG_I2C_MUX_GPIO:drivers/i2c/muxes/i2c-mux-gpio
162
163 define KernelPackage/i2c-mux-gpio
164 $(call i2c_defaults,$(I2C_MUX_GPIO_MODULES),51)
165 TITLE:=GPIO-based I2C mux/switches
166 DEPENDS:=kmod-i2c-mux
167 endef
168
169 define KernelPackage/i2c-mux-gpio/description
170 Kernel modules for GENERIC_GPIO I2C bus mux/switching devices
171 endef
172
173 $(eval $(call KernelPackage,i2c-mux-gpio))
174
175 I2C_MUX_PCA954x_MODULES:= \
176 CONFIG_I2C_MUX_PCA954x:drivers/i2c/muxes/i2c-mux-pca954x
177
178 define KernelPackage/i2c-mux-pca954x
179 $(call i2c_defaults,$(I2C_MUX_PCA954x_MODULES),51)
180 TITLE:=Philips PCA954x I2C mux/switches
181 DEPENDS:=kmod-i2c-mux
182 endef
183
184 define KernelPackage/i2c-mux-pca954x/description
185 Kernel modules for PCA954x I2C bus mux/switching devices
186 endef
187
188 $(eval $(call KernelPackage,i2c-mux-pca954x))
189
190
191 I2C_MUX_PCA9541_MODULES:= \
192 CONFIG_I2C_MUX_PCA9541:drivers/i2c/muxes/i2c-mux-pca9541
193
194 define KernelPackage/i2c-mux-pca9541
195 $(call i2c_defaults,$(I2C_MUX_PCA9541_MODULES),51)
196 TITLE:=Philips PCA9541 I2C mux/switches
197 DEPENDS:=kmod-i2c-mux
198 endef
199
200 define KernelPackage/i2c-mux-pca9541/description
201 Kernel modules for PCA9541 I2C bus mux/switching devices
202 endef
203
204 $(eval $(call KernelPackage,i2c-mux-pca9541))