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/jikos/hid

Pull HID fixes from Jiri Kosina:

 - two cosmetic fixes from Daniel Axtens and Hans de Goede

 - fix for I2C command mismatch fix for cp2112 driver from Eudean Sun

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: core: lower log level for unknown main item tags to warnings
  HID: holtekff: move MODULE_* parameters out of #ifdef block
  HID: cp2112: Fix I2C_BLOCK_DATA transactions
  • Loading branch information
Linus Torvalds committed Dec 30, 2017
2 parents 3ce120b + 7cb4774 commit efdd17f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion drivers/hid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ static int hid_parser_main(struct hid_parser *parser, struct hid_item *item)
ret = hid_add_field(parser, HID_FEATURE_REPORT, data);
break;
default:
hid_err(parser->device, "unknown main item tag 0x%x\n", item->tag);
hid_warn(parser->device, "unknown main item tag 0x%x\n", item->tag);
ret = 0;
}

Expand Down
15 changes: 13 additions & 2 deletions drivers/hid/hid-cp2112.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,8 +696,16 @@ static int cp2112_xfer(struct i2c_adapter *adap, u16 addr,
(u8 *)&word, 2);
break;
case I2C_SMBUS_I2C_BLOCK_DATA:
size = I2C_SMBUS_BLOCK_DATA;
/* fallthrough */
if (read_write == I2C_SMBUS_READ) {
read_length = data->block[0];
count = cp2112_write_read_req(buf, addr, read_length,
command, NULL, 0);
} else {
count = cp2112_write_req(buf, addr, command,
data->block + 1,
data->block[0]);
}
break;
case I2C_SMBUS_BLOCK_DATA:
if (I2C_SMBUS_READ == read_write) {
count = cp2112_write_read_req(buf, addr,
Expand Down Expand Up @@ -785,6 +793,9 @@ static int cp2112_xfer(struct i2c_adapter *adap, u16 addr,
case I2C_SMBUS_WORD_DATA:
data->word = le16_to_cpup((__le16 *)buf);
break;
case I2C_SMBUS_I2C_BLOCK_DATA:
memcpy(data->block + 1, buf, read_length);
break;
case I2C_SMBUS_BLOCK_DATA:
if (read_length > I2C_SMBUS_BLOCK_MAX) {
ret = -EPROTO;
Expand Down
8 changes: 4 additions & 4 deletions drivers/hid/hid-holtekff.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@

#ifdef CONFIG_HOLTEK_FF

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Anssi Hannula <anssi.hannula@iki.fi>");
MODULE_DESCRIPTION("Force feedback support for Holtek On Line Grip based devices");

/*
* These commands and parameters are currently known:
*
Expand Down Expand Up @@ -223,3 +219,7 @@ static struct hid_driver holtek_driver = {
.probe = holtek_probe,
};
module_hid_driver(holtek_driver);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Anssi Hannula <anssi.hannula@iki.fi>");
MODULE_DESCRIPTION("Force feedback support for Holtek On Line Grip based devices");

0 comments on commit efdd17f

Please sign in to comment.