summaryrefslogtreecommitdiffstats
path: root/drivers/hid/i2c-hid/i2c-hid.c
Commit message (Collapse)AuthorAgeFilesLines
* HID: core: check parameters when sending/receiving data from the deviceBenjamin Tissoires2014-02-171-1/+1
| | | | | | | | It is better to check them soon enough before triggering any kernel panic. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: use generic .request() implementationBenjamin Tissoires2014-02-171-31/+0Star
| | | | | | | | | Having our own .request() implementation does not give anything, so use the generic binding. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: implement ll_driver transport-layer callbacksBenjamin Tissoires2014-02-171-9/+60
| | | | | | | | | | | | 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: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: remove hid_get_raw_report in struct hid_deviceBenjamin Tissoires2014-02-171-1/+0Star
| | | | | | | | | | 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: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
*-. Merge branches 'for-3.13/upstream-fixes', 'for-3.14/i2c-hid', ↵Jiri Kosina2014-01-221-1/+3
|\ \ | | | | | | | | | 'for-3.14/sensor-hub', 'for-3.14/sony' and 'for-3.14/upstream' into for-linus
| | * Merge tag 'pm+acpi-2-3.13-rc1' of ↵Linus Torvalds2013-11-201-1/+1
| |/| |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more ACPI and power management updates from Rafael Wysocki: - ACPI-based device hotplug fixes for issues introduced recently and a fix for an older error code path bug in the ACPI PCI host bridge driver - Fix for recently broken OMAP cpufreq build from Viresh Kumar - Fix for a recent hibernation regression related to s2disk - Fix for a locking-related regression in the ACPI EC driver from Puneet Kumar - System suspend error code path fix related to runtime PM and runtime PM documentation update from Ulf Hansson - cpufreq's conservative governor fix from Xiaoguang Chen - New processor IDs for intel_idle and turbostat and removal of an obsolete Kconfig option from Len Brown - New device IDs for the ACPI LPSS (Low-Power Subsystem) driver and ACPI-based PCI hotplug (ACPIPHP) cleanup from Mika Westerberg - Removal of several ACPI video DMI blacklist entries that are not necessary any more from Aaron Lu - Rework of the ACPI companion representation in struct device and code cleanup related to that change from Rafael J Wysocki, Lan Tianyu and Jarkko Nikula - Fixes for assigning names to ACPI-enumerated I2C and SPI devices from Jarkko Nikula * tag 'pm+acpi-2-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (24 commits) PCI / hotplug / ACPI: Drop unused acpiphp_debug declaration ACPI / scan: Set flags.match_driver in acpi_bus_scan_fixed() ACPI / PCI root: Clear driver_data before failing enumeration ACPI / hotplug: Fix PCI host bridge hot removal ACPI / hotplug: Fix acpi_bus_get_device() return value check cpufreq: governor: Remove fossil comment in the cpufreq_governor_dbs() ACPI / video: clean up DMI table for initial black screen problem ACPI / EC: Ensure lock is acquired before accessing ec struct members PM / Hibernate: Do not crash kernel in free_basic_memory_bitmaps() ACPI / AC: Remove struct acpi_device pointer from struct acpi_ac spi: Use stable dev_name for ACPI enumerated SPI slaves i2c: Use stable dev_name for ACPI enumerated I2C slaves ACPI: Provide acpi_dev_name accessor for struct acpi_device device name ACPI / bind: Use (put|get)_device() on ACPI device objects too ACPI: Eliminate the DEVICE_ACPI_HANDLE() macro ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node cpufreq: OMAP: Fix compilation error 'r & ret undeclared' PM / Runtime: Fix error path for prepare PM / Runtime: Update documentation around probe|remove|suspend cpufreq: conservative: set requested_freq to policy max when it is over policy max ...
| | * ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_nodeRafael J. Wysocki2013-11-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> # on Haswell Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Aaron Lu <aaron.lu@intel.com> # for ATA and SDIO part
| * | HID: i2c-hid: disable interrupt on suspendMika Westerberg2013-11-251-0/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Jerome Blin <jerome.blin@intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | Merge branch 'for-linus' of ↵Linus Torvalds2013-11-161-4/+0Star
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid Pull HID updates from Jiri Kosina: - i2c-hid is not querying init reports any more, as it's not mandated by the spec, and annoys quite a few devices during enumeration, by Bibek Basu - a lot of fixes for Logitech devices, by Simon Wood - hid-apple now has an option to switch between Option and Command mode, by Nanno Langstraat - Some more workarounds for severely broken ELO devices, by Oliver Neukum - more devm conversions, by Benjamin Tissoires - wiimote correctness fixes, by David Herrmann - a lot of added support for various new device IDs and random small fixes here and there" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (34 commits) HID: enable Mayflash USB Gamecube Adapter HID: sony: Add force feedback support for Dualshock3 USB Input: usbtouchscreen: ignore eGalax/D-Wav/EETI HIDs HID: don't ignore eGalax/D-Wav/EETI HIDs HID: roccat: add missing special driver declarations HID:hid-lg4ff: Correct Auto-center strength for wheels other than MOMO and MOMO2 HID:hid-lg4ff: Initialize device properties before we touch autocentering. HID:hid-lg4ff: ensure ConstantForce is disabled when set to 0 HID:hid-lg4ff: Switch autocentering off when strength is set to zero. HID:hid-lg4ff: Scale autocentering force properly on Logitech wheel HID: roccat: fix Coverity CID 141438 HID: multitouch: add manufacturer to Kconfig help text HID: logitech-dj: small cleanup in rdcat() HID: remove self-assignment from hid_input_report HID: hid-sensor-hub: fix report size HID: i2c-hid: Stop querying for init reports HID: roccat: add support for Ryos MK keyboards HID: roccat: generalize some common code HID: roccat: add new device return value HID: wiimote: add pro-controller analog stick calibration ...
| * HID: i2c-hid: Stop querying for init reportsBibek Basu2013-10-301-4/+0Star
| | | | | | | | | | | | | | | | | | 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: Bibek Basu <bbasu@nvidia.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | i2c-hid: convert acpi_evaluate_object() to acpi_evaluate_integer()Zhang Rui2013-09-241-13/+5Star
|/ | | | | | | | | | | | | | | 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: Zhang Rui <rui.zhang@intel.com> Acked-by: Jiri Kosina <jkosina@suse.cz> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
*-----. Merge branches 'for-3.12/devm', 'for-3.12/i2c-hid', 'for-3.12/i2c-hid-dt', ↵Jiri Kosina2013-09-061-27/+45
|\ \ \ \ | | | | | | | | | | | | | | | 'for-3.12/logitech', 'for-3.12/multitouch-win8', 'for-3.12/trasnport-driver-cleanup', 'for-3.12/uhid', 'for-3.12/upstream' and 'for-3.12/wiimote' into for-linus
| | | | * HID: i2c-hid: don't push static constants on stack for %*phAndy Shevchenko2013-08-051-2/+2
| | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to pass constants via stack. The width may be explicitly specified in the format. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| | | * HID: i2c: use generic hidinput_input_event()David Herrmann2013-07-311-24/+0Star
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * / HID: i2c-hid: add DT bindingsBenjamin Tissoires2013-07-311-1/+43
| |/ | | | | | | | | | | | | | | | | Add device tree based support for HID over I2C devices. Tested on an Odroid-X board with a Synaptics touchpad. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* / HID: i2c-hid: use correct type for ACPI _DSM parameterMika Westerberg2013-08-201-2/+3
|/ | | | | | | | | | | | | | | | | 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: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: support sending HID output reports using the output registerAndrew Duggan2013-07-041-3/+17
| | | | | | | | | | | 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: Andrew Duggan <aduggan@synaptics.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: fix length for set/get report in i2c hidHuzefa Kankroliwala2013-04-041-5/+4Star
| | | | | | | | | | | | | | | | 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: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Huzefa Kankroliwala <huzefa.nomanx.kankroliwala@intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: implement request() callbackBenjamin Tissoires2013-02-251-0/+32
| | | | | | | | | This allows HID drivers to also get/set reports through hid_hw_request(). Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
*-. Merge branches 'for-3.8/upstream-fixes', 'for-3.9/hid-sensor', ↵Jiri Kosina2013-02-211-12/+87
|\ \ | | | | | | | | | | | | | | | | | | 'for-3.9/hidraw' and 'for-3.9/i2c-hid' into for-linus Conflicts: drivers/hid/i2c-hid/i2c-hid.c
| | * HID: i2c-hid: add ACPI supportMika Westerberg2013-01-181-6/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | Merge branch 'for-3.8/upstream-fixes' of ↵Linus Torvalds2013-01-311-1/+12
| |\ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid PullHID fixes from Jiri Kosina: - fix i2c-hid and hidraw interaction, by Benjamin Tissoires - a quirk to make a particular device (Formosa IR receiver) work properly, by Nicholas Santos * 'for-3.8/upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: i2c-hid: fix i2c_hid_output_raw_report HID: usbhid: quirk for Formosa IR receiver HID: remove x bit from sensor doc
| * | Drivers: misc: remove __dev* attributes.Greg Kroah-Hartman2013-01-041-6/+6
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* / HID: i2c-hid: fix i2c_hid_output_raw_reportBenjamin Tissoires2013-01-311-1/+12
|/ | | | | | | | | | | | | | 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: Andrew Duggan <aduggan@synaptics.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: add mutex protecting open/close raceBenjamin Tissoires2012-12-121-3/+11
| | | | | | | | | | | | 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: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: fix ret_count checkJiri Kosina2012-12-061-1/+1
| | | | | | | | | 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: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: fix i2c_hid_get_raw_report count mismatchesBenjamin Tissoires2012-12-061-4/+12
| | | | | | | | | | | | 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: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: remove extra .irq field in struct i2c_hidBenjamin Tissoires2012-12-061-10/+5Star
| | | | | | | | | There is no point in keeping the irq in i2c_hid as it's already there in client. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: reorder allocation/free of buffersBenjamin Tissoires2012-12-061-40/+28Star
| | | | | | | | | | 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: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: fix memory corruption due to missing hid declarationBenjamin Tissoires2012-12-061-1/+8
| | | | | | | | | HID descriptors contains 4 bytes of reserved field. The previous implementation was overriding the next fields in struct i2c_hid. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: remove superfluous includeJiri Kosina2012-12-051-1/+0Star
| | | | | | | | The pointless WARN_ON() has been removed from i2c_hid_remove(), so we don't need bug.h any more. Reported-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: remove unneeded test in i2c_hid_removeBenjamin Tissoires2012-12-051-3/+0Star
| | | | | | | ihid can not be null, so there are no reasons to test it. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: i2c_hid_get_report may failBenjamin Tissoires2012-12-051-2/+3
| | | | | | | | | | 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: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: also call i2c_hid_free_buffers in i2c_hid_removeBenjamin Tissoires2012-12-051-0/+3
| | | | | | | | | | 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: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: fix error messagesBenjamin Tissoires2012-12-051-5/+6
| | | | | | Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: fix return pathsBenjamin Tissoires2012-12-051-12/+12
| | | | | | | | | | Forwards appropriate return values. As noone use the error returned by i2c_hid_get_input, let's make it returning void. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: remove unused static declarationsBenjamin Tissoires2012-12-051-15/+10Star
| | | | | | | | | These definitions are not used here, but are defined by the specification. Keeping some of them for documentation purposes. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: fix i2c_hid_dbg macroBenjamin Tissoires2012-12-051-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: fix checkpatch.pl warningBenjamin Tissoires2012-12-051-1/+1
| | | | | | | | We should not initialize to 0 static declarations. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: change I2C nameBenjamin Tissoires2012-12-051-1/+1
| | | | | | | | | no I2C driver has "i2c" in its name. It makes more sense to call this i2c driver "hid". Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: fix memory leak during probeJiri Kosina2012-11-201-0/+1
| | | | | | | | | In case we are returning from i2c_hid_probe() through the 'err' or 'err_mem_free' labels, there is noone freeing the buffers allocated by i2c_hid_alloc_buffers(). Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: i2c-hid: introduce HID over i2c specification implementationBenjamin Tissoires2012-11-191-0/+974
Microsoft published the protocol specification of HID over i2c: http://msdn.microsoft.com/en-us/library/windows/hardware/hh852380.aspx This patch introduces an implementation of this protocol. This implementation does not includes the ACPI part of the specification. This will come when ACPI 5.0 devices enumeration will be available. Once the ACPI part is done, OEM will not have to declare HID over I2C devices in their platform specific driver. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>