aeaac5c36d12a47924d54ffa42f06c48605fc337
[openwrt/svn-archive/archive.git] / package / kernel / 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=$(if $(findstring y,$($(call ModuleConfVar,$(1)))),,$(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 define KernelPackage/i2c-core
28 $(call i2c_defaults,$(I2C_CORE_MODULES),51)
29 TITLE:=I2C support
30 DEPENDS:=@!TARGET_etrax
31 endef
32
33 define KernelPackage/i2c-core/description
34 Kernel modules for I2C support
35 endef
36
37 $(eval $(call KernelPackage,i2c-core))
38
39
40 I2C_ALGOBIT_MODULES:= \
41 CONFIG_I2C_ALGOBIT:drivers/i2c/algos/i2c-algo-bit
42
43 define KernelPackage/i2c-algo-bit
44 $(call i2c_defaults,$(I2C_ALGOBIT_MODULES),55)
45 TITLE:=I2C bit-banging interfaces
46 DEPENDS:=kmod-i2c-core
47 endef
48
49 define KernelPackage/i2c-algo-bit/description
50 Kernel modules for I2C bit-banging interfaces.
51 endef
52
53 $(eval $(call KernelPackage,i2c-algo-bit))
54
55 I2C_TINY_USB_MODULES:= \
56 CONFIG_I2C_TINY_USB:drivers/i2c/busses/i2c-tiny-usb
57
58 define KernelPackage/i2c-tiny-usb
59 $(call i2c_defaults,$(I2C_TINY_USB_MODULES),59)
60 TITLE:=I2C Tiny USB adaptor
61 DEPENDS:=@USB_SUPPORT kmod-i2c-core
62 endef
63
64 define KernelPackage/i2c-tiny-usb/description
65 Kernel module for the I2C Tiny USB adaptor developed
66 by Till Harbaum (http://www.harbaum.org/till/i2c_tiny_usb).
67 endef
68
69 $(eval $(call KernelPackage,i2c-tiny-usb))
70
71 I2C_MUX_MODULES:= \
72 CONFIG_I2C_MUX:drivers/i2c/i2c-mux
73
74 define KernelPackage/i2c-mux
75 $(call i2c_defaults,$(I2C_MUX_MODULES),51)
76 TITLE:=I2C bus multiplexing support
77 DEPENDS:=kmod-i2c-core
78 endef
79
80 define KernelPackage/i2c-mux/description
81 Kernel modules for I2C bus multiplexing support.
82 endef
83
84 $(eval $(call KernelPackage,i2c-mux))
85
86 I2C_MUX_GPIO_MODULES:= \
87 CONFIG_I2C_MUX_GPIO:drivers/i2c/muxes/gpio-i2cmux
88
89 define KernelPackage/i2c-mux-gpio
90 $(call i2c_defaults,$(I2C_MUX_GPIO_MODULES),51)
91 TITLE:=GPIO-based I2C mux/switches
92 DEPENDS:=kmod-i2c-mux
93 endef
94
95 define KernelPackage/i2c-mux-gpio/description
96 Kernel modules for GENERIC_GPIO I2C bus mux/switching devices.
97 endef
98
99 $(eval $(call KernelPackage,i2c-mux-gpio))
100
101 I2C_MUX_PCA954x_MODULES:= \
102 CONFIG_I2C_MUX_PCA954x:drivers/i2c/muxes/pca954x
103
104 define KernelPackage/i2c-mux-pca954x
105 $(call i2c_defaults,$(I2C_MUX_PCA954x_MODULES),51)
106 TITLE:=Philips PCA954x I2C mux/switches
107 DEPENDS:=kmod-i2c-mux
108 endef
109
110 define KernelPackage/i2c-mux-pca954x/description
111 Kernel modules for PCA954x I2C bus mux/switching devices.
112 endef
113
114 $(eval $(call KernelPackage,i2c-mux-pca954x))
115 ## Support for pca954x seems to be in kernel since 2.6.36
116
117 I2C_MUX_PCA9541_MODULES:= \
118 CONFIG_I2C_MUX_PCA9541:drivers/i2c/muxes/pca9541
119
120 define KernelPackage/i2c-mux-pca9541
121 $(call i2c_defaults,$(I2C_MUX_PCA9541_MODULES),51)
122 TITLE:=Philips PCA9541 I2C mux/switches
123 DEPENDS:=kmod-i2c-mux
124 endef
125
126 define KernelPackage/i2c-mux-pca9541/description
127 Kernel modules for PCA9541 I2C bus mux/switching devices.
128 endef
129
130 $(eval $(call KernelPackage,i2c-mux-pca9541))
131
132 GPIO_PCA953X_MODULES:= \
133 CONFIG_GPIO_PCA953X:drivers/gpio/gpio-pca953x
134
135 define KernelPackage/pca953x
136 $(call i2c_defaults,$(GPIO_PCA953X_MODULES),51)
137 TITLE:=Philips PCA953x I2C GPIO extenders
138 DEPENDS:=kmod-i2c-core
139 endef
140
141 define KernelPackage/pca953x/description
142 Kernel modules for PCA953x I2C GPIO extenders.
143 endef
144
145 $(eval $(call KernelPackage,pca953x))
146
147 GPIO_PCF857X_MODULES:= \
148 CONFIG_GPIO_PCF857X:drivers/gpio/gpio-pcf857x
149
150 define KernelPackage/pcf857x
151 $(call i2c_defaults,$(GPIO_PCF857X_MODULES),51)
152 TITLE:=Philips PCF857x I2C GPIO extenders
153 DEPENDS:=kmod-i2c-core
154 endef
155
156 define KernelPackage/pcf857x/description
157 Kernel modules for PCF857x I2C GPIO extenders.
158 endef
159
160 $(eval $(call KernelPackage,pcf857x))