HID: Show I2C bus type in hid_connect()
PATCH 1/2 HID: Show I2C bus type in hid_connect()
For I2C HID devices output currently looks like:
hid-multitouch ... input,hidraw0: <UNKNOWN> HID v1.00 Mouse ...
Add knowledge about I2C bus to hid_connect() so that it shows "I2C" correctly instead of "<UNKNOWN>".
--- drivers/hid/hid-core.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/hid/hid-core.c +3 -0
@@ -1678,6 +1678,9 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask)case BUS_BLUETOOTH : bus ="BLUETOOTH" ;break ; +case BUS_I2C : + bus ="I2C" ; +break ;default : bus ="<UNKNOWN>" ; }
Signature · 1 line
2.5.1
PATCH 2/2 HID: i2c-hid: Fill in physical device providing HID functionality
Currently hid_connect() prints out following when I2C connected HID devices is connected:
hid-multitouch 0018:03EB:2136.0001: ... [ATML3432:00 03EB:2136] on
After "on " should read physical device name but it is left empty by the driver.
Make it look better and fill in the physical device name.
--- drivers/hid/i2c-hid/i2c-hid.c | 1 + 1 file changed, 1 insertion(+)
drivers/hid/i2c-hid/i2c-hid.c +1 -0
@@ -1028,6 +1028,7 @@ static int i2c_hid_probe(struct i2c_client *client,snprintf (hid->name,sizeof (hid->name),"%s %04hX:%04hX" , client->name, hid->vendor, hid->product); +strlcpy (hid->phys,dev_name (&client->dev),sizeof (hid->phys)); ret =hid_add_device (hid);if (ret) {
Signature · 1 line
2.5.1
Re: [PATCH 2/2] HID: i2c-hid: Fill in physical device providing HID functionality
Quoted 20 lines · Mika Westerberg
Currently
hid_connect()prints out following when I2C connected HID devices is connected:hid-multitouch 0018:03EB:2136.0001: ... [ATML3432:00 03EB:2136] on
After "on " should read physical device name but it is left empty by the driver.
Make it look better and fill in the physical device name.
Signed-off-by Mika Westerberg <[email protected]>--- drivers/hid/i2c-hid/i2c-hid.c | 1 + 1 file changed, 1 insertion(+)drivers/hid/i2c-hid/i2c-hid.c +0
-0
drivers/hid/i2c-hid/i2c-hid.c static int i2c_hid_probe(struct i2c_client *client,
Quoted 8 lines
drivers/hid/i2c-hid/i2c-hid.c +1
-1@@ -1028,6 +1028,7 @@ static int i2c_hid_probe(struct i2c_client *client,snprintf (hid->name,sizeof (hid->name),"%s %04hX:%04hX" , client->name, hid->vendor, hid->product); +strlcpy (hid->phys,dev_name (&client->dev),sizeof (hid->phys)); ret =hid_add_device (hid);if (ret) { --
Tested and
Re: [PATCH 2/2] HID: i2c-hid: Fill in physical device providing HID functionality
In reply to Mika WesterbergQuoted 5 lines · Mika Westerberg
Currently
hid_connect()prints out following when I2C connected HID devices is connected:hid-multitouch 0018:03EB:2136.0001: ... [ATML3432:00 03EB:2136] on
Quoted 7 lines
After "on " should read physical device name but it is left empty by the driver.
Make it look better and fill in the physical device name.
Signed-off-by Mika Westerberg <[email protected]>---
Cheers,
Benjamin
Quoted 18 lines
drivers/hid/i2c-hid/i2c-hid.c | 1 + 1 file changed, 1 insertion(+)drivers/hid/i2c-hid/i2c-hid.c +1
-0@@ -1028,6 +1028,7 @@ static int i2c_hid_probe(struct i2c_client *client,snprintf (hid->name,sizeof (hid->name),"%s %04hX:%04hX" , client->name, hid->vendor, hid->product); +strlcpy (hid->phys,dev_name (&client->dev),sizeof (hid->phys)); ret =hid_add_device (hid);if (ret) {Signature · 1 line
2.5.1
Re: [PATCH 2/2] HID: i2c-hid: Fill in physical device providing HID functionality
In reply to Mika WesterbergQuoted 11 lines · Mika Westerberg
Currently
hid_connect()prints out following when I2C connected HID devices is connected:hid-multitouch 0018:03EB:2136.0001: ... [ATML3432:00 03EB:2136] on
After "on " should read physical device name but it is left empty by the driver.
Make it look better and fill in the physical device name.
Signed-off-by Mika Westerberg <[email protected]>
Applied to hid.git#for-4.4/i2c-hid.
Thanks,
Signature · 2 lines
Jiri Kosina SUSE Labs
Quoted 17 lines · Mika Westerberg
For I2C HID devices output currently looks like:
hid-multitouch ... input,hidraw0: <UNKNOWN> HID v1.00 Mouse ...
Add knowledge about I2C bus to
hid_connect()so that it shows "I2C" correctly instead of "<UNKNOWN>".Signed-off-by Mika Westerberg <[email protected]>--- drivers/hid/hid-core.c | 3 +++ 1 file changed, 3 insertions(+)drivers/hid/hid-core.c +0
-0
drivers/hid/hid-core.c int hid_connect(struct hid_device *hdev, unsigned int connect_mask) · line 1686
Quoted 9 lines
drivers/hid/hid-core.c +3
-0@@ -1678,6 +1678,9 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask)case BUS_BLUETOOTH : bus ="BLUETOOTH" ;break ; +case BUS_I2C : + bus ="I2C" ; +break ;default : bus ="<UNKNOWN>" ; }
Already queued:
https://git.kernel.org/cgit/linux/kernel/git/jikos/hid.git/commit/?h=for-4.4/upstream&id=0678072755b6672b19ee0fd42748a003912fca09