Skip to content

Commit efdd17f

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/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
2 parents 3ce120b + 7cb4774 commit efdd17f

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

drivers/hid/hid-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ static int hid_parser_main(struct hid_parser *parser, struct hid_item *item)
551551
ret = hid_add_field(parser, HID_FEATURE_REPORT, data);
552552
break;
553553
default:
554-
hid_err(parser->device, "unknown main item tag 0x%x\n", item->tag);
554+
hid_warn(parser->device, "unknown main item tag 0x%x\n", item->tag);
555555
ret = 0;
556556
}
557557

drivers/hid/hid-cp2112.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,8 +696,16 @@ static int cp2112_xfer(struct i2c_adapter *adap, u16 addr,
696696
(u8 *)&word, 2);
697697
break;
698698
case I2C_SMBUS_I2C_BLOCK_DATA:
699-
size = I2C_SMBUS_BLOCK_DATA;
700-
/* fallthrough */
699+
if (read_write == I2C_SMBUS_READ) {
700+
read_length = data->block[0];
701+
count = cp2112_write_read_req(buf, addr, read_length,
702+
command, NULL, 0);
703+
} else {
704+
count = cp2112_write_req(buf, addr, command,
705+
data->block + 1,
706+
data->block[0]);
707+
}
708+
break;
701709
case I2C_SMBUS_BLOCK_DATA:
702710
if (I2C_SMBUS_READ == read_write) {
703711
count = cp2112_write_read_req(buf, addr,
@@ -785,6 +793,9 @@ static int cp2112_xfer(struct i2c_adapter *adap, u16 addr,
785793
case I2C_SMBUS_WORD_DATA:
786794
data->word = le16_to_cpup((__le16 *)buf);
787795
break;
796+
case I2C_SMBUS_I2C_BLOCK_DATA:
797+
memcpy(data->block + 1, buf, read_length);
798+
break;
788799
case I2C_SMBUS_BLOCK_DATA:
789800
if (read_length > I2C_SMBUS_BLOCK_MAX) {
790801
ret = -EPROTO;

drivers/hid/hid-holtekff.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@
3232

3333
#ifdef CONFIG_HOLTEK_FF
3434

35-
MODULE_LICENSE("GPL");
36-
MODULE_AUTHOR("Anssi Hannula <[email protected]>");
37-
MODULE_DESCRIPTION("Force feedback support for Holtek On Line Grip based devices");
38-
3935
/*
4036
* These commands and parameters are currently known:
4137
*
@@ -223,3 +219,7 @@ static struct hid_driver holtek_driver = {
223219
.probe = holtek_probe,
224220
};
225221
module_hid_driver(holtek_driver);
222+
223+
MODULE_LICENSE("GPL");
224+
MODULE_AUTHOR("Anssi Hannula <[email protected]>");
225+
MODULE_DESCRIPTION("Force feedback support for Holtek On Line Grip based devices");

0 commit comments

Comments
 (0)