Esempio n. 1
0
static int lumpy_add_devices()
{
	struct i2c_adapter *adapter;
	struct device *dev = NULL;
	int bus;

	/* find the SMBus adapter */
	dev = bus_find_device(&i2c_bus_type, NULL, "SMBus I801 adapter",
			      __find_i2c_adap);
	if (!dev) {
		pr_err("%s: no SMBus adapter found on system.\n", __func__);
		return -ENXIO;
	}
	adapter = to_i2c_adapter(dev);
	bus = adapter->nr;

	/*  add cyapa */
	lumpy_tp = add_smbus_device(adapter, "trackpad", &cyapa_device);
	if (!lumpy_tp)
		pr_err("%s failed to register device %d-%02x\n",
		       __func__, bus, LUMPY_TOUCHPAD_I2C_ADDR);

	/* add isl light sensor */
	lumpy_als = add_smbus_device(adapter, "lightsensor", &als_device);
	if (!lumpy_als)
		pr_err("%s failed to register device %d-%02x\n",
		       __func__, bus, LUMPY_ALS_I2C_ADDR);

	i2c_put_adapter(adapter);
	return 0;
}
Esempio n. 2
0
static int __init setup_tsl2563_als(const struct dmi_system_id *id)
{
	/* add tsl2563 light sensor on smbus */
	als = add_smbus_device(NULL, &tsl2563_als_device);
	return 0;
}
Esempio n. 3
0
static int __init setup_isl29018_als(const struct dmi_system_id *id)
{
	/* add isl29018 light sensor */
	als = add_smbus_device("lightsensor", &isl_als_device);
	return 0;
}
Esempio n. 4
0
static int __init setup_cyapa_smbus_tp(const struct dmi_system_id *id)
{
	/* add cyapa touchpad on smbus */
	tp = add_smbus_device("trackpad", &cyapa_device);
	return 0;
}