summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/intel_mid_powerbtn.c
AgeCommit message (Collapse)Author
2017-08-13platform/x86: intel_mid_powerbtn: make mid_pb_ddata constBhumika Goyal
Make these const as they are only used during a copy operation. Done using Coccinelle. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-08-13platform/x86: intel_mid_powerbtn: fix error return code in mid_pb_probe()Gustavo A. R. Silva
platform_get_irq() returns an error code, but the intel_mid_powerbtn driver ignores it and always returns -EINVAL. This is not correct and, prevents -EPROBE_DEFER from being propagated properly. Print error message and propagate the return value of platform_get_irq on failure. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-02-24platform/x86: intel_mid_powerbtn: Use SCU IPC directlyAndy Shevchenko
On older Intel MID platforms is using SCU IPC library beneath MSIC calls. To make access unified between old and new platforms use SCU IPC library directly. It's safe since serialization is done in the library. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-02-24platform/x86: intel_mid_powerbtn: Unify IRQ acknowledgmentAndy Shevchenko
The IRQ on Intel Merrifield can be acknowledged in the similar way it's done for previous MID platforms. Unify acknowledgment via SCU IPC. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-02-14platform/x86: intel_mid_powerbtn: Move comment to where it belongsAndy Shevchenko
The comments is about initial interrupt acknowledgment only. So, move it back to where it belongs. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-02-14platform/x86: intel_mid_powerbtn: Unify PBSTATUS accessAndy Shevchenko
The status register on Intel Merrifield can be read in the similar way it's done for previous MID platforms. Unify access to PBSTATUS register via SCU IPC. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-02-04platform/x86: intel_mid_powerbtn: Remove snail addressAndy Shevchenko
The snail address is subject to change. This already happened once. Remove the address completely from the file to avoid potential noise when update. While here, adjust copyright years and list authors. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-02-04platform/x86: intel_mid_powerbtn: Sort headers alphabeticallyAndy Shevchenko
Sort header inclusion block in alphabetical order. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-02-04platform/x86: intel_mid_powerbtn: Join string literalsAndy Shevchenko
There is no need and bad practice for debugging to split string literals. Join them back. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-02-04platform/x86: intel_mid_powerbtn: Enable driver for MerrifieldAndy Shevchenko
Enable this driver to handle events from Basin Cove PMIC, which is installed on Intel Merrifield platform. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-02-04platform/x86: intel_mid_powerbtn: Acknowledge interruptsAndy Shevchenko
Some platforms require interrupt to be acknowledged by clearing MSIC_PWRBTNM bit in interrupt level 1 mask register. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-02-04platform/x86: intel_mid_powerbtn: Factor out mfld_ack()Andy Shevchenko
Move Intel Medfield specific code to another callback, which will be used later. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-02-04platform/x86: intel_mid_powerbtn: Introduce driver dataAndy Shevchenko
This is preparatory patch to extend the driver in order to support other Intel MID platform. Here the new driver data structure is introduced with split of ->pbstat() callback. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-02-04platform/x86: intel_mid_powerbtn: Substitute mfld by midAndy Shevchenko
Replace all occurrences of mfld by mid to emphasize that driver is used for Intel MID platforms. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-02-04platform/x86: intel_mid_powerbtn: Convert to use devm_*()Andy Shevchenko
Convert driver to use managed resources. This eliminates error path boilerplate and makes code neat. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-01-21platform/x86: intel_mid_powerbtn: Set IRQ_ONESHOTAndy Shevchenko
The commit 1c6c69525b40 ("genirq: Reject bogus threaded irq requests") starts refusing misconfigured interrupt handlers. This makes intel_mid_powerbtn not working anymore. Add a mandatory flag to a threaded IRQ request in the driver. Fixes: 1c6c69525b40 ("genirq: Reject bogus threaded irq requests") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2015-10-03intel_mid_powerbtn: Remove misuse of IRQF_NO_SUSPEND flagSudeep Holla
The IRQF_NO_SUSPEND flag is used to identify the interrupts that should be left enabled so as to allow them to work as expected during the suspend-resume cycle, but doesn't guarantee that it will wake the system from a suspended state, enable_irq_wake is recommended to be used for the wakeup. This patch removes the use of IRQF_NO_SUSPEND flags and uses newly introduce PM wakeup APIs dev_pm_{set,clear}_wake_irq. Cc: Darren Hart <dvhart@infradead.org> Cc: platform-driver-x86@vger.kernel.org Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2014-10-20platform: x86: drop owner assignment from platform_driversWolfram Sang
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2013-11-20platform:x86: Remove OOM message after input_allocate_deviceJoe Perches
Emitting an OOM message isn't necessary after input_allocate_device as there's a generic OOM and a dump_stack already done. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-09-05platform: x86: remove unnecessary platform_set_drvdata()Jingoo Han
The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
2013-01-03Drivers: platform: x86: remove __dev* attributes.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> Cc: Joey Lee <jlee@novell.com> Cc: Matthew Garrett <mjg@redhat.com> Cc: Peter Feuerer <peter@piie.net> Cc: Corentin Chary <corentin.chary@gmail.com> Cc: Cezary Jackiewicz <cezary.jackiewicz@gmail.com> Cc: Robert Gerlach <khnz@gmx.de> Cc: Ike Panhc <ike.pan@canonical.com> Cc: Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-04intel_mid_powerbtn: mark irq as IRQF_NO_SUSPENDYong Wang
So that the power button still wakes up the platform. Signed-off-by: Pierre Tardy <pierre.tardy@intel.com> Link: http://lkml.kernel.org/r/20120504210244.F2EA5A018B@akpm.mtv.corp.google.com Tested-by: Kangkai Yin <kangkai.yin@intel.com> Tested-by: Yong Wang <yong.y.wang@intel.com> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: Matthew Garrett <mjg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2012-03-20intel_mid_powerbtn: use MSIC read/write instead of ipc_scuMichael Demeter
In the 2.6.36 kernel we did not have the MSIC driver. Changed all ipc_scu_reads/writes to use the MSIC driver and defines. Added a fix from the 2.6.36 kernel where the SCU FW could send a power button interrupt to the IA32 FW and the kernel was not running yet. This resulted in the interrupt not getting cleared and the power button was ignored. this fix just clears the interrupt on start-up. Signed-off-by: Michael Demeter <michael.demeter@intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Revert style-only changes. Remove unused variable. Fix comment style.] Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2012-03-20platform-drivers-x86: convert drivers/platform/x86/* to use ↵Axel Lin
module_platform_driver() This patch converts the drivers in drivers/platform/x86/* to use the module_platform_driver() macro which makes the code smaller and a bit simpler. Cc: Hong Liu <hong.liu@intel.com> Cc: Durgadoss R <durgadoss.r@intel.com> Cc: Daniel Drake <dsd@laptop.org> Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-05-27platform/x86: Simplify intel_mid_powerbtnAmeya Palande
This patch: 1. Removes unnecessay #defines 2. Removes 'mfld_pb_priv' data structure which results in simpler error handling and less memory allocations. Signed-off-by: Ameya Palande <2ameya@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
2011-03-28intel_mid_powerbtn: add power button driver for Medfield platform (#3)Hong Liu
The power button is connected to MSIC on Medfield, we will get two interrupts from IOAPIC when pressing or releasing the power button. Signed-off-by: Hong Liu <hong.liu@intel.com> [Minor fixes as noted by Dmitry] Signed-off-by: Alan Cox <alan@linux.intel.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Matthew Garrett <mjg@redhat.com>