Commit bcaf089c authored by Benson Leung's avatar Benson Leung Committed by Matthew Garrett
Browse files

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: default avatarBenson Leung <bleung@chromium.org>
Signed-off-by: default avatarMatthew Garrett <matthew.garrett@nebula.com>
parent 8e1ad4c4
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -147,6 +147,26 @@ static int __init find_i2c_adapter_num(enum i2c_adapter_type type)
	return adapter->nr;
}

/*
 * 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.