aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorBenson Leung <bleung@chromium.org>2013-02-21 15:14:56 -0500
committerMatthew Garrett <matthew.garrett@nebula.com>2013-02-27 08:30:45 -0500
commite7b28845d794b0f382a3942558c24e63d5e45c32 (patch)
tree9c9c24317b65b7b573a35f642e9da4de721d9ae1 /drivers/platform
parent33a84f8a7694e442a624556ef3ae40e91e31bd11 (diff)
Platform: x86: chromeos_laptop - Add a more general add_i2c_device
This will allow us to assign devices to buses by the type enum. Signed-off-by: Benson Leung <bleung@chromium.org> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/chromeos_laptop.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/platform/x86/chromeos_laptop.c b/drivers/platform/x86/chromeos_laptop.c
index e5380e772b26..6bde4e4c93b4 100644
--- a/drivers/platform/x86/chromeos_laptop.c
+++ b/drivers/platform/x86/chromeos_laptop.c
@@ -181,16 +181,24 @@ static __init struct i2c_client *add_probed_i2c_device(
181 * info->addr. 181 * info->addr.
182 * Returns NULL if no device found. 182 * Returns NULL if no device found.
183 */ 183 */
184static struct i2c_client __init *add_smbus_device(const char *name, 184static __init struct i2c_client *add_i2c_device(const char *name,
185 struct i2c_board_info *info) 185 enum i2c_adapter_type type,
186 struct i2c_board_info *info)
186{ 187{
187 const unsigned short addr_list[] = { info->addr, I2C_CLIENT_END }; 188 const unsigned short addr_list[] = { info->addr, I2C_CLIENT_END };
188 return __add_probed_i2c_device(name, 189 return __add_probed_i2c_device(name,
189 find_i2c_adapter_num(I2C_ADAPTER_SMBUS), 190 find_i2c_adapter_num(type),
190 info, 191 info,
191 addr_list); 192 addr_list);
192} 193}
193 194
195
196static struct i2c_client __init *add_smbus_device(const char *name,
197 struct i2c_board_info *info)
198{
199 return add_i2c_device(name, I2C_ADAPTER_SMBUS, info);
200}
201
194static int __init setup_cyapa_smbus_tp(const struct dmi_system_id *id) 202static int __init setup_cyapa_smbus_tp(const struct dmi_system_id *id)
195{ 203{
196 /* add cyapa touchpad on smbus */ 204 /* add cyapa touchpad on smbus */