- 04 12月, 2014 1 次提交
-
-
由 Rafael J. Wysocki 提交于
After commit b2b49ccb (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks depending on CONFIG_PM_RUNTIME may now be changed to depend on CONFIG_PM. Replace CONFIG_PM_RUNTIME with CONFIG_PM in drivers/hid/i2c-hid/i2c-hid.c. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NJiri Kosina <jkosina@suse.cz> Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
-
- 29 7月, 2014 1 次提交
-
-
由 Andrew Duggan 提交于
Currently, the i2c-hid driver does not call the suspend, resume, and reset_resume callbacks in the hid_driver struct when those events occur. This means that HID drivers for i2c-hid devices will not be able to execute commands which may be needed during suspend or resume. One example is when a touchpad using the hid-multitouch driver gets reset by i2c-hid coming out of resume. Since the reset_resume callback never gets called the device is never put back into the correct input mode. This patch calls the suspend and resume callbacks and tries to duplicate the functionality of the usb-hid driver. Signed-off-by: NAndrew Duggan <aduggan@synaptics.com> Signed-off-by: NVincent Huang <vincent.huang@tw.synaptics.com> Reviewed-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 13 5月, 2014 1 次提交
-
-
由 Archana Patni 提交于
Reading the partial HID Descriptor is causing a firmware lockup in some sensor hubs. Instead of a partial read, this patch implements the i2c hid fetch using a fixed descriptor size (30 bytes) followed by a verification of the BCDVersion (V01.00), and value stored in wHIDDescLength (30 Bytes) for V1.00 descriptors. As per i2c hid spec, this is the preferred model. From hid-over-i2c-protocol-spec-v1-0: There are a variety of ways a HOST may choose to retrieve the HID Descriptor from the DEVICE. The following is a preferred implementation but should not be considered the only implementation. A HOST may read the entire HID Descriptor in a single read by issuing a read for 30 Bytes to get the entire HID Descriptor from the DEVICE.However, the HOST is responsible for validating that 1. The BCDVersion is V01.00 (later revisions may have different descriptor lengths), and 2. The value stored in wHIDDescLength is 30 (Bytes) for V1.00 descriptors. Reported-by: NJoe Tijerina <joe.tijerina@st.com> Signed-off-by: NArchana Patni <archana.patni@intel.com> Signed-off-by: NSubramony Sesha <subramony.sesha@intel.com> Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 14 3月, 2014 1 次提交
-
-
由 Benjamin Tissoires 提交于
Nobody calls hid_output_raw_report anymore, and nobody should. We can now remove the various implementation in the different transport drivers and the declarations. Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com> Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 17 2月, 2014 4 次提交
-
-
由 Benjamin Tissoires 提交于
It is better to check them soon enough before triggering any kernel panic. Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
由 Benjamin Tissoires 提交于
Having our own .request() implementation does not give anything, so use the generic binding. Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
由 Benjamin Tissoires 提交于
Add output_report and raw_request to i2c-hid. The current implementation of i2c_hid_output_raw_report decides by itself if it should use a direct send of the output report or use the data register (SET_REPORT). Split that by reimplement the logic in __i2c_hid_output_raw_report() which will be dropped soon. Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
由 Benjamin Tissoires 提交于
dev->hid_get_raw_report(X) and hid_hw_raw_request(X, HID_REQ_GET_REPORT) are strictly equivalent. Switch the hid subsystem to the hid_hw notation and remove the field .hid_get_raw_report in struct hid_device. Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com> Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 03 2月, 2014 1 次提交
-
-
由 Benjamin Tissoires 提交于
When using hid_output_report(), the buffer should be allocated by hid_alloc_report_buf(), not a custom malloc. Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 30 1月, 2014 1 次提交
-
-
由 Mika Westerberg 提交于
This patch adds runtime PM support for the HID over I2C driver. When the i2c-hid device is first opened we power it on and on the last close we power it off. This is actually what the driver is already doing but in addition it allows subsystems, like ACPI power domain to power off the device during runtime PM suspend, which should save even more power. The implementation is not the most power efficient because it needs some interaction from the userspace (e.g close the device node whenever we are no more interested in getting events), nevertheless it allows us to save some power and works with devices that are not wake capable. Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 05 1月, 2014 1 次提交
-
-
由 Jiang Liu 提交于
Use helper functions to simplify _DSM related code in i2c-hid driver. Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 26 11月, 2013 1 次提交
-
-
由 Mika Westerberg 提交于
When an I2C HID device is powered of during system sleep, as a result of removing its power resources (by the ACPI core) the interrupt line might go low as well. This results inadvertent interrupt and wakes the system from sleep immediately. To prevent this we disable the device interrupt in the drivers suspend method and enable it on resume. The device can still wake the system up if it is wake capable (this also means that not all of its power will be removed to keep the interrupt line high). Reported-by: NJerome Blin <jerome.blin@intel.com> Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 15 11月, 2013 1 次提交
-
-
由 Rafael J. Wysocki 提交于
Modify struct acpi_dev_node to contain a pointer to struct acpi_device associated with the given device object (that is, its ACPI companion device) instead of an ACPI handle corresponding to it. Introduce two new macros for manipulating that pointer in a CONFIG_ACPI-safe way, ACPI_COMPANION() and ACPI_COMPANION_SET(), and rework the ACPI_HANDLE() macro to take the above changes into account. Drop the ACPI_HANDLE_SET() macro entirely and rework its users to use ACPI_COMPANION_SET() instead. For some of them who used to pass the result of acpi_get_child() directly to ACPI_HANDLE_SET() introduce a helper routine acpi_preset_companion() doing an equivalent thing. The main motivation for doing this is that there are things represented by struct acpi_device objects that don't have valid ACPI handles (so called fixed ACPI hardware features, such as power and sleep buttons) and we would like to create platform device objects for them and "glue" them to their ACPI companions in the usual way (which currently is impossible due to the lack of valid ACPI handles). However, there are more reasons why it may be useful. First, struct acpi_device pointers allow of much better type checking than void pointers which are ACPI handles, so it should be more difficult to write buggy code using modified struct acpi_dev_node and the new macros. Second, the change should help to reduce (over time) the number of places in which the result of ACPI_HANDLE() is passed to acpi_bus_get_device() in order to obtain a pointer to the struct acpi_device associated with the given "physical" device, because now that pointer is returned by ACPI_COMPANION() directly. Finally, the change should make it easier to write generic code that will build both for CONFIG_ACPI set and unset without adding explicit compiler directives to it. Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> # on Haswell Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Aaron Lu <aaron.lu@intel.com> # for ATA and SDIO part
-
- 30 10月, 2013 1 次提交
-
-
由 Bibek Basu 提交于
According to specifications, HID over I2C devices are not bound to respond to query for INPUT REPORTS. Thus dropping the call during init as many devices does not respond causing error messages during boot. Signed-off-by: NBibek Basu <bbasu@nvidia.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 24 9月, 2013 1 次提交
-
-
由 Zhang Rui 提交于
acpi_evaluate_integer() is an ACPI API introduced to evaluate an ACPI control method that is known to have an integer return value. This API can simplify the code because the calling function does not need to use the specified acpi_buffer structure required by acpi_evaluate_object(); Convert acpi_evaluate_object() to acpi_evaluate_integer() in drivers/hid/i2c-hid/i2c-hid.c in this patch. Signed-off-by: NZhang Rui <rui.zhang@intel.com> Acked-by: NJiri Kosina <jkosina@suse.cz> Acked-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 20 8月, 2013 1 次提交
-
-
由 Mika Westerberg 提交于
ACPI 5.0 specification requires the fourth parameter to the _DSM (Device Specific Method) to be of type package instead of integer. Failing to do that we get following warning on the console: ACPI Warning: \_SB_.PCI0.I2C1.TPL0._DSM: Argument #4 type mismatch - Found [Integer], ACPI requires [Package] (20130517/nsarguments-95) Fix this by passing an empty package to the _DSM method. The HID over I2C specification doesn't require any specific values to be passed with this parameter. Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 05 8月, 2013 1 次提交
-
-
由 Andy Shevchenko 提交于
There is no need to pass constants via stack. The width may be explicitly specified in the format. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 31 7月, 2013 2 次提交
-
-
由 Benjamin Tissoires 提交于
Add device tree based support for HID over I2C devices. Tested on an Odroid-X board with a Synaptics touchpad. Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
由 David Herrmann 提交于
HID core provides the same functionality, so drop the custom handler. Besides, the current handler doesn't schedule any outgoing report so it did not work, anyway. Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com> Reviewed-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 04 7月, 2013 1 次提交
-
-
由 Andrew Duggan 提交于
The current i2c hid driver does not support sending HID output reports using the output register for devices which support receiving reports through this method. This patch determines which method to use to send output reports based on the value of wMaxOutputLength in the device's HID descriptor. Signed-off-by: NAndrew Duggan <aduggan@synaptics.com> Reviewed-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 04 4月, 2013 1 次提交
-
-
由 Huzefa Kankroliwala 提交于
With the current i2c hid driver set/get report does not work as expected, for e.g sensor hub properties like power state, frequency etc is not set properly on the device as a result we do not get events. The problem is that i2c hid driver in function i2c_hid_request sets length equal to default buffer size for which the sensor hub does not respond on get/set commands. Use report length and calculate it based on report size and id. Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: NHuzefa Kankroliwala <huzefa.nomanx.kankroliwala@intel.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 25 2月, 2013 1 次提交
-
-
由 Benjamin Tissoires 提交于
This allows HID drivers to also get/set reports through hid_hw_request(). Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 01 2月, 2013 1 次提交
-
-
由 Benjamin Tissoires 提交于
i2c_hid_output_raw_report is used by hidraw to forward set_report requests. The current implementation of i2c_hid_set_report needs to take the report_id as an argument. The report_id is stored in the first byte of the buffer in argument of i2c_hid_output_raw_report. Not removing the report_id from the given buffer adds this byte 2 times in the command, leading to a non working command. Reported-by: NAndrew Duggan <aduggan@synaptics.com> Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 18 1月, 2013 1 次提交
-
-
由 Mika Westerberg 提交于
The HID over I2C protocol specification states that when the device is enumerated from ACPI the HID descriptor address can be obtained by executing "_DSM" for the device with function 1. Enable this. Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 04 1月, 2013 1 次提交
-
-
由 Greg Kroah-Hartman 提交于
CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 13 12月, 2012 1 次提交
-
-
由 Benjamin Tissoires 提交于
We should not enter close function while someone else is in open. This mutex prevents this race. There is also no need to override the ret value with -EIO in case of a failure of i2c_hid_set_power. Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 06 12月, 2012 5 次提交
-
-
由 Jiri Kosina 提交于
ret_count has to be at least 3, as we have to count the 2 bytes that are used for the size of the reply. Without this, memcpy() might be called with zero or negative count. Reported-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
由 Benjamin Tissoires 提交于
The previous memcpy implementation relied on the size advertized by the device. There were no guarantees that buf was big enough. Some gymnastic is also required with the +2/-2 to take into account the first 2 bytes of the returned buffer where the total returned length is supplied by the device. Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
由 Benjamin Tissoires 提交于
There is no point in keeping the irq in i2c_hid as it's already there in client. Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
由 Benjamin Tissoires 提交于
Simplifies i2c_hid_alloc_buffers tests, and makes this function responsible of the assignment of ihid->bufsize. The condition for the reallocation in i2c_hid_start is then simpler. Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
由 Benjamin Tissoires 提交于
HID descriptors contains 4 bytes of reserved field. The previous implementation was overriding the next fields in struct i2c_hid. Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 05 12月, 2012 9 次提交
-
-
由 Jiri Kosina 提交于
The pointless WARN_ON() has been removed from i2c_hid_remove(), so we don't need bug.h any more. Reported-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
由 Benjamin Tissoires 提交于
ihid can not be null, so there are no reasons to test it. Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
由 Benjamin Tissoires 提交于
If i2c_hid_get_report fails, exit i2c_hid_init_report. The printk log is already called by i2c_hid_get_report, so no need to add some more printks. Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
由 Benjamin Tissoires 提交于
In the case where the hid driver in charge of handling the hid part of the device (hid-generic for instance) fails at probe, neither i2c_hid_start nor i2c_hid_stop are called. Thus, the buffers allocated in i2c_hid_probe are never freed. Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
由 Benjamin Tissoires 提交于
Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
由 Benjamin Tissoires 提交于
Forwards appropriate return values. As noone use the error returned by i2c_hid_get_input, let's make it returning void. Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
由 Benjamin Tissoires 提交于
These definitions are not used here, but are defined by the specification. Keeping some of them for documentation purposes. Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
由 Benjamin Tissoires 提交于
This avoids the problematic case: if (condition) i2c_hid_dbg(ihid, "Blah blah %d\n", i); else do_something_very_important(); Which looks correct, however with the previous macro definition, this expands to the unexpected: if (condition) { if (debug) \ dev_printk(KERN_DEBUG, &ihid->client->dev, "Blah blah %d\n", i); else do_something_very_important(); } Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
由 Benjamin Tissoires 提交于
We should not initialize to 0 static declarations. Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: NJean Delvare <khali@linux-fr.org> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-