提交 cfe9e888 编写于 作者: D Dmitry Torokhov

Input: rework psmouse attributes to reduce module size

Rearrange attribute code to use generic show and set handlers
instead of replicating them for every attribute; switch to
using attribute_group instead of creating all attributes
manually. All this saves about 4K.
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 15c42e5a
...@@ -150,12 +150,12 @@ static void ps2pp_set_smartscroll(struct psmouse *psmouse, unsigned int smartscr ...@@ -150,12 +150,12 @@ static void ps2pp_set_smartscroll(struct psmouse *psmouse, unsigned int smartscr
ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES); ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES);
} }
static ssize_t psmouse_attr_show_smartscroll(struct psmouse *psmouse, char *buf) static ssize_t ps2pp_attr_show_smartscroll(struct psmouse *psmouse, void *data, char *buf)
{ {
return sprintf(buf, "%d\n", psmouse->smartscroll ? 1 : 0); return sprintf(buf, "%d\n", psmouse->smartscroll ? 1 : 0);
} }
static ssize_t psmouse_attr_set_smartscroll(struct psmouse *psmouse, const char *buf, size_t count) static ssize_t ps2pp_attr_set_smartscroll(struct psmouse *psmouse, void *data, const char *buf, size_t count)
{ {
unsigned long value; unsigned long value;
char *rest; char *rest;
...@@ -169,7 +169,8 @@ static ssize_t psmouse_attr_set_smartscroll(struct psmouse *psmouse, const char ...@@ -169,7 +169,8 @@ static ssize_t psmouse_attr_set_smartscroll(struct psmouse *psmouse, const char
return count; return count;
} }
PSMOUSE_DEFINE_ATTR(smartscroll); PSMOUSE_DEFINE_ATTR(smartscroll, S_IWUSR | S_IRUGO, NULL,
ps2pp_attr_show_smartscroll, ps2pp_attr_set_smartscroll);
/* /*
* Support 800 dpi resolution _only_ if the user wants it (there are good * Support 800 dpi resolution _only_ if the user wants it (there are good
...@@ -194,7 +195,7 @@ static void ps2pp_set_resolution(struct psmouse *psmouse, unsigned int resolutio ...@@ -194,7 +195,7 @@ static void ps2pp_set_resolution(struct psmouse *psmouse, unsigned int resolutio
static void ps2pp_disconnect(struct psmouse *psmouse) static void ps2pp_disconnect(struct psmouse *psmouse)
{ {
device_remove_file(&psmouse->ps2dev.serio->dev, &psmouse_attr_smartscroll); device_remove_file(&psmouse->ps2dev.serio->dev, &psmouse_attr_smartscroll.dattr);
} }
static struct ps2pp_info *get_model_info(unsigned char model) static struct ps2pp_info *get_model_info(unsigned char model)
...@@ -379,7 +380,8 @@ int ps2pp_init(struct psmouse *psmouse, int set_properties) ...@@ -379,7 +380,8 @@ int ps2pp_init(struct psmouse *psmouse, int set_properties)
psmouse->set_resolution = ps2pp_set_resolution; psmouse->set_resolution = ps2pp_set_resolution;
psmouse->disconnect = ps2pp_disconnect; psmouse->disconnect = ps2pp_disconnect;
device_create_file(&psmouse->ps2dev.serio->dev, &psmouse_attr_smartscroll); device_create_file(&psmouse->ps2dev.serio->dev,
&psmouse_attr_smartscroll.dattr);
} }
} }
......
...@@ -58,10 +58,30 @@ static unsigned int psmouse_resetafter; ...@@ -58,10 +58,30 @@ static unsigned int psmouse_resetafter;
module_param_named(resetafter, psmouse_resetafter, uint, 0644); module_param_named(resetafter, psmouse_resetafter, uint, 0644);
MODULE_PARM_DESC(resetafter, "Reset device after so many bad packets (0 = never)."); MODULE_PARM_DESC(resetafter, "Reset device after so many bad packets (0 = never).");
PSMOUSE_DEFINE_ATTR(protocol); PSMOUSE_DEFINE_ATTR(protocol, S_IWUSR | S_IRUGO,
PSMOUSE_DEFINE_ATTR(rate); NULL,
PSMOUSE_DEFINE_ATTR(resolution); psmouse_attr_show_protocol, psmouse_attr_set_protocol);
PSMOUSE_DEFINE_ATTR(resetafter); PSMOUSE_DEFINE_ATTR(rate, S_IWUSR | S_IRUGO,
(void *) offsetof(struct psmouse, rate),
psmouse_show_int_attr, psmouse_attr_set_rate);
PSMOUSE_DEFINE_ATTR(resolution, S_IWUSR | S_IRUGO,
(void *) offsetof(struct psmouse, resolution),
psmouse_show_int_attr, psmouse_attr_set_resolution);
PSMOUSE_DEFINE_ATTR(resetafter, S_IWUSR | S_IRUGO,
(void *) offsetof(struct psmouse, resetafter),
psmouse_show_int_attr, psmouse_set_int_attr);
static struct attribute *psmouse_attributes[] = {
&psmouse_attr_protocol.dattr.attr,
&psmouse_attr_rate.dattr.attr,
&psmouse_attr_resolution.dattr.attr,
&psmouse_attr_resetafter.dattr.attr,
NULL
};
static struct attribute_group psmouse_attribute_group = {
.attrs = psmouse_attributes,
};
__obsolete_setup("psmouse_noext"); __obsolete_setup("psmouse_noext");
__obsolete_setup("psmouse_resolution="); __obsolete_setup("psmouse_resolution=");
...@@ -800,10 +820,7 @@ static void psmouse_disconnect(struct serio *serio) ...@@ -800,10 +820,7 @@ static void psmouse_disconnect(struct serio *serio)
psmouse = serio_get_drvdata(serio); psmouse = serio_get_drvdata(serio);
device_remove_file(&serio->dev, &psmouse_attr_protocol); sysfs_remove_group(&serio->dev.kobj, &psmouse_attribute_group);
device_remove_file(&serio->dev, &psmouse_attr_rate);
device_remove_file(&serio->dev, &psmouse_attr_resolution);
device_remove_file(&serio->dev, &psmouse_attr_resetafter);
down(&psmouse_sem); down(&psmouse_sem);
...@@ -940,10 +957,7 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv) ...@@ -940,10 +957,7 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv)
if (parent && parent->pt_activate) if (parent && parent->pt_activate)
parent->pt_activate(parent); parent->pt_activate(parent);
device_create_file(&serio->dev, &psmouse_attr_protocol); sysfs_create_group(&serio->dev.kobj, &psmouse_attribute_group);
device_create_file(&serio->dev, &psmouse_attr_rate);
device_create_file(&serio->dev, &psmouse_attr_resolution);
device_create_file(&serio->dev, &psmouse_attr_resetafter);
psmouse_activate(psmouse); psmouse_activate(psmouse);
...@@ -1040,10 +1054,12 @@ static struct serio_driver psmouse_drv = { ...@@ -1040,10 +1054,12 @@ static struct serio_driver psmouse_drv = {
.cleanup = psmouse_cleanup, .cleanup = psmouse_cleanup,
}; };
ssize_t psmouse_attr_show_helper(struct device *dev, char *buf, ssize_t psmouse_attr_show_helper(struct device *dev, struct device_attribute *devattr,
ssize_t (*handler)(struct psmouse *, char *)) char *buf)
{ {
struct serio *serio = to_serio_port(dev); struct serio *serio = to_serio_port(dev);
struct psmouse_attribute *attr = to_psmouse_attr(devattr);
struct psmouse *psmouse;
int retval; int retval;
retval = serio_pin_driver(serio); retval = serio_pin_driver(serio);
...@@ -1055,19 +1071,21 @@ ssize_t psmouse_attr_show_helper(struct device *dev, char *buf, ...@@ -1055,19 +1071,21 @@ ssize_t psmouse_attr_show_helper(struct device *dev, char *buf,
goto out; goto out;
} }
retval = handler(serio_get_drvdata(serio), buf); psmouse = serio_get_drvdata(serio);
retval = attr->show(psmouse, attr->data, buf);
out: out:
serio_unpin_driver(serio); serio_unpin_driver(serio);
return retval; return retval;
} }
ssize_t psmouse_attr_set_helper(struct device *dev, const char *buf, size_t count, ssize_t psmouse_attr_set_helper(struct device *dev, struct device_attribute *devattr,
ssize_t (*handler)(struct psmouse *, const char *, size_t)) const char *buf, size_t count)
{ {
struct serio *serio = to_serio_port(dev); struct serio *serio = to_serio_port(dev);
struct psmouse *psmouse = serio_get_drvdata(serio); struct psmouse_attribute *attr = to_psmouse_attr(devattr);
struct psmouse *parent = NULL; struct psmouse *psmouse, *parent = NULL;
int retval; int retval;
retval = serio_pin_driver(serio); retval = serio_pin_driver(serio);
...@@ -1083,6 +1101,8 @@ ssize_t psmouse_attr_set_helper(struct device *dev, const char *buf, size_t coun ...@@ -1083,6 +1101,8 @@ ssize_t psmouse_attr_set_helper(struct device *dev, const char *buf, size_t coun
if (retval) if (retval)
goto out_unpin; goto out_unpin;
psmouse = serio_get_drvdata(serio);
if (psmouse->state == PSMOUSE_IGNORE) { if (psmouse->state == PSMOUSE_IGNORE) {
retval = -ENODEV; retval = -ENODEV;
goto out_up; goto out_up;
...@@ -1095,7 +1115,7 @@ ssize_t psmouse_attr_set_helper(struct device *dev, const char *buf, size_t coun ...@@ -1095,7 +1115,7 @@ ssize_t psmouse_attr_set_helper(struct device *dev, const char *buf, size_t coun
psmouse_deactivate(psmouse); psmouse_deactivate(psmouse);
retval = handler(psmouse, buf, count); retval = attr->set(psmouse, attr->data, buf, count);
if (retval != -ENODEV) if (retval != -ENODEV)
psmouse_activate(psmouse); psmouse_activate(psmouse);
...@@ -1110,12 +1130,34 @@ ssize_t psmouse_attr_set_helper(struct device *dev, const char *buf, size_t coun ...@@ -1110,12 +1130,34 @@ ssize_t psmouse_attr_set_helper(struct device *dev, const char *buf, size_t coun
return retval; return retval;
} }
static ssize_t psmouse_attr_show_protocol(struct psmouse *psmouse, char *buf) static ssize_t psmouse_show_int_attr(struct psmouse *psmouse, void *offset, char *buf)
{
unsigned long *field = (unsigned long *)((char *)psmouse + (size_t)offset);
return sprintf(buf, "%lu\n", *field);
}
static ssize_t psmouse_set_int_attr(struct psmouse *psmouse, void *offset, const char *buf, size_t count)
{
unsigned long *field = (unsigned long *)((char *)psmouse + (size_t)offset);
unsigned long value;
char *rest;
value = simple_strtoul(buf, &rest, 10);
if (*rest)
return -EINVAL;
*field = value;
return count;
}
static ssize_t psmouse_attr_show_protocol(struct psmouse *psmouse, void *data, char *buf)
{ {
return sprintf(buf, "%s\n", psmouse_protocol_by_type(psmouse->type)->name); return sprintf(buf, "%s\n", psmouse_protocol_by_type(psmouse->type)->name);
} }
static ssize_t psmouse_attr_set_protocol(struct psmouse *psmouse, const char *buf, size_t count) static ssize_t psmouse_attr_set_protocol(struct psmouse *psmouse, void *data, const char *buf, size_t count)
{ {
struct serio *serio = psmouse->ps2dev.serio; struct serio *serio = psmouse->ps2dev.serio;
struct psmouse *parent = NULL; struct psmouse *parent = NULL;
...@@ -1179,12 +1221,7 @@ static ssize_t psmouse_attr_set_protocol(struct psmouse *psmouse, const char *bu ...@@ -1179,12 +1221,7 @@ static ssize_t psmouse_attr_set_protocol(struct psmouse *psmouse, const char *bu
return count; return count;
} }
static ssize_t psmouse_attr_show_rate(struct psmouse *psmouse, char *buf) static ssize_t psmouse_attr_set_rate(struct psmouse *psmouse, void *data, const char *buf, size_t count)
{
return sprintf(buf, "%d\n", psmouse->rate);
}
static ssize_t psmouse_attr_set_rate(struct psmouse *psmouse, const char *buf, size_t count)
{ {
unsigned long value; unsigned long value;
char *rest; char *rest;
...@@ -1197,12 +1234,7 @@ static ssize_t psmouse_attr_set_rate(struct psmouse *psmouse, const char *buf, s ...@@ -1197,12 +1234,7 @@ static ssize_t psmouse_attr_set_rate(struct psmouse *psmouse, const char *buf, s
return count; return count;
} }
static ssize_t psmouse_attr_show_resolution(struct psmouse *psmouse, char *buf) static ssize_t psmouse_attr_set_resolution(struct psmouse *psmouse, void *data, const char *buf, size_t count)
{
return sprintf(buf, "%d\n", psmouse->resolution);
}
static ssize_t psmouse_attr_set_resolution(struct psmouse *psmouse, const char *buf, size_t count)
{ {
unsigned long value; unsigned long value;
char *rest; char *rest;
...@@ -1215,23 +1247,6 @@ static ssize_t psmouse_attr_set_resolution(struct psmouse *psmouse, const char * ...@@ -1215,23 +1247,6 @@ static ssize_t psmouse_attr_set_resolution(struct psmouse *psmouse, const char *
return count; return count;
} }
static ssize_t psmouse_attr_show_resetafter(struct psmouse *psmouse, char *buf)
{
return sprintf(buf, "%d\n", psmouse->resetafter);
}
static ssize_t psmouse_attr_set_resetafter(struct psmouse *psmouse, const char *buf, size_t count)
{
unsigned long value;
char *rest;
value = simple_strtoul(buf, &rest, 10);
if (*rest)
return -EINVAL;
psmouse->resetafter = value;
return count;
}
static int psmouse_set_maxproto(const char *val, struct kernel_param *kp) static int psmouse_set_maxproto(const char *val, struct kernel_param *kp)
{ {
......
...@@ -86,24 +86,37 @@ int psmouse_sliced_command(struct psmouse *psmouse, unsigned char command); ...@@ -86,24 +86,37 @@ int psmouse_sliced_command(struct psmouse *psmouse, unsigned char command);
int psmouse_reset(struct psmouse *psmouse); int psmouse_reset(struct psmouse *psmouse);
void psmouse_set_resolution(struct psmouse *psmouse, unsigned int resolution); void psmouse_set_resolution(struct psmouse *psmouse, unsigned int resolution);
ssize_t psmouse_attr_show_helper(struct device *dev, char *buf,
ssize_t (*handler)(struct psmouse *, char *)); struct psmouse_attribute {
ssize_t psmouse_attr_set_helper(struct device *dev, const char *buf, size_t count, struct device_attribute dattr;
ssize_t (*handler)(struct psmouse *, const char *, size_t)); void *data;
ssize_t (*show)(struct psmouse *psmouse, void *data, char *buf);
#define PSMOUSE_DEFINE_ATTR(_name) \ ssize_t (*set)(struct psmouse *psmouse, void *data,
static ssize_t psmouse_attr_show_##_name(struct psmouse *, char *); \ const char *buf, size_t count);
static ssize_t psmouse_attr_set_##_name(struct psmouse *, const char *, size_t);\ };
static ssize_t psmouse_do_show_##_name(struct device *d, struct device_attribute *attr, char *b) \ #define to_psmouse_attr(a) container_of((a), struct psmouse_attribute, dattr)
{ \
return psmouse_attr_show_helper(d, b, psmouse_attr_show_##_name); \ ssize_t psmouse_attr_show_helper(struct device *dev, struct device_attribute *attr,
} \ char *buf);
static ssize_t psmouse_do_set_##_name(struct device *d, struct device_attribute *attr, const char *b, size_t s)\ ssize_t psmouse_attr_set_helper(struct device *dev, struct device_attribute *attr,
{ \ const char *buf, size_t count);
return psmouse_attr_set_helper(d, b, s, psmouse_attr_set_##_name); \
} \ #define PSMOUSE_DEFINE_ATTR(_name, _mode, _data, _show, _set) \
static struct device_attribute psmouse_attr_##_name = \ static ssize_t _show(struct psmouse *, void *data, char *); \
__ATTR(_name, S_IWUSR | S_IRUGO, \ static ssize_t _set(struct psmouse *, void *data, const char *, size_t); \
psmouse_do_show_##_name, psmouse_do_set_##_name); static struct psmouse_attribute psmouse_attr_##_name = { \
.dattr = { \
.attr = { \
.name = __stringify(_name), \
.mode = _mode, \
.owner = THIS_MODULE, \
}, \
.show = psmouse_attr_show_helper, \
.store = psmouse_attr_set_helper, \
}, \
.data = _data, \
.show = _show, \
.set = _set, \
}
#endif /* _PSMOUSE_H */ #endif /* _PSMOUSE_H */
...@@ -19,54 +19,6 @@ ...@@ -19,54 +19,6 @@
#include "psmouse.h" #include "psmouse.h"
#include "trackpoint.h" #include "trackpoint.h"
PSMOUSE_DEFINE_ATTR(sensitivity);
PSMOUSE_DEFINE_ATTR(speed);
PSMOUSE_DEFINE_ATTR(inertia);
PSMOUSE_DEFINE_ATTR(reach);
PSMOUSE_DEFINE_ATTR(draghys);
PSMOUSE_DEFINE_ATTR(mindrag);
PSMOUSE_DEFINE_ATTR(thresh);
PSMOUSE_DEFINE_ATTR(upthresh);
PSMOUSE_DEFINE_ATTR(ztime);
PSMOUSE_DEFINE_ATTR(jenks);
PSMOUSE_DEFINE_ATTR(press_to_select);
PSMOUSE_DEFINE_ATTR(skipback);
PSMOUSE_DEFINE_ATTR(ext_dev);
#define MAKE_ATTR_READ(_item) \
static ssize_t psmouse_attr_show_##_item(struct psmouse *psmouse, char *buf) \
{ \
struct trackpoint_data *tp = psmouse->private; \
return sprintf(buf, "%lu\n", (unsigned long)tp->_item); \
}
#define MAKE_ATTR_WRITE(_item, command) \
static ssize_t psmouse_attr_set_##_item(struct psmouse *psmouse, const char *buf, size_t count) \
{ \
char *rest; \
unsigned long value; \
struct trackpoint_data *tp = psmouse->private; \
value = simple_strtoul(buf, &rest, 10); \
if (*rest) \
return -EINVAL; \
tp->_item = value; \
trackpoint_write(&psmouse->ps2dev, command, tp->_item); \
return count; \
}
#define MAKE_ATTR_TOGGLE(_item, command, mask) \
static ssize_t psmouse_attr_set_##_item(struct psmouse *psmouse, const char *buf, size_t count) \
{ \
unsigned char toggle; \
struct trackpoint_data *tp = psmouse->private; \
toggle = (buf[0] == '1') ? 1 : 0; \
if (toggle != tp->_item) { \
tp->_item = toggle; \
trackpoint_toggle_bit(&psmouse->ps2dev, command, mask); \
} \
return count; \
}
/* /*
* Device IO: read, write and toggle bit * Device IO: read, write and toggle bit
*/ */
...@@ -108,59 +60,114 @@ static int trackpoint_toggle_bit(struct ps2dev *ps2dev, unsigned char loc, unsig ...@@ -108,59 +60,114 @@ static int trackpoint_toggle_bit(struct ps2dev *ps2dev, unsigned char loc, unsig
return 0; return 0;
} }
MAKE_ATTR_WRITE(sensitivity, TP_SENS);
MAKE_ATTR_READ(sensitivity);
MAKE_ATTR_WRITE(speed, TP_SPEED);
MAKE_ATTR_READ(speed);
MAKE_ATTR_WRITE(inertia, TP_INERTIA); /*
MAKE_ATTR_READ(inertia); * Trackpoint-specific attributes
*/
struct trackpoint_attr_data {
size_t field_offset;
unsigned char command;
unsigned char mask;
};
MAKE_ATTR_WRITE(reach, TP_REACH); static ssize_t trackpoint_show_int_attr(struct psmouse *psmouse, void *data, char *buf)
MAKE_ATTR_READ(reach); {
struct trackpoint_data *tp = psmouse->private;
struct trackpoint_attr_data *attr = data;
unsigned char *field = (unsigned char *)((char *)tp + attr->field_offset);
MAKE_ATTR_WRITE(draghys, TP_DRAGHYS); return sprintf(buf, "%u\n", *field);
MAKE_ATTR_READ(draghys); }
MAKE_ATTR_WRITE(mindrag, TP_MINDRAG); static ssize_t trackpoint_set_int_attr(struct psmouse *psmouse, void *data,
MAKE_ATTR_READ(mindrag); const char *buf, size_t count)
{
struct trackpoint_data *tp = psmouse->private;
struct trackpoint_attr_data *attr = data;
unsigned char *field = (unsigned char *)((char *)tp + attr->field_offset);
unsigned long value;
char *rest;
MAKE_ATTR_WRITE(thresh, TP_THRESH); value = simple_strtoul(buf, &rest, 10);
MAKE_ATTR_READ(thresh); if (*rest || value > 255)
return -EINVAL;
MAKE_ATTR_WRITE(upthresh, TP_UP_THRESH); *field = value;
MAKE_ATTR_READ(upthresh); trackpoint_write(&psmouse->ps2dev, attr->command, value);
MAKE_ATTR_WRITE(ztime, TP_Z_TIME); return count;
MAKE_ATTR_READ(ztime); }
MAKE_ATTR_WRITE(jenks, TP_JENKS_CURV); #define TRACKPOINT_INT_ATTR(_name, _command) \
MAKE_ATTR_READ(jenks); static struct trackpoint_attr_data trackpoint_attr_##_name = { \
.field_offset = offsetof(struct trackpoint_data, _name), \
.command = _command, \
}; \
PSMOUSE_DEFINE_ATTR(_name, S_IWUSR | S_IRUGO, \
&trackpoint_attr_##_name, \
trackpoint_show_int_attr, trackpoint_set_int_attr)
static ssize_t trackpoint_set_bit_attr(struct psmouse *psmouse, void *data,
const char *buf, size_t count)
{
struct trackpoint_data *tp = psmouse->private;
struct trackpoint_attr_data *attr = data;
unsigned char *field = (unsigned char *)((char *)tp + attr->field_offset);
unsigned long value;
char *rest;
value = simple_strtoul(buf, &rest, 10);
if (*rest || value > 1)
return -EINVAL;
if (*field != value) {
*field = value;
trackpoint_toggle_bit(&psmouse->ps2dev, attr->command, attr->mask);
}
MAKE_ATTR_TOGGLE(press_to_select, TP_TOGGLE_PTSON, TP_MASK_PTSON); return count;
MAKE_ATTR_READ(press_to_select); }
MAKE_ATTR_TOGGLE(skipback, TP_TOGGLE_SKIPBACK, TP_MASK_SKIPBACK);
MAKE_ATTR_READ(skipback);
MAKE_ATTR_TOGGLE(ext_dev, TP_TOGGLE_EXT_DEV, TP_MASK_EXT_DEV); #define TRACKPOINT_BIT_ATTR(_name, _command, _mask) \
MAKE_ATTR_READ(ext_dev); static struct trackpoint_attr_data trackpoint_attr_##_name = { \
.field_offset = offsetof(struct trackpoint_data, _name), \
.command = _command, \
.mask = _mask, \
}; \
PSMOUSE_DEFINE_ATTR(_name, S_IWUSR | S_IRUGO, \
&trackpoint_attr_##_name, \
trackpoint_show_int_attr, trackpoint_set_bit_attr)
TRACKPOINT_INT_ATTR(sensitivity, TP_SENS);
TRACKPOINT_INT_ATTR(speed, TP_SPEED);
TRACKPOINT_INT_ATTR(inertia, TP_INERTIA);
TRACKPOINT_INT_ATTR(reach, TP_REACH);
TRACKPOINT_INT_ATTR(draghys, TP_DRAGHYS);
TRACKPOINT_INT_ATTR(mindrag, TP_MINDRAG);
TRACKPOINT_INT_ATTR(thresh, TP_THRESH);
TRACKPOINT_INT_ATTR(upthresh, TP_UP_THRESH);
TRACKPOINT_INT_ATTR(ztime, TP_Z_TIME);
TRACKPOINT_INT_ATTR(jenks, TP_JENKS_CURV);
TRACKPOINT_BIT_ATTR(press_to_select, TP_TOGGLE_PTSON, TP_MASK_PTSON);
TRACKPOINT_BIT_ATTR(skipback, TP_TOGGLE_SKIPBACK, TP_MASK_SKIPBACK);
TRACKPOINT_BIT_ATTR(ext_dev, TP_TOGGLE_EXT_DEV, TP_MASK_EXT_DEV);
static struct attribute *trackpoint_attrs[] = { static struct attribute *trackpoint_attrs[] = {
&psmouse_attr_sensitivity.attr, &psmouse_attr_sensitivity.dattr.attr,
&psmouse_attr_speed.attr, &psmouse_attr_speed.dattr.attr,
&psmouse_attr_inertia.attr, &psmouse_attr_inertia.dattr.attr,
&psmouse_attr_reach.attr, &psmouse_attr_reach.dattr.attr,
&psmouse_attr_draghys.attr, &psmouse_attr_draghys.dattr.attr,
&psmouse_attr_mindrag.attr, &psmouse_attr_mindrag.dattr.attr,
&psmouse_attr_thresh.attr, &psmouse_attr_thresh.dattr.attr,
&psmouse_attr_upthresh.attr, &psmouse_attr_upthresh.dattr.attr,
&psmouse_attr_ztime.attr, &psmouse_attr_ztime.dattr.attr,
&psmouse_attr_jenks.attr, &psmouse_attr_jenks.dattr.attr,
&psmouse_attr_press_to_select.attr, &psmouse_attr_press_to_select.dattr.attr,
&psmouse_attr_skipback.attr, &psmouse_attr_skipback.dattr.attr,
&psmouse_attr_ext_dev.attr, &psmouse_attr_ext_dev.dattr.attr,
NULL NULL
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册