summaryrefslogtreecommitdiff
path: root/drivers/mfd/twl6030-irq.c
AgeCommit message (Collapse)AuthorFilesLines
2018-05-16mfd: twl6030-irq: Delete an error message for a failed memory allocation in ↵Markus Elfring1-3/+1
twl6030_init_irq() Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-09-04mfd: twl: Move header file out of I2C realmWolfram Sang1-1/+1
include/linux/i2c is not for client devices. Move the header file to a more appropriate location. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Mark Brown <broonie@kernel.org> Acked-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Acked-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Kishon Vijay Abraham I <kishon@ti.com> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Acked-by: Thierry Reding <thierry.reding@gmail.com> Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Daniel Thompson <daniel.thompson@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-08-11mfd: Use irq_desc_get_xxx() to avoid redundant lookup of irq_descJiang Liu1-1/+1
Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc while we already have a pointer to corresponding irq_desc. Do the same change to avoid the pattern "irq_get_chip_data(data->irq)". Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-08-11mfd: Kill off set_irq_flags usageRob Herring1-13/+0
set_irq_flags is ARM specific with custom flags which have genirq equivalents. Convert drivers to use the genirq interfaces directly, so we can kill off set_irq_flags. The translation of flags is as follows: IRQF_VALID -> !IRQ_NOREQUEST IRQF_PROBE -> !IRQ_NOPROBE IRQF_NOAUTOEN -> IRQ_NOAUTOEN For IRQs managed by an irqdomain, the irqdomain core code handles clearing and setting IRQ_NOREQUEST already, so there is no need to do this in .map() functions and we can simply remove the set_irq_flags calls. Some users also modify IRQ_NOPROBE and this has been maintained although it is not clear that is really needed. There appears to be a great deal of blind copy and paste of this code. Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-06-22mfd: Constify regmap and irq configuration dataKrzysztof Kozlowski1-1/+1
Constify in various drivers configuration data which is not modified: - regmap_irq_chip, - individual regmap_irq's in array, - regmap_config, - irq_domain_ops, Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-07-25mfd: twl6030-irq: Extinguish coding style warningsLee Jones1-1/+3
This is part of an effort to clean-up the MFD subsystem. WARNING: please, no space before tabs +^IRSV_INTR_OFFSET, ^I/* Bit 12^IReserved^I^I*/$ WARNING: Missing a blank line after declarations + u8 unmask_value; + ret = twl_i2c_read_u8(TWL_MODULE_PIH, &unmask_value, WARNING: Missing a blank line after declarations + u8 mask_value; + ret = twl_i2c_read_u8(TWL_MODULE_PIH, &mask_value, total: 0 errors, 3 warnings, 484 lines checked Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: Delete non-required instances of include <linux/init.h>Paul Gortmaker1-1/+0
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: twl6030: Fix endianness problem in IRQ handlerDanke Xie1-3/+5
The current TWL 6030 IRQ handler assumes little endianness. This change makes it endian-neutral. Signed-off-by: Danke Xie <d.xie@sta.samsung.com> Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-08-20mfd: twl6030-irq: Add interrupt mapping table for the twl6032Oleksandr Dmytryshyn1-1/+47
The TWL6032 PMIC has different IRQ status bits meaning. Hence, add interrupt mapping table for the twl6032. Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-08-20mfd: twl6030-irq: Create struct twl6030_irqGrygorii Strashko1-42/+59
Create "struct twl6030_irq" and place all local variables inside it. Also allocate twl6030_irq structure dynamically during initialization. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-08-20mfd: twl6030-irq: Convert to use linear irq_domainGrygorii Strashko1-50/+69
Since the TWL6030 PMIC is used with OMAP4 SoCs only and OMAP4 legacy boot is dropped there are no needs to allocate the range of IRQ descriptors during system boot to support TWL6030 IRQs. Hence, convert it to use linear irq_domain and move IRQ configuration in .map()/.unmap() callbacks of irq_domain. So, IRQ mapping and descriptors allocation will be performed dynamically basing on DT configuration. The error message will be reported in case if unmapped IRQ is received by TWL6030 (virq==0). Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-08-20mfd: twl6030-irq: Add error check when IRQs are masked initiallyGrygorii Strashko1-4/+9
Add a missed check for errors when TWL IRQs are masked initially on probe and report an error in case of failure. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-08-20mfd: twl6030-irq: Migrate to IRQ threaded handlerNaga Venkata Srikanth V1-100/+50
1) Removed request_irq() and replaced it with request_threaded_irq(). 2) Removed generic_handle_irq() and replaced it with handle_nested_irq(). Handling of these interrupts is nested, as we are handling an interrupt (for e.g rtc, mmc1) when we are still servicing TWL irq. 3) Removed I2C read-retry logic for the case when twl_i2c_read() is failed inside IRQ handler - there is no sense to do that, so just report an error and return. 4) Each nested IRQ is configured with corresponding parent_irq, which need to be retriggered in case if nested IRQ is marked as IRQS_PENDING. Signed-off-by: Naga Venkata Srikanth V <vnv.srikanth@samsung.com> Signed-off-by: Oleg_Kosheliev <oleg.kosheliev@ti.com> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-11-21mfd/rtc/gpio: twl: No need to allocate bigger buffer for writePeter Ujfalusi1-2/+2
Since the twl-core has been converted to use regmap it is no longer needed to allocate bigger buffer for data when writing to twl. CC: Grant Likely <grant.likely@secretlab.ca> CC: Alessandro Zummo <a.zummo@towertech.it> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-03-22mfd: Replace twl-* pr_ macros by the dev_ equivalent and do various cleanupsBenoit Cousson1-20/+19
Since a structure device is available now, use the dev_ macros instead of the pr_ ones. Clean some badly formatted comments. Remove some unused variables. Move some variable to the place they belong. Clean some badly wrapped lines. Align variable definition Add missing braces in if-then-else block. Add blank line for better readability. Move stuff here and there... Conflicts: drivers/mfd/twl-core.c Signed-off-by: Benoit Cousson <b-cousson@ti.com> Cc: Felipe Balbi <balbi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-03-22mfd: Move twl-core IRQ allocation into twl[4030|6030]-irq filesBenoit Cousson1-9/+22
During DT adaptation, the irq_alloc_desc was added into twl-core, but due to the rather different and weird IRQ management required by the twl4030, it is much better to have a different approach for it. The issue is that twl4030 uses a two level IRQ mechanism but handles all the PWR interrupts as part of the twl-core interrupt range. It ends up with a range of 16 interrupts total for CORE and PWR. The other twl4030 functionalities already have a dedicated driver and thus their IRQs and irqdomain can and should be defined localy. twl6030 is using a single level IRQ controller and thus does not require any trick. Move the irq_alloc_desc and irq_domain_add_legacy in twl4030-irq and twl6030-irq. Allocate together CORE and PWR IRQs for twl4030-irq. Conflicts: drivers/mfd/twl-core.c Signed-off-by: Benoit Cousson <b-cousson@ti.com> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-03-22mfd: Return twl6030_mmc_card_detect IRQ for board setupBenoit Cousson1-1/+2
Card detect IRQ from the TWL6030 used to be provided to the MMC controller code using a statically allocated IRQ scheme: card_detect_irq = TWL6030_IRQ_BASE + MMCDETECT_INTR_OFFSET; This is no longer valid in a SPARSE_IRQ context since there is no more pre-defined TWL6030_IRQ_BASE. Return the proper card detect IRQ value in the twl6030_mmc_card_detect_config that will be called from the MMC controller. Signed-off-by: Benoit Cousson <b-cousson@ti.com> Cc: Felipe Balbi <balbi@ti.com> Cc: Tony Lindgren <tony@atomide.com> Cc: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-03-06mfd: Make twl6030_irq_set_wake staticNishanth Menon1-1/+1
twl6030_irq_set_wake is not used anywhere else in the kernel except as irq_chip.irq_set_wake. No reason for it to be exported. Also fixes build warning: drivers/mfd/twl6030-irq.c:230:5: warning: symbol 'twl6030_irq_set_wake' was not declared. Should it be static? Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-03-06mfd: Clear twl6030 IRQ status register only onceNishanth Menon1-2/+11
TWL6030 family of PMIC use a shadow interrupt status register while kernel processes the current interrupt event. However, any write(0 or 1) to register INT_STS_A, INT_STS_B or INT_STS_C clears all 3 interrupt status registers. Since clear of the interrupt is done on 32k clk, depending on I2C bus speed, we could in-adverently clear the status of a interrupt status pending on shadow register in the current implementation. This is due to the fact that multi-byte i2c write operation into three seperate status register could result in multiple load and clear of status and result in lost interrupts. Instead, doing a single byte write to INT_STS_A register with 0x0 will clear all three interrupt status registers without the related risk. Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-11-22freezer: don't unnecessarily set PF_NOFREEZE explicitlyTejun Heo1-2/+0
Some drivers set PF_NOFREEZE in their kthread functions which is completely unnecessary and racy - some part of freezer code doesn't consider cases where PF_NOFREEZE is set asynchronous to freezer operations. In general, there's no reason to allow setting PF_NOFREEZE explicitly. Remove them and change the documentation to note that setting PF_NOFREEZE directly isn't allowed. -v2: Dropped change to twl4030-irq.c as it no longer uses PF_NOFREEZE. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: "Gustavo F. Padovan" <padovan@profusion.mobi> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Cc: Marcel Holtmann <marcel@holtmann.org> Cc: wwang <wei_wang@realsil.com.cn>
2011-11-07Merge branch 'modsplit-Oct31_2011' of ↵Linus Torvalds1-0/+1
git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits) Revert "tracing: Include module.h in define_trace.h" irq: don't put module.h into irq.h for tracking irqgen modules. bluetooth: macroize two small inlines to avoid module.h ip_vs.h: fix implicit use of module_get/module_put from module.h nf_conntrack.h: fix up fallout from implicit moduleparam.h presence include: replace linux/module.h with "struct module" wherever possible include: convert various register fcns to macros to avoid include chaining crypto.h: remove unused crypto_tfm_alg_modname() inline uwb.h: fix implicit use of asm/page.h for PAGE_SIZE pm_runtime.h: explicitly requires notifier.h linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h miscdevice.h: fix up implicit use of lists and types stop_machine.h: fix implicit use of smp.h for smp_processor_id of: fix implicit use of errno.h in include/linux/of.h of_platform.h: delete needless include <linux/module.h> acpi: remove module.h include from platform/aclinux.h miscdevice.h: delete unnecessary inclusion of module.h device_cgroup.h: delete needless include <linux/module.h> net: sch_generic remove redundant use of <linux/module.h> net: inet_timewait_sock doesnt need <linux/module.h> ... Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in - drivers/media/dvb/frontends/dibx000_common.c - drivers/media/video/{mt9m111.c,ov6650.c} - drivers/mfd/ab3550-core.c - include/linux/dmaengine.h
2011-11-01mfd: Add export.h for EXPORT_SYMBOL/THIS_MODULE as requiredPaul Gortmaker1-0/+1
These macros are in <linux/export.h> and will no longer be implicitly everywhere anymore. Fix it up in advance. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-24mfd: Disable twl6030 IRQ during suspendTodd Poynor1-0/+6
Module IRQs may still be disabled by DPM at the time the TWL6030 ISR runs, causing handle_simple_irq() to silently do nothing. This may result in missing TWL RTC alarm wakeups, for example, since the RTC child module ISR is not called to ack the IRQ. Disable the TWL6030 IRQ during suspend, enable it at DPM resume time, at which time the child module IRQs will be re-enabled. Signed-off-by: Todd Poynor <toddpoynor@google.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-10-24mfd: Fix twl6030 lockdep recursion warning on setting wake IRQsTodd Poynor1-2/+44
LOCKDEP explicitly sets all irq_desc locks as a single lock-class, causing "possible recursive locking detected" when the TWL RTC driver calls through enable_irq_wake to twl6030_irq_set_wake, which recursively calls irq_set_irq_wake. Although the irq_desc and lock are different, LOCKDEP treats these as equivalent, presumably due to problems that can be incurred when locking more than one irq_desc, so best to avoid this. Suspend/resume actions implemented as PM notifiers to avoid touch the TWL core for this. Signed-off-by: Todd Poynor <toddpoynor@google.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-10-24mfd: Remove IRQF_DISABLEDYong Zhang1-1/+1
This flag is a NOOP and can be removed now. Signed-off-by: Yong Zhang <yong.zhang0@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-10-24mfd: Set twl6030 irq_wake infrastructure upSantosh Shilimkar1-0/+9
TWL6030 devices have an interrupt line which is connected to application processor like OMAP. These devices support multiple features such as MMC card detect, USB cable detect, RTC interrupt, etc. that must wake up the application processor. With this change, TWL6030 client drivers can make use of irq_wake() if the wakeup is desirable on it's irq events. Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-10-24mfd: Make sure to request twl6030 IRQ before using the irq_numAxel Lin1-8/+10
I was trying to fix the error handling part because in the case of request_irq failure, it should call kthread_stop instead of free_irq. But it seems more reasonable to do request_irq before calling kthread_run. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-05-26mfd: Fix twl6030 irq definitionsGraeme Gregory1-2/+2
The charger fault IRQs from the twl will in future patches be handled by a seperate IRQ handler in the charger driver than the general charger IRQ. Give them different IRQ numbers now to allow the charger driver to be merged in the future. Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-03-31Fix common misspellingsLucas De Marchi1-2/+2
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-27mfd: Cleanup irq namespaceThomas Gleixner1-4/+4
Converted with coccinelle. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-03-27mfd: twl6030: Cleanup interrupt handlingThomas Gleixner1-16/+1
irq_desc checking in the interrupt demux routine is totally pointless. The driver sets those lines up, so that cant go away magically. Remove the open coded handler magic and use the proper accessor. This driver needs to be converted to threaded interrupts and buslock. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2011-01-14mfd: twl6030 irq_data conversion.Lennert Buytenhek1-1/+1
Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-12-10mfd: TWL6030: USBOTG VBUS event generation onHema HK1-1/+8
With TWL6030-usb, VBUS SESS_VLD and SESS_END events are not generated as expected. When these interrupts are enabled, charger VBUS detection interrupt does not get generated. So USBOTG has to be dependent on charger VBUS interrupts. So added one bit for USBOTG and changed the handler to call the USBOTG handler whenever there is a charger VBUS interrpt. VBUS SESS_VLD and SESS_END event generation issue is under debug with HW team. This fix might not be required once after fixing the issue. Signed-off-by: Balaji TK <balajitk@ti.com> Signed-off-by: Hema HK <hemahk@ti.com> Cc: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2010-10-29mfd: Fix twl-irq function declaration warningsG, Manjunath Kondaiah1-0/+2
Fixes following sparse warnings for twl4030 and twl6030 irq files. drivers/mfd/twl4030-irq.c:783:5: warning: symbol 'twl4030_init_irq' was not declared. Should it be static? drivers/mfd/twl4030-irq.c:863:5: warning: symbol 'twl4030_exit_irq' was not declared. Should it be static? drivers/mfd/twl4030-irq.c:873:5: warning: symbol 'twl4030_init_chip_irq' was not declared. Should it be static? drivers/mfd/twl6030-irq.c:226:5: warning: symbol 'twl6030_init_irq' was not declared. Should it be static? drivers/mfd/twl6030-irq.c:290:5: warning: symbol 'twl6030_exit_irq' was not declared. Should it be static? Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com> Cc: linux-arm-kernel@lists.infradead.org Cc: Tony Lindgren <tony@atomide.com> Cc: Nishanth Menon <nm@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-10-29mfd: Adding twl6030 mmc card detect support for MMC1kishore kadiyala1-0/+73
Adding card detect callback function and card detect configuration function for MMC1 Controller on OMAP4. Card detect configuration function does initial configuration of the MMC Control & PullUp-PullDown registers of Phoenix. For MMC1 Controller, card detect interrupt source is twl6030 which is non-gpio. The card detect call back function provides card present/absent status by reading MMC Control register present on twl6030. Since OMAP4 doesn't use any GPIO line as used in OMAP3 for card detect, the suspend/resume initialization which was done in omap_hsmmc_gpio_init previously is moved to the probe thus making it generic for both OMAP3 & OMAP4. Cc: Tony Lindgren <tony@atomide.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Madhusudhan Chikkature <madhu.cr@ti.com> Cc: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2009-12-14mfd: Add support for twl6030 irq frameworkBalaji T K1-0/+299
This patch adds support for phoenix interrupt framework. New iInterrupt status register A, B, C are introduced in Phoenix and are cleared on write. Due to the differences in interrupt handling with respect to TWL4030, twl6030-irq.c is created for TWL6030 PMIC Signed-off-by: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Balaji T K <balajitk@ti.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Reviewed-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>