aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/platform/intel/iosf_mbi.c
AgeCommit message (Collapse)AuthorFilesLines
2017-11-10x86/platform/intel/iosf_mbi: Add unlocked PMIC bus access notifier unregisterHans de Goede1-2/+17
For race free unregistration drivers may need to acquire PMIC bus access through iosf_mbi_punit_acquire() and then (un)register the notifier without dropping the lock. This commit adds an unlocked variant of iosf_mbi_unregister_pmic_bus_access_notifier for this use case. Acked-by: Ingo Molnar <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2017-03-02x86/platform/intel/iosf_mbi: Add a PMIC bus access notifierHans de Goede1-0/+36
Some drivers may need to acquire P-Unit managed resources from interrupt context, where they cannot call iosf_mbi_punit_acquire(). This commit adds a notifier chain which allows a driver to get notified (in a process context) before other drivers start accessing the PMIC bus, so that the driver can acquire any resources, which it may need during the window the other driver is accessing the PMIC, before hand. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=155241 Signed-off-by: Hans de Goede <[email protected]> Tested-by: tagorereddy <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2017-02-26x86/platform/intel/iosf_mbi: Add a mutex for P-Unit accessHans de Goede1-0/+13
One some systems the P-Unit accesses the PMIC to change various voltages through the same bus as other kernel drivers use for e.g. battery monitoring. If a driver sends requests to the P-Unit which require the P-Unit to access the PMIC bus while another driver is also accessing the PMIC bus various bad things happen. This commit adds a mutex to protect the P-Unit against simultaneous accesses and 2 functions to lock / unlock this mutex. Note on these systems the i2c-bus driver will request a sempahore from the P-Unit for exclusive access to the PMIC bus when i2c drivers are accessing it, but this does not appear to be sufficient, we still need to avoid making certain P-Unit requests during the access window to avoid problems. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=155241 Signed-off-by: Hans de Goede <[email protected]> Tested-by: tagorereddy <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
2015-07-16x86/platform/iosf_mbi: Add Intel Tangier PCI idAndy Shevchenko1-0/+2
Intel Tangier has an IOSF Mailbox with PCI ID 8086:1170. Signed-off-by: Andy Shevchenko <[email protected]> Cc: David E . Box <[email protected]> Link: http://lkml.kernel.org/r/1436366709-17683-6-git-send-email-andriy.shevchenko@linux.intel.com Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-16x86/platform/iosf_mbi: Source cleanupAndy Shevchenko1-5/+4
- Move the static variables to one place - Fix indentations in the header - Correct comments No functional change. [ tglx: Massaged changelog ] Signed-off-by: Andy Shevchenko <[email protected]> Cc: David E . Box <[email protected]> Link: http://lkml.kernel.org/r/1436366709-17683-5-git-send-email-andriy.shevchenko@linux.intel.com Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-16x86/platform/iosf_mbi: Remove NULL pointer checks for pci_dev_put()Andy Shevchenko1-4/+2
pci_dev_put() has already a check for NULL pointer. [ tglx: Massaged changelog ] Signed-off-by: Andy Shevchenko <[email protected]> Cc: David E . Box <[email protected]> Link: http://lkml.kernel.org/r/1436366709-17683-4-git-send-email-andriy.shevchenko@linux.intel.com Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-16x86/platform/iosf_mbi: Check return value of debugfs_create properlyAndy Shevchenko1-5/+5
The code checks the result of the first debugfs_create call several times and fails to check the result of the subsequent calls due to missing assigments. Add the missing assignments and check only for !res because debugfs_create() returns only NULL on error and not an encoded error code. [ tglx: Massaged changelog ] Signed-off-by: Andy Shevchenko <[email protected]> Cc: David E . Box <[email protected]> Link: http://lkml.kernel.org/r/1436366709-17683-3-git-send-email-andriy.shevchenko@linux.intel.com Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-16x86/platform/iosf_mbi: Move to dedicated folderAndy Shevchenko1-0/+328
Move the driver to arch/x86/platform/intel since it is not a core kernel code and it is related to many Intel SoCs from different groups: Atom, MID, etc. There is no functional change. Signed-off-by: Andy Shevchenko <[email protected]> Cc: David E . Box <[email protected]> Link: http://lkml.kernel.org/r/1436366709-17683-2-git-send-email-andriy.shevchenko@linux.intel.com Signed-off-by: Thomas Gleixner <[email protected]>