summaryrefslogtreecommitdiffstats
path: root/drivers/hid/intel-ish-hid/ipc/pci-ish.c
Commit message (Collapse)AuthorAgeFilesLines
* HID: intel-ish-hid: ipc: add EHL device idEven Xu2019-08-191-0/+1
| | | | | | | | | EHL is a new platform using ishtp solution, add its device id to support list. Signed-off-by: Even Xu <even.xu@intel.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: remove NO_D3 flag when remove driverSong Hongyan2019-06-261-0/+1
| | | | | | | | | Remove the NO_D3 flag when remove the driver and let device enter into D3, it will save more power. Signed-off-by: Song Hongyan <hongyan.song@intel.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288Thomas Gleixner2019-06-051-9/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms and conditions of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 263 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190529141901.208660670@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* HID: intel-ish-hid: Add Comet Lake PCI device IDSrinivas Pandruvada2019-04-231-0/+1
| | | | | | | Add Comet Lake PCI device ID to the supported device list. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: intel-ish-hid: add MSI interrupt supportSong Hongyan2018-12-191-1/+6
| | | | | | | | | | | Now ish hid ipc only support sideband interrupt but on some platforms they use MSI interrupt. In order to make the interrupt type coverage all the scenario add single MSI interrupt support, it can match all interrupt types. Signed-off-by: Song Hongyan <hongyan.song@intel.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* Merge branch 'for-4.20/i2c-hid' into for-linusJiri Kosina2018-10-231-51/+24Star
|\ | | | | | | | | - general cleanups of hid-i2c driver - SPIODEV device descriptor fixes
| * HID: intel-ish-hid: use resource-managed apiHong Liu2018-09-241-51/+24Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use resource-managed api to simplify error handling in probe and driver remove logic. With this patch, we can save ~170 bytes code size in intel-ish-ipc.ko. before: text data bss dec hex filename 11495 1568 72 13135 334f intel-ish-ipc.ko after: text data bss dec hex filename 11327 1568 72 12967 32a7 intel-ish-ipc.ko Signed-off-by: Hong Liu <hong.liu@intel.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | HID: intel-ish-hid: Enable Ice Lake mobileSrinivas Pandruvada2018-09-241-0/+1
|/ | | | | | | Added PCI ID for Ice Lake mobile platform. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: intel-ish-hid: Enable Sunrise Point-H ish driverAndreas Bosch2018-08-281-0/+1
| | | | | | | | Added PCI ID for Sunrise Point-H ISH. Signed-off-by: Andreas Bosch <linux@progandy.de> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: intel_ish-hid: tx_buf memory leak on probe/removeAnton Vasilyev2018-08-021-2/+0Star
| | | | | | | | | | | | | | | | | | ish_dev_init() allocates 512*176 bytes memory for tx_buf and stores it at &dev->wr_free_list_head.link list on ish_probe(). But there is no deallocation of this memory in ish_remove() and in ish_probe() error path. So current intel-ish-ipc provides 88 KB memory leak for each probe/release. The patch replaces kzalloc allocation by devm_kzalloc and removes ishtp_device *dev deallocation by kfree. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: intel-ish-hid: Prevent loading of driver on MehlowSrinivas Pandruvada2018-08-021-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | On Mehlow Xeon-E workstation, ISH PCI device is enabled but without ISH firmware. Here the ISH device PCI device id was reused for some non Linux storage drivers. So this was not done for enabling ISH. But this has a undesirable side effect for Linux. Here the ISH driver will be loaded via PCI enumeration and will try to do reset sequence. But reset sequence will wait till timeout as there is no real ISH firmware is present to take action. This delay will add to boot time of Linux (This platform will still continue to boot after this timeout). To avoid this boot delay we need to prevent loading of ISH drivers on this platform. So we need to have hack to avoid treating this device as ISH on this platform. To identify this workstation, we need some runtime method. Luckily there are special PCI id on this workstation to distinguish from the client version of this platform. On client version, the ISH is supported using same PCI device id. So this change look for the presence of PCI device IDs A309 and A30A and exit. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: intel_ish-hid: ipc: register more pm callbacks to support hibernationEven Xu2018-06-201-15/+7Star
| | | | | | | | | | | | | | | | | | | | | | | | | | Current ISH driver only registers suspend/resume PM callbacks which don't support hibernation (suspend to disk). Basically after hiberation, the ISH can't resume properly and user may not see sensor events (for example: screen rotation may not work). User will not see a crash or panic or anything except the following message in log: hid-sensor-hub 001F:8086:22D8.0001: timeout waiting for response from ISHTP device So this patch adds support for S4/hiberbation to ISH by using the SIMPLE_DEV_PM_OPS() MACRO instead of struct dev_pm_ops directly. The suspend and resume functions will now be used for both suspend to RAM and hibernation. If power management is disabled, SIMPLE_DEV_PM_OPS will do nothing, the suspend and resume related functions won't be used, so mark them as __maybe_unused to clarify that this is the intended behavior, and remove #ifdefs for power management. Cc: stable@vger.kernel.org Signed-off-by: Even Xu <even.xu@intel.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: intel-ish-hid: Enable Cannon Lake and Coffee Lake laptop/desktopSrinivas Pandruvada2018-01-231-0/+1
| | | | | | | Added PCI ID for Cannon Lake and Coffee Lake laptop/desktop skews. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: intel-ish-hid: Enable Gemini Lake ish driverSong Hongyan2017-06-301-0/+1
| | | | | | | | Added PCI ID for Gemini Lake ISH. Signed-off-by: Song Hongyan <hongyan.song@intel.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: intel-ish-hid: Enable Cannon Lake ish driverSong Hongyan2017-06-301-0/+1
| | | | | | | | Added PCI ID for Cannon Lake ISH. Signed-off-by: Song Hongyan <hongyan.song@intel.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
*-. Merge branches 'for-4.10/upstream-fixes', 'for-4.11/intel-ish', ↵Jiri Kosina2017-02-201-12/+26
|\ \ | | | | | | | | | 'for-4.11/mayflash', 'for-4.11/microsoft', 'for-4.11/rmi', 'for-4.11/upstream' and 'for-4.11/wacom' into for-linus
| | * HID: intel-ish-hid: Remove unneeded linux/miscdevice.h includeCorentin Labbe2016-12-191-1/+0Star
| |/ |/| | | | | | | | | | | | | | | hid/intel-ish-hid does not use any miscdevice so this patch remove this unnecessary inclusion. Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * HID: intel-ish-hid: ipc: check FW status to distinguish ISH resume pathsEven Xu2017-02-081-10/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | For ISH resume, there are two paths, they need different way to handle: one where ISH is not powered off, in that case a simple resume message is enough, in other case we need a reset sequence. We can use ISH FW status to distinguish those two cases and handle them properly. Signed-off-by: Even Xu <even.xu@intel.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * HID: intel-ish-hid: add printf attribute to print_log()Nicolas Iooss2017-01-021-1/+2
|/ | | | | | | | | | | | | | Structure ishtp_device contains a logging function, print_log(), which formats some of its parameters using vsnprintf(). Add a __printf attribute to this function field (and to ish_event_tracer()) in order to detect at compile time issues related to the printf-like formatting. While at it, make format parameter a const pointer as print_log() is not supposed to modify it. Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: intel-ish-hid: request_irq failureSrinivas Pandruvada2016-11-051-1/+1
| | | | | | | | | | | | | | On some platforms ISH interrupt is shared, which causes request_irq to fail. This requires IRQF_SHARED irq flag. But IRQF_NO_SUSPEND and IRQF_SHARED should not be used together, so removed IRQF_NO_SUSPEND flag. Anyway this driver doesn't require IRQF_NO_SUSPEND, as this interrupt is not required during "noirq" phases of suspending and resuming devices as well as during the time when nonboot CPUs are taken offline and brought back online. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: intel-ish-hid: Fix !CONFIG_PM build warningBorislav Petkov2016-11-031-2/+2
| | | | | | | | | | | | | | | | | | | | | Fix drivers/hid/intel-ish-hid/ipc/pci-ish.c:247:12: warning: ‘ish_suspend’ defined but not used [-Wunused-function] static int ish_suspend(struct device *device) ^ drivers/hid/intel-ish-hid/ipc/pci-ish.c:282:12: warning: ‘ish_resume’ defined but not used [-Wunused-function] static int ish_resume(struct device *device) ^ by sticking them in the CONFIG_PM range too. Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: Jiri Kosina <jikos@kernel.org> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: Wei Yongjun <weiyongjun1@huawei.com> Cc: linux-input@vger.kernel.org Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: intel-ish-hid: use module_pci_driver to simplify the codeWei Yongjun2016-08-291-12/+1Star
| | | | | | | | | Use the module_pci_driver() macro to make the code simpler by eliminating module_init and module_exit calls. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: intel-ish-hid: ipc layerSrinivas Pandruvada2016-08-171-0/+333
This layer is responsible for - Enumerating over PCI bus - Inform FW about host readiness - Provide HW interface to transport layer for control and messages - Interrupt handling and routing Original-author: Daniel Drubin <daniel.drubin@intel.com> Reviewed-and-tested-by: Ooi, Joyce <joyce.ooi@intel.com> Tested-by: Grant Likely <grant.likely@secretlab.ca> Tested-by: Rann Bar-On <rb6@duke.edu> Tested-by: Atri Bhattacharya <badshah400@aim.com> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>