Commit 60790a58 authored by Dario Binacchi's avatar Dario Binacchi Committed by Dmitry Torokhov

Input: edt-ft5x06 - show model name by sysfs

The model name was printed only if debug mode was enabled. Now you can
always get it from sysfs.
Co-developed-by: default avatarMichael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: default avatarMichael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: default avatarDario Binacchi <dario.binacchi@amarulasolutions.com>
Acked-by: default avatarOliver Graute <oliver.graute@kococonnector.com>
Link: https://lore.kernel.org/r/20220621123937.1330389-5-dario.binacchi@amarulasolutions.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 5bcee83a
......@@ -530,6 +530,17 @@ static EDT_ATTR(threshold, S_IWUSR | S_IRUGO, WORK_REGISTER_THRESHOLD,
static EDT_ATTR(report_rate, S_IWUSR | S_IRUGO, WORK_REGISTER_REPORT_RATE,
M12_REGISTER_REPORT_RATE, NO_REGISTER, 0, 255);
static ssize_t model_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct i2c_client *client = to_i2c_client(dev);
struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client);
return sysfs_emit(buf, "%s\n", tsdata->name);
}
static DEVICE_ATTR_RO(model);
static struct attribute *edt_ft5x06_attrs[] = {
&edt_ft5x06_attr_gain.dattr.attr,
&edt_ft5x06_attr_offset.dattr.attr,
......@@ -537,6 +548,7 @@ static struct attribute *edt_ft5x06_attrs[] = {
&edt_ft5x06_attr_offset_y.dattr.attr,
&edt_ft5x06_attr_threshold.dattr.attr,
&edt_ft5x06_attr_report_rate.dattr.attr,
&dev_attr_model.attr,
NULL
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment