Exemple #1
0
	profile_activated(pyra, settings->startup_profile);

	roccat_report.type = PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_2;
	roccat_report.value = settings->startup_profile + 1;
	roccat_report.key = 0;
	roccat_report_event(pyra->chrdev_minor,
			(uint8_t const *)&roccat_report);

	mutex_unlock(&pyra->pyra_lock);
	return PYRA_SIZE_SETTINGS;
}

PYRA_SYSFS_R(settings, SETTINGS);
static struct bin_attribute bin_attr_settings =
	__BIN_ATTR(settings, (S_IWUSR | S_IRUGO),
		   pyra_sysfs_read_settings, pyra_sysfs_write_settings,
		   PYRA_SIZE_SETTINGS);

static ssize_t pyra_sysfs_show_actual_cpi(struct device *dev,
		struct device_attribute *attr, char *buf)
{
	struct pyra_device *pyra =
			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
	return snprintf(buf, PAGE_SIZE, "%d\n", pyra->actual_cpi);
}
static DEVICE_ATTR(actual_cpi, 0440, pyra_sysfs_show_actual_cpi, NULL);

static ssize_t pyra_sysfs_show_actual_profile(struct device *dev,
		struct device_attribute *attr, char *buf)
{
	struct pyra_device *pyra =
		siz = size;
	}
	mutex_unlock(&sDev->mutex);
	return siz;
}

static struct device_attribute sensor_class_attrs[] = {
	__ATTR(enable, 0660, getSensorActive, setSensorActive),
	__ATTR(delay, 0660, getSensorDelay, setSensorDelay),
	__ATTR(dumpLevel, 0660, getSensorDumpLevel, setSensorDumpLevel),
	__ATTR(dump, 0440, getInternalDump, NULL),
	__ATTR_NULL,
};

static struct bin_attribute sensor_class_bin_attrs[] = {
	__BIN_ATTR(deviceInfor, 0440, sizeof(struct device_infor), NULL, getDeviceInfor, NULL),
	__BIN_ATTR(calibrate, 0660, sizeof(Sensor_Calibrate_Infor), NULL, getCalibrate, setCalibrate),
	__ATTR_NULL,
};

static int sensor_suspend(struct device* dev, pm_message_t state)
{
	return 0;
}

static int sensor_resume(struct device* dev)
{
	return 0;
}

int sensor_device_register(struct device* parent, sensor_device* sDev)