summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/twl6040-core.c
Commit message (Collapse)AuthorAgeFilesLines
* mfd: twl6040: Rename the core driverPeter Ujfalusi2012-11-131-749/+0
| | | | | | | | After the regmap_irq conversion there is no need to call the driver as twl6040-core.c since there is only one c file remained. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: twl6040: Convert to use regmap_irqPeter Ujfalusi2012-11-131-15/+40
| | | | | | | | | With regmap_irq it is possible to remove the twl6040-irq.c file and simplify the code. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: twl6040: Correct Ready and Thermal interrupt handlingPeter Ujfalusi2012-11-131-21/+31
| | | | | | | | | | Create new irq handler for thermal events in order to be able to handle the event and clean up the code regarding to interrupt handling: Use proper function names for the irq handlers No need to read the INTD register anymore. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: twl6040: Restructure power up and down codePeter Ujfalusi2012-11-131-20/+18
| | | | | | | Rearrange the code path for power up and down sequence. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: twl6040: Remove unused parameter for twl6040_power_up_completion()Peter Ujfalusi2012-11-131-4/+2
| | | | | | | naudint parameter has not been used, remove it. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: twl6040: Fix typo for power on failurePeter Ujfalusi2012-11-131-1/+1
| | | | | | | | Fix old copy paste bug: automatic power-down failed -> automatic power-up failed Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: twl6040: Add twl6040-gpio childPeter Ujfalusi2012-09-191-0/+15
| | | | | | | | | | Add needed platform data structure and code to be able to load the GPO child of twl6040. Update the devicetree binding documentation at the same time. Signed-off-by: Sergio Aguirre <saaguirre@ti.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Use IRQF_ONESHOT for twl6040Fengguang Wu2012-09-191-1/+1
| | | | | | | | | | | Generated by: scripts/coccinelle/misc/irqf_oneshot.cocci Make sure threaded IRQs without a primary handler are always request with IRQF_ONESHOT. Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: core: Push irqdomain mapping out into devicesMark Brown2012-09-141-1/+1
| | | | | | | | | | | | | | | | | | | | | Currently the MFD core supports remapping MFD cell interrupts using an irqdomain but only if the MFD is being instantiated using device tree and only if the device tree bindings use the pattern of registering IPs in the device tree with compatible properties. This will be actively harmful for drivers which support non-DT platforms and use this pattern for their DT bindings as it will mean that the core will silently change remapping behaviour and it is also limiting for drivers which don't do DT with this particular pattern. There is also a potential fragility if there are interrupts not associated with MFD cells and all the cells are omitted from the device tree for some reason. Instead change the code to take an IRQ domain as an optional argument, allowing drivers to take the decision about the parent domain for their interrupts. The one current user of this feature is ab8500-core, it has the domain lookup pushed out into the driver. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Add support for twl6041Peter Ujfalusi2012-07-251-0/+1
| | | | | | | | The delta between twl6040 and twl6041 is small, the main difference is in the number of GPOs (3 on twl6040, 1 on twl6041). Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Remove unneeded io_mutex from struct twl6040Axel Lin2012-07-161-20/+3
| | | | | | | | | Current code has been converted to use regmap APIs, the io_mutex is not needed. Thus remove the io_mutex. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Fix twl6040 build failureSamuel Ortiz2012-05-231-1/+15
| | | | | | | | | | | Without it we get: CC drivers/mfd/twl6040-core.o drivers/mfd/twl6040-core.c: In function ‘twl6040_has_vibra’: drivers/mfd/twl6040-core.c:55:2: error: implicit declaration of function ‘of_find_node_by_name’ [-Werror=implicit-function-declaration] Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Add support for Device Tree to twl6040Peter Ujfalusi2012-05-201-8/+19
| | | | | | | | | | Device tree based probing support for the core twl6040 driver. Child devices will be created as MFD devices: - ASoC codec is always created - Vibra child is only created if the vibra section present in the DT blob. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Register the twl6040 child for the ASoC codec unconditionallyPeter Ujfalusi2012-05-201-20/+19
| | | | | | | | | The main function of the twl6040 is to provide audio on OMAP4+ platforms. Since the ASoC codec driver can work without the pdata we can register the child to load the codec driver whenever the twl6040 MFD driver is loaded. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Allocate twl6040 IRQ numbers dynamicallyPeter Ujfalusi2012-05-201-2/+1
| | | | | | | | | | | | Use irq_alloc_descs() to get the IRQ number range dynamically instead of the hardwired use if pdata->irq_base. The twl6040 only provides interrupts for it's internal components which means that it is not working as an IRQ expander type of device. The client drivers will receive their interrupt numbers as resource which is configured based on the received IRQ range we got from irq_alloc_descs() Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Add regulator support for twl6040 VIO, V2V1 suppliesPeter Ujfalusi2012-05-091-4/+29
| | | | | | | | | | | | twl6040 has three power supply source: VBAT needs to be connected to VBAT, VIO, and V2V1. Add regulator support for the VIO, V2V1 supplies. Initially handle the two supply together with bulk commands. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Convert twl6040-core to devm_regmap_init_i2c()Axel Lin2012-05-091-3/+1
| | | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Convert twl6040 to i2c driver, and separate it from twl corePeter Ujfalusi2012-04-161-46/+68
| | | | | | | | | | | | | | Complete the separation of the twl6040 from the twl core since it is a separate chip, not part of the twl6030 PMIC. Make the needed Kconfig changes for the depending drivers at the same time to avoid breaking the kernel build (vibra, ASoC components). Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: Mark Brown <broonie@opensource.wolfsonicro.com> Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Avoid twl6040-codec PLL reconfiguration when not neededPeter Ujfalusi2012-02-031-51/+74
| | | | | | | | | | | Do not reconfigure the PLL in case it has been configured already with the requested parameters. In case of different PLL configuration do only the needed changes. This can save considerable amount of time since we can avoid the defined protocol (with delays) for the PLL configuration. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Store twl6040-codec mclk configurationPeter Ujfalusi2012-02-031-0/+3
| | | | | | | Store the last used mclk configuration for the PLL. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Use gpio_request_one from twl6040-coreAxel Lin2012-01-091-5/+2
| | | | | | | Use gpio_request_one() instead of multiple gpiolib calls. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Convert MFD drivers to use module_platform_driverMark Brown2012-01-091-12/+1
| | | | | | | | | Factors out some boilerplate code for drivers doing the default thing for platform driver registration. Drivers using platform_driver_probe or an initcall other than module_init can't be converted. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* MFD: twl6040: function to query the vibra status for clientsPeter Ujfalusi2011-10-121-0/+12
| | | | | | | | | | | | If the client only interested, if any of the vibra channels enabled, or if any of the channels are set to receive audio data via PDM. This function targets mainly the vibra driver, so it can check if it is allowed to execute effects ot not. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Samuel Ortiz <samuel.ortiz@intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* MFD: twl6040: Cache the vibra control registersPeter Ujfalusi2011-10-121-4/+15
| | | | | | | | | | | The vibra control register will be used from the ASoC codec driver as well. In order to avoid latency issues caused by I2C read access, cache the two control register within the core driver, so we do not need to reach out to the chip to read it back. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Samuel Ortiz <samuel.ortiz@intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* MFD: twl6040: Fix power on GPIO handlingPeter Ujfalusi2011-09-191-5/+6
| | | | | | | | | | | | | | | Avoid requesting the audpwron gpio in case of ES1.0 revision. In the past we requested the gpio, but we did not free it up, since we made the check for the revision later. This results later checks for gpio validity to fail, leaving the gpio reserved (even after the driver has been removed). Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* MFD: twl6040: Add accessor for revision IDPeter Ujfalusi2011-09-191-1/+1
| | | | | | | | | For client driver to use, if they need chip resvision information. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* MFD: twl6040: Remove global pointer for platform_devicePeter Ujfalusi2011-09-191-16/+11
| | | | | | | | | | | There is no need to keep global pointer for the platform device, since it is only used for dev_* prints, and the device pointer available within the twl6040 structure. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* MFD: twl6040: Remove enum for PLL trackingPeter Ujfalusi2011-07-071-13/+13
| | | | | | | | | There is no need to have two different types for tracking the selected PLL. Use only the defines, when dealing with the PLLs. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
* MFD: twl6040: Remove wrapper for threaded irq requestPeter Ujfalusi2011-07-071-5/+5
| | | | | | | | | | Remove the twl6040_request_irq/free_irq inline functions, and use direct calls instead in the core driver to register the threaded irq. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: Felipe Balbi <balbi@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
* MFD: twl6040: Demand valid interrupt configurationPeter Ujfalusi2011-07-071-21/+21
| | | | | | | | | | | | In order to operate correctly twl6040 needs correct interrupt configuration. The slave drivers (vibra, and ASoC codec) will refuse to probe, if the interrupt configuration is not correct. In this way some checks can be removed from the code. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: Felipe Balbi <balbi@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
* MFD: twl6040: Use resource to provide irq number for slavesPeter Ujfalusi2011-07-071-0/+25
| | | | | | | | | | | | Provide the irq number for slaves via resource on the platform device. The irq number configuration is done in the twl6040-core at probe time, so machine drivers do not need to be modified. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: Felipe Balbi <balbi@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
* MFD: twl6040: Change platform data for soc codec driverPeter Ujfalusi2011-07-041-3/+2
| | | | | | | | Pass twl4030_codec_data instead of the twl4030_audio_data for the ASoC codec driver. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: twl6040: Add initial supportMisael Lopez Cruz2011-07-041-0/+596
TWL6040 IC provides analog high-end audio codec functions for handset applications. It contains several audio analog inputs and outputs as well as vibrator support. It's connected to the host processor via PDM interface for audio data communication. The audio modules are controlled by internal registers that can be accessed by I2C and PDM interface. TWL6040 MFD will be registered as a child of TWL-CORE, and will have two children of its own: twl6040-codec and twl6040-vibra. This driver is based on TWL4030 and WM8350 MFD drivers. Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
OpenPOWER on IntegriCloud