aboutsummaryrefslogtreecommitdiff
path: root/drivers/platform/x86
diff options
context:
space:
mode:
authorBenson Leung <bleung@chromium.org>2013-02-21 12:14:58 -0800
committerMatthew Garrett <matthew.garrett@nebula.com>2013-02-27 08:30:44 -0500
commitbcaf089c5160639d6c43091f717faa3d0dc8f3d8 (patch)
treede8277a55a5caccb9ccad76a31696bf62e8e98b9 /drivers/platform/x86
parent8e1ad4c4bf7b99b495625433a1fcc2b566caa222 (diff)
downloadlinux-linaro-stable-bcaf089c5160639d6c43091f717faa3d0dc8f3d8.tar.gz
Platform: x86: chromeos_laptop - Add support for probing devices
This will allow support for devices that may appear at more than one i2c address at boot time. The specific example is the atmel_mxt touch devices, which may appear at a different address if it comes up in bootloader mode. Signed-off-by: Benson Leung <bleung@chromium.org> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r--drivers/platform/x86/chromeos_laptop.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/platform/x86/chromeos_laptop.c b/drivers/platform/x86/chromeos_laptop.c
index 577e64d9f0ac..c13f0c5e282a 100644
--- a/drivers/platform/x86/chromeos_laptop.c
+++ b/drivers/platform/x86/chromeos_laptop.c
@@ -148,6 +148,26 @@ static int __init find_i2c_adapter_num(enum i2c_adapter_type type)
}
/*
+ * Takes a list of addresses in addrs as such :
+ * { addr1, ... , addrn, I2C_CLIENT_END };
+ * add_probed_i2c_device will use i2c_new_probed_device
+ * and probe for devices at all of the addresses listed.
+ * Returns NULL if no devices found.
+ * See Documentation/i2c/instantiating-devices for more information.
+ */
+static __init struct i2c_client *add_probed_i2c_device(
+ const char *name,
+ enum i2c_adapter_type type,
+ struct i2c_board_info *info,
+ const unsigned short *addrs)
+{
+ return __add_probed_i2c_device(name,
+ find_i2c_adapter_num(type),
+ info,
+ addrs);
+}
+
+/*
* Probes for a device at a single address, the one provided by
* info->addr.
* Returns NULL if no device found.