aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/twl6040.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-03-30mfd: twl6040: Remove wrong and unneeded "platform:twl6040" modaliasAxel Lin1-1/+0
This is a I2C driver, so it's wrong to use platform prefix for the modalias. We have all needed i2c aliases coming form MODULE_DEVICE_TABLE, so let's remove the wrong and unneeded "platform:twl6040" modalias. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2015-01-22mfd: twl6040: Constify struct regmap_config and reg_default arrayKrzysztof Kozlowski1-2/+2
The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const. Make array of struct reg_default const as well. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26mfd: twl6040: Fix error return codeJulia Lawall1-0/+1
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 Jones1-1/+1
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 Ujfalusi1-8/+5
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 Ujfalusi1-4/+3
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 Ujfalusi1-0/+10
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 Ujfalusi1-2/+7
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 Ujfalusi1-0/+3
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 Vaussard1-0/+5
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 Vaussard1-1/+0
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 Yongjun1-1/+1
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 Ujfalusi1-3/+89
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 Ortiz1-8/+2
mfd-lee-3.13-1 MFD patches due for v3.13.
2013-10-24mfd: twl6040: Remove obsolete cleanup for i2c clientdataWolfram Sang1-6/+2
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 Yongjun1-8/+2
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 Ortiz1-13/+30
2013-09-02mfd: twl6040: Use regmap for register cacheMark Brown1-13/+30
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 Ujfalusi1-9/+5
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 Ujfalusi1-11/+10
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 Ujfalusi1-42/+13
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 Han1-20/+11
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-Hartman1-4/+4
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 Kamat1-1/+0
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 Ujfalusi1-0/+749
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>