aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/twl6040.c
AgeCommit message (Collapse)Author
2014-09-26mfd: twl6040: Fix error return codeJulia Lawall
Convert a zero return value on error to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-07-22mfd: twl6040: Fix 'insert space after ','', errorLee Jones
This is part of an effort to clean-up the MFD subsystem. ERROR: space required after that ',' (ctx:VxO) + 0, &twl6040_irq_chip,&twl6040->irq_data); ^ ERROR: space required before that '&' (ctx:OxV) + 0, &twl6040_irq_chip,&twl6040->irq_data); ^ total: 2 errors, 0 warnings, 816 lines checked Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-06-03mfd: twl6040: Correct HPPLL configuration for 19.2 and 38.4 MHz mclkPeter Ujfalusi
When the MCLK is 19.2 or 38.4 MHz the HPPLL need to be enabled and can be put in bypass mode. This will fix HPPLL use on boards with 19.2MHz mclk. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-06-03mfd: twl6040: Move register patching earlier in probePeter Ujfalusi
Make sure that we patch the ACCCTL register as the first thing when the driver loads, thus configuring I2C fast mode and i2c access for dual access registers. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-06-03mfd: twl6040: Optional clk32k clock handlingPeter Ujfalusi
In certain boards the source for the clk32k clock can be gated. In these boards the clk32k clock can be provided to the driver and it is going to be enabled/disabled when it is needed. If the clk32k clock is not provided the driver will assume that it is always running. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-06-03mfd: twl6040: Select i2c fast mode as default with regmap patchPeter Ujfalusi
All boards using twl6040 configures the i2c bus to 400KHz. While twl6040's defaults to normal mode (100KHz). So far twl6040 has no problem with i2c communication in this configuration it is safer to select fast i2c mode. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-06-03mfd: twl6040: Clear the interrupt ID register before requesting IRQPeter Ujfalusi
If for some reason the boot loader enabled the audpwron GPIO we will have pending IRQs to be handled. This seams to break twl6040 for some reason leading to non working i2c communication (i2c timeouts). Clearing the INTID register after we requested the audpwron GPIO (and set it to low) will ensure that the chip will operate normally in this case as well. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: twl6040: Check for error when reading revision registerFlorian Vaussard
We may have an error when reading the revision register, so check for the returned value. Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-03-19mfd: twl6040: Remove duplicate register writeFlorian Vaussard
When probing, regmap_register_patch() will bypass the cache and perform i2c writes for the given patches. It is thus unnecessary to manually set the TWL6040_REG_ACCCTL register just before, as it will be done when registering the twl6040_patch. Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-01-21mfd: twl6040: Fix sparse non static symbol warningWei Yongjun
Fixes the following sparse warning: drivers/mfd/twl6040.c:89:20: warning: symbol 'twl6040_patch' was not declared. Should it be static? Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-12-19mfd: twl6040: reg_defaults support for regmapPeter Ujfalusi
Add reg_defaults to regmap and at the same time implement proper power state handling with using regcache_cache_only(), regcache_sync() and regcache_mark_dirty(). This will make sure that we do not need to do restore operations in child drivers anymore. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-10-25Merge tag 'mfd-lee-3.13-1' of git://git.linaro.org/people/ljones/mfdSamuel Ortiz
mfd-lee-3.13-1 MFD patches due for v3.13.
2013-10-24mfd: twl6040: Remove obsolete cleanup for i2c clientdataWolfram Sang
A few new i2c-drivers came into the kernel which clear the clientdata-pointer on exit or error. This is obsolete meanwhile, the core will do it. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-10-23mfd: twl6040: Drop devm_free_irq of devm_ allocated irqWei Yongjun
The devm_request_irq function allocates irq that is released when a driver detaches. Thus, there is no reason to explicitly call devm_free_irq in probe or remove functions. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-09-02Merge branch 'topic/for-asoc'Samuel Ortiz
2013-09-02mfd: twl6040: Use regmap for register cacheMark Brown
Rather then open coding a cache of the vibra control registers use the regmap cache code. Also cache the interrupt mask register, providing a small performance improvement for the interrupt code. Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-07-31mfd: twl6040: Cleanup in early error handling in probe functionPeter Ujfalusi
The err: label is not needed we can just return instead of the jump there. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-07-31mfd: twl6040: Cosmetic, parameter alignment changePeter Ujfalusi
To comply with coding style. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-07-31mfd: twl6040: Remove support for legacy (pdata) modePeter Ujfalusi
TWL6040 is used only with OMAP4/5 SoCs and they can only boot in in DT mode. The support for pdata/legacy boot can be removed. Add TODO comment to the header file that all pdata struct can be removed in the next merge window (after the sub driver updates are in). Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-04-08mfd: twl6040: Use devm_*() functionsJingoo Han
Use devm_*() functions to make cleanup paths more simple. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-03Drivers: mfd: 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: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21mfd: twl6040: Remove duplicate inclusion of linux/err.hSachin Kamat
linux/err.h was included twice. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-11-13mfd: twl6040: Rename the core driverPeter Ujfalusi
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>