Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/dtor/input

Pull input fixes from Dmitry Torokhov:

 - a quirk to i8042 to ignore timeout bit on Lifebook AH544

 - a fixup to Synaptics RMI function 54 that was breaking some Dells

 - a fix for memory leak in soc_button_array driver

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: synaptics-rmi4 - only read the F54 query registers which are used
  Input: i8042 - add Fujitsu Lifebook AH544 to notimeout list
  Input: soc_button_array - fix leaking the ACPI button descriptor buffer
  • Loading branch information
Linus Torvalds committed Jun 25, 2017
2 parents d5d5c18 + 9768935 commit 412572b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 16 deletions.
20 changes: 14 additions & 6 deletions drivers/input/misc/soc_button_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ static struct soc_button_info *soc_button_get_button_info(struct device *dev)

if (!btns_desc) {
dev_err(dev, "ACPI Button Descriptors not found\n");
return ERR_PTR(-ENODEV);
button_info = ERR_PTR(-ENODEV);
goto out;
}

/* The first package describes the collection */
Expand All @@ -264,24 +265,31 @@ static struct soc_button_info *soc_button_get_button_info(struct device *dev)
}
if (collection_uid == -1) {
dev_err(dev, "Invalid Button Collection Descriptor\n");
return ERR_PTR(-ENODEV);
button_info = ERR_PTR(-ENODEV);
goto out;
}

/* There are package.count - 1 buttons + 1 terminating empty entry */
button_info = devm_kcalloc(dev, btns_desc->package.count,
sizeof(*button_info), GFP_KERNEL);
if (!button_info)
return ERR_PTR(-ENOMEM);
if (!button_info) {
button_info = ERR_PTR(-ENOMEM);
goto out;
}

/* Parse the button descriptors */
for (i = 1, btn = 0; i < btns_desc->package.count; i++, btn++) {
if (soc_button_parse_btn_desc(dev,
&btns_desc->package.elements[i],
collection_uid,
&button_info[btn]))
return ERR_PTR(-ENODEV);
&button_info[btn])) {
button_info = ERR_PTR(-ENODEV);
goto out;
}
}

out:
kfree(buf.pointer);
return button_info;
}

Expand Down
17 changes: 7 additions & 10 deletions drivers/input/rmi4/rmi_f54.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
#define F54_GET_REPORT 1
#define F54_FORCE_CAL 2

/* Fixed sizes of reports */
#define F54_QUERY_LEN 27

/* F54 capabilities */
#define F54_CAP_BASELINE (1 << 2)
#define F54_CAP_IMAGE8 (1 << 3)
Expand Down Expand Up @@ -95,7 +92,6 @@ struct rmi_f54_reports {
struct f54_data {
struct rmi_function *fn;

u8 qry[F54_QUERY_LEN];
u8 num_rx_electrodes;
u8 num_tx_electrodes;
u8 capabilities;
Expand Down Expand Up @@ -632,22 +628,23 @@ static int rmi_f54_detect(struct rmi_function *fn)
{
int error;
struct f54_data *f54;
u8 buf[6];

f54 = dev_get_drvdata(&fn->dev);

error = rmi_read_block(fn->rmi_dev, fn->fd.query_base_addr,
&f54->qry, sizeof(f54->qry));
buf, sizeof(buf));
if (error) {
dev_err(&fn->dev, "%s: Failed to query F54 properties\n",
__func__);
return error;
}

f54->num_rx_electrodes = f54->qry[0];
f54->num_tx_electrodes = f54->qry[1];
f54->capabilities = f54->qry[2];
f54->clock_rate = f54->qry[3] | (f54->qry[4] << 8);
f54->family = f54->qry[5];
f54->num_rx_electrodes = buf[0];
f54->num_tx_electrodes = buf[1];
f54->capabilities = buf[2];
f54->clock_rate = buf[3] | (buf[4] << 8);
f54->family = buf[5];

rmi_dbg(RMI_DEBUG_FN, &fn->dev, "F54 num_rx_electrodes: %d\n",
f54->num_rx_electrodes);
Expand Down
7 changes: 7 additions & 0 deletions drivers/input/serio/i8042-x86ia64io.h
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,13 @@ static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"),
},
},
{
/* Fujitsu UH554 laptop */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK UH544"),
},
},
{ }
};

Expand Down

0 comments on commit 412572b

Please sign in to comment.