aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2011-10-12 04:57:55 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-10-12 06:48:49 -0400
commit70601ec10a2450369d554e49d708ab26deb17b66 (patch)
treed33c829e1f54a634b43c9361c816972050593e60 /drivers/mfd
parent31b402e3c9eb839a00530511dcf7de47bbf723f6 (diff)
MFD: twl6040: function to query the vibra status for clients
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>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/twl6040-core.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/mfd/twl6040-core.c b/drivers/mfd/twl6040-core.c
index 75987c8ca049..268f80fd0439 100644
--- a/drivers/mfd/twl6040-core.c
+++ b/drivers/mfd/twl6040-core.c
@@ -444,6 +444,18 @@ unsigned int twl6040_get_sysclk(struct twl6040 *twl6040)
444} 444}
445EXPORT_SYMBOL(twl6040_get_sysclk); 445EXPORT_SYMBOL(twl6040_get_sysclk);
446 446
447/* Get the combined status of the vibra control register */
448int twl6040_get_vibralr_status(struct twl6040 *twl6040)
449{
450 u8 status;
451
452 status = twl6040->vibra_ctrl_cache[0] | twl6040->vibra_ctrl_cache[1];
453 status &= (TWL6040_VIBENA | TWL6040_VIBSEL);
454
455 return status;
456}
457EXPORT_SYMBOL(twl6040_get_vibralr_status);
458
447static struct resource twl6040_vibra_rsrc[] = { 459static struct resource twl6040_vibra_rsrc[] = {
448 { 460 {
449 .flags = IORESOURCE_IRQ, 461 .flags = IORESOURCE_IRQ,