Re: [PATCH] HID: Driver for Lenovo Keyboard w/ Trackpoint

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 13 Jun 2011 15:24:58 +0200 (CEST)
Jiri Kosina <jkosina@xxxxxxx> wrote:

> On Fri, 27 May 2011, Bernhard Seibold wrote:
> 
> > This patch adds support for setting the trackpoint sensitivity
> > of the "Lenovo ThinkPad USB Keyboard with Trackpoint".
> 
> As you are adding sysfs attribute, we'd like to have it documented as
> well Documentation/ABI somewhere.
>

Will do. Is there a generic way to make this setting available in
XInput? I feel this should show up as a device property when doing
something along the lines of "xinput list-props <DEV-ID>".

> 
> Why is this empty stub needed?

That's an oversight. I added support for microphone mute key here, but
removed it for patch submission since the patch adding KEY_MICMUTE
seems to be unapplied as of now (at least i didn't find any git tree
containing it)

The patch in question is:

[PATCH] Add KEY_MICMUTE and enable it on Lenovo X220
http://www.spinics.net/lists/linux-input/msg15394.html

> > +static ssize_t pointer_sensitivity_show(struct device *dev,
> > +		struct device_attribute *attr,
> > +		char *buf)
> > +{
> > +	struct hid_device *hdev;
> > +	struct hid_report *report;
> > +	hdev = container_of(dev, struct hid_device, dev);
> > +
> > +	if (hdev == NULL)
> > +		return -ENODEV;
> > +
> > +	report =
> > hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[4];
> > +	usbhid_submit_report(hdev, report, USB_DIR_IN);
> > +	usbhid_wait_io(hdev);
> 
> usbhid_wait_io() returns -1 in case it times out.
>

Whats the correct way to handle this? Since I'm a kernel-newbie I used
hid-ntrig.c among others as "inspiration" and there the return value
isn't checked either.

Frankly I'm not sure if the wait_io is necessary at all.

> > +static ssize_t pointer_sensitivity_store(struct device *dev,
> > +		struct device_attribute *attr,
> > +		const char *buf,
> > +		size_t count)
> > +{
> > +	struct hid_device *hdev;
> > +	struct hid_report *report;
> > +	int value;
> > +
> > +	if (kstrtoint(buf, 10, &value) || value < 1 || value > 255)
> > +		return -EINVAL;
> > +
> > +	hdev = container_of(dev, struct hid_device, dev);
> > +	if (hdev == NULL)
> > +		return -ENODEV;
> > +
> > +	report =
> > hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[4];
> > +	usbhid_submit_report(hdev, report, USB_DIR_IN);
> > +	usbhid_wait_io(hdev);
> 
> The same here.
> 
> Thanks,
> 

Thanks for your comments.

Should I just include KEY_MICMUTE in my patch or wait for that other
patch to show up somewhere in git before posting an updated version?

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux