summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/twl4030-core.c
Commit message (Collapse)AuthorAgeFilesLines
* mfd: Rename twl4030* driver files to enable re-useSantosh Shilimkar2009-12-131-929/+0
| | | | | | | | | | | | | | | The upcoming TWL6030 is companion chip for OMAP4 like the current TWL4030 for OMAP3. The common modules like RTC, Regulator creates opportunity to re-use the most of the code from twl4030. This patch renames few common drivers twl4030* files to twl* to enable the code re-use. 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> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Clarify twl4030 return value for read and writeAmit Kucheria2009-12-131-8/+22
| | | | | | | | | | We should be checking if all the messages were tranferred. If not, then we should propagate the i2c core error code or EIO. Currently we return success (0) even if none of messages were transferred successfully. Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Add all twl4030 regulators to the twl4030 mfd driverJuha Keski-Saari2009-12-131-2/+24
| | | | | | | | | Add all twl4030 regulators to the twl4030 mfd driver and twl4030_platform_data Signed-off-by: Juha Keski-Saari <ext-juha.1.keski-saari@nokia.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Initial support for twl5031Ilkka Koskinen2009-12-131-1/+12
| | | | | | | | | TWL5031 introduces two new interrupts in PIH. Moreover, BCI has changed remarkably and, thus, it's disabled when TWL5031 is in use. Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Enable twl4030 32kHz oscillator low-power modeIlkka Koskinen2009-12-131-2/+7
| | | | | | | | Allows TWL's 32kHz oscillator to go in low-power mode when main battery voltage is running low. Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Don't abuse i2c_client.nameJean Delvare2009-12-131-2/+0
| | | | | | | | The name field of struct i2c_client is for i2c-core's use, it should never be changed by the drivers themselves. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* Merge branch 'omap-for-linus' of ↵Linus Torvalds2009-12-081-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 * 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: (149 commits) arm: omap: Add omap3_defconfig AM35xx: Defconfig for AM3517 EVM board AM35xx: Add support for AM3517 EVM board omap: 3630sdp: defconfig creation omap: 3630sdp: introduce 3630 sdp board support omap3: Add defconfig for IGEP v2 board omap3: Add minimal IGEP v2 support omap3: Add CompuLab CM-T35 defconfig omap3: Add CompuLab CM-T35 board support omap3: rx51: Add wl1251 wlan driver support omap3: rx51: Add SDRAM init omap1: Add default kernel configuration for Herald omap1: Add board support and LCD for HTC Herald omap: zoom2: update defconfig for LL_DEBUG_NONE omap: zoom3: defconfig creation omap3: zoom: Introduce zoom3 board support omap3: zoom: Drop i2c-1 speed to 2400 omap3: zoom: rename zoom2 name to generic zoom omap3: zoom: split board file for software reuse omap3evm: MIgrate to smsc911x ethernet driver ... Fix trivial conflict (two unrelated config options added next to each other) in arch/arm/mach-omap2/Makefile
| * MFD: twl4030: add twl4030_codec MFD as a new child to the corePeter Ujfalusi2009-11-221-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New MFD child to twl4030 MFD device. Reason for the twl4030_codec MFD: the vibra control is actually in the codec part of the twl4030. If both the vibra and the audio functionality is needed from the twl4030 at the same time, than they need to control the codec power and APLL at the same time without breaking the other driver. Also these two has to be able to work without the need for the other driver. This MFD device will be used by the drivers, which needs resources from the twl4030 codec like audio and vibra. The platform specific configuration data is passed along to the child drivers (audio, vibra). Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * Merge branch '7xx-iosplit-plat' with omap-fixesTony Lindgren2009-11-101-1/+1
| |\
| | * omap: headers: Move remaining headers from include/mach to include/platTony Lindgren2009-10-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the remaining headers under plat-omap/include/mach to plat-omap/include/plat. Also search and replace the files using these headers to include using the right path. This was done with: #!/bin/bash mach_dir_old="arch/arm/plat-omap/include/mach" plat_dir_new="arch/arm/plat-omap/include/plat" headers=$(cd $mach_dir_old && ls *.h) omap_dirs="arch/arm/*omap*/ \ drivers/video/omap \ sound/soc/omap" other_files="drivers/leds/leds-ams-delta.c \ drivers/mfd/menelaus.c \ drivers/mfd/twl4030-core.c \ drivers/mtd/nand/ams-delta.c" for header in $headers; do old="#include <mach\/$header" new="#include <plat\/$header" for dir in $omap_dirs; do find $dir -type f -name \*.[chS] | \ xargs sed -i "s/$old/$new/" done find drivers/ -type f -name \*omap*.[chS] | \ xargs sed -i "s/$old/$new/" for file in $other_files; do sed -i "s/$old/$new/" $file done done for header in $(ls $mach_dir_old/*.h); do git mv $header $plat_dir_new/ done Signed-off-by: Tony Lindgren <tony@atomide.com>
* | | Merge branch 'twl4030-mfd' into for-2.6.33Mark Brown2009-11-251-1/+1
|\ \ \
| * | | mfd: twl4030: fix ELF section mismatch...Daniel J Blueman2009-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since twl4030_probe is only called from functions in the init ELF section, annotate it so. Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | | | Merge branch 'for-2.6.32' into for-2.6.33Mark Brown2009-11-061-44/+47
|\ \ \ \ | |/ / / |/| / / | |/ /
| * | mfd: Do not dereference null pointer in twl4030 error pathIlkka Koskinen2009-10-271-1/+1
| |/ | | | | | | | | | | | | | | We are mistakenly dereferencing twl->client in the twl->client null checking path. Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
| * mfd: Fix twl4030 boot with twl4030 usb transceiver enabledRoger Quadros2009-10-121-43/+46
| | | | | | | | | | | | | | | | | | | | | | | | The usb regulator supplies (usb1v5, usb1v8 & usb3v1) must be available before adding the twl4030_usb child, else twl4030_usb_ldo_init() will always fail thus causing boot lock-up. This patch fixes boot on OMAP systems using the twl4030 usb transceiver. CONFIG_TWL4030_USB=y Signed-off-by: Roger Quadros <ext-roger.quadros@nokia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | MFD: twl4030: add twl4030_codec MFD as a new child to the corePeter Ujfalusi2009-10-251-0/+14
|/ | | | | | | | | | | | | | | | | | | | New MFD child to twl4030 MFD device. Reason for the twl4030_codec MFD: the vibra control is actually in the codec part of the twl4030. If both the vibra and the audio functionality is needed from the twl4030 at the same time, than they need to control the codec power and APLL at the same time without breaking the other driver. Also these two has to be able to work without the need for the other driver. This MFD device will be used by the drivers, which needs resources from the twl4030 codec like audio and vibra. The platform specific configuration data is passed along to the child drivers (audio, vibra). Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* mfd: Add support for TWL4030/5030 dynamic power switchingAmit Kucheria2009-09-171-0/+10
| | | | | | | | | | | | | The TWL4030/5030 family of multifunction devices allows board-specific control of the the various regulators, clock and reset lines through 'scripts' that are loaded into its memory. This allows for Dynamic Power Switching (DPS). Implement board-independent core support for DPS that is then used by board-specific code to load custom DPS scripts. Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Add twl4030-pwrbutton as a twl4030 childFelipe Balbi2009-09-171-0/+13
| | | | | | | | | Make that twl4030-pwrbutton.c driver probe with current child creation api for twl4030. Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* [WATCHDOG] twl4030 watchdog driverTimo Kokkonen2009-06-201-0/+12
| | | | | | | | | Implementation of twl4030 watchdog driver. Signed-off-by: Timo Kokkonen <timo.t.kokkonen@nokia.com> Signed-off-by: Atal Shargorodsky <ext-atal.shargorodsky@nokia.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* mfd: Mark clocks_init as non-init in twl4030-core.cRakib Mullick2009-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | Impact: Fix section mismatch. clocks_init() has been called from twl4030_probe() which is a non-init function. Since probing can be done anytime so clocks_init will be called anytime too. So we mark clock_init() as non-init. LD drivers/mfd/built-in.o WARNING: drivers/mfd/built-in.o(.text+0x8dd9): Section mismatch in reference from the function twl4030_probe() to the function .init.text:clocks_init() The function twl4030_probe() references the function __init clocks_init(). This is often because twl4030_probe lacks a __init annotation or the annotation of clocks_init is wrong. Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* twl4030-regulator: expose VPLL2David Brownell2009-03-311-2/+0
| | | | | | | | | | Add VPLL2 to the set of twl4030-family regulators exposed for use by various drivers. It's commonly used to power the digital video outputs (e.g. LCD or DVI displays) on OMAP3 systems. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
* mfd: Fix TWL4030 build on some ARM variantsMark Brown2009-02-171-1/+1
| | | | | | | | | | Many ARM platforms do not provide a mach/cpu.h so rather than guarding the use of that header with CONFIG_ARM guard it with the guards used when testing for the OMAP variants in the body of the code. Signed-off-by: Mark Brown <broonie@sirena.org.uk> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
* Merge master.kernel.org:/home/rmk/linux-2.6-armLinus Torvalds2009-01-131-4/+4
|\ | | | | | | | | | | | | | | | | | | * master.kernel.org:/home/rmk/linux-2.6-arm: TWL4030: fix clk API usage [ARM] 5364/1: allow flush_ioremap_region() to be used from modules [ARM] w90x900: fix build errors and warnings [ARM] i.MX add missing include [ARM] i.MX: fix breakage from commit 278892736e99330195c8ae5861bcd9d791bbf19e [ARM] i.MX: remove LCDC controller register definitions from imx-regs.h
| * TWL4030: fix clk API usageRussell King2009-01-131-4/+4
| | | | | | | | | | | | | | | | Always pass a struct device if one is available; and there's really no reason for the processor specific stuff in this file if only people would follow the API usage properly by using the struct device. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
* | mfd: Fix twl4030-core buildSamuel Ortiz2009-01-111-0/+3
|/ | | | | | | | | | | Fixes: drivers/mfd/twl4030-core.c:657: error: implicit declaration of function 'cpu_is_omap2430' Not the nicest fix, but this should be improved by a better OMAP clock API implementation. Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
* mfd: Fix twl4030-core.c build errorSamuel Ortiz2009-01-041-6/+13
| | | | | | | | | | | This is a fix for: twl4030-core.c:(.text+0x16a797): undefined reference to `clk_get_rate' twl4030-core.c:(.text+0x16a797): undefined reference to `clk_put' on x86 and x86_64, as the clock API is not defined on those platforms. Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
* mfd: twl4030 regulator bug fixesDavid Brownell2009-01-041-10/+1
| | | | | | | | | | | | | | This contains two bugfixes to the initial twl4030 regulator support patch related to USB: (a) always overwrite the old list of consumers ... else the regulator handles all use the same "usb1v5" name; (b) don't set up the "usbcp" regulator, which turns out to be managed through separate controls, usually ULPI directly from the OTG controller. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
* mfd: twl4030: create some regulator devicesDavid Brownell2009-01-041-10/+164
| | | | | | | | | | | | | | | | | | | | | | | | | Initial code to create twl4030 voltage regulator devices, using the new regulator framework. Note that this now starts to care what name is used to declare the TWL chip: - TWL4030 is the "old" chip; newer ones have a bigger variety of VAUX2 voltages. - TWL5030 is the core "new" chip; TPS65950 is its catalog version. - The TPS65930 and TPS65920 are cost-reduced catalog versions of TWL5030 parts ... fewer regulators, no battery charger, etc. Board-specific regulator configuration should be provided, listing which regulators are used and their constraints (e.g. 1.8V only). Code that could ("should"?) leverage the regulator stuff includes TWL4030 USB transceiver support and MMC glue, LCD support for the 3430SDP and Labrador boards, and S-Video output. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
* mfd: twl4030: simplified child creation codeDavid Brownell2009-01-041-216/+84
| | | | | | | | | | | | | | | Minor cleanup to twl4030-core: define a helper function to populate a single child node, and use it to replace six inconsistent versions of the same logic. Both object and source code shrink. As part of this, some devices now have more IRQ resources: battery charger, keypad, ADC, and USB transceiver. That helps to remove some irq #defines that block the children's drivers code from compiling on non-OMAP platforms. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
* mfd: allow reading entire register banks on twl4030David Brownell2009-01-041-2/+2
| | | | | | | | | Minor change to the TWL4030 utility interface: support reads of all 256 bytes in each register bank (vs just 255). This can help when debugging, but is otherwise a NOP. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
* mfd: twl4030 IRQ handling updateDavid Brownell2008-10-221-404/+17
| | | | | | | | | | | | | | | | | | | | | - Move it into a separate file; clean and streamline it - Restructure the init code for reuse during secondary dispatch - Support both levels (primary, secondary) of IRQ dispatch - Use a workqueue for irq mask/unmask and trigger configuration Code for two subchips currently share that secondary handler code. One is the power subchip; its IRQs are now handled by this core, courtesy of this patch. The other is the GPIO module, which will be supported through a later patch. There are also minor changes to the header file, mostly related to GPIO support; nothing yet in mainline cares about those. A few references to OMAP-specific symbols are disabled; when they can all be removed, the TWL4030 support ceases being OMAP-specific. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
* mfd: twl4030-core irq simplificationDavid Brownell2008-10-191-66/+2
| | | | | | | | | | | | | | | | | | | | | Simplify twl4030 IRQ handling by removing a needless custom flow handler. The top level IRQs, from the PIH, are well suited for handle_simple_irq() ... they can't be acked or masked. Switching resolves some issues with how IRQs were dispatched. Notably, abuse of desc->status, IRQ accounting, and handling of various faults. In short, use standard genirq code. Drivers that request_irq() to the PIH will need to pay more attention to things like setting IRQF_DISABLED (since it's no longer ignored), and making I2C calls from handlers (you'll need a lockdep workaround). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
* mfd: TWL4030 core driverDavid Brownell2008-10-191-0/+1257
This patch adds the core of the TWL4030 driver, which supports chips including the TPS65950. These chips are multi-function; see http://focus.ti.com/docs/prod/folders/print/tps65950.html Public specs are in the works. For now, the block diagram on the second page of the datasheet is fairly informative. There are some known issues with this core code. Most notably, the IRQ dispatching needs simplification (to use more of genirq), generalization (integrating support for secondary IRQ dispatch as well as primary, and removing the build dependency on OMAP), and then probably updating to leverage threaded IRQ support (expected to arrive in mainline "soon"). Once the core is in mainline, drivers for other parts of this chip can follow its lead and start swimming upstream too. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
OpenPOWER on IntegriCloud