Skip to content

Commit

Permalink
MFD: twl6040: function to query the vibra status for clients
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Ujfalusi authored and Mark Brown committed Oct 12, 2011
1 parent 31b402e commit 70601ec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/mfd/twl6040-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,18 @@ unsigned int twl6040_get_sysclk(struct twl6040 *twl6040)
}
EXPORT_SYMBOL(twl6040_get_sysclk);

/* Get the combined status of the vibra control register */
int twl6040_get_vibralr_status(struct twl6040 *twl6040)
{
u8 status;

status = twl6040->vibra_ctrl_cache[0] | twl6040->vibra_ctrl_cache[1];
status &= (TWL6040_VIBENA | TWL6040_VIBSEL);

return status;
}
EXPORT_SYMBOL(twl6040_get_vibralr_status);

static struct resource twl6040_vibra_rsrc[] = {
{
.flags = IORESOURCE_IRQ,
Expand Down
3 changes: 3 additions & 0 deletions include/linux/mfd/twl6040.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,13 @@ int twl6040_get_pll(struct twl6040 *twl6040);
unsigned int twl6040_get_sysclk(struct twl6040 *twl6040);
int twl6040_irq_init(struct twl6040 *twl6040);
void twl6040_irq_exit(struct twl6040 *twl6040);
/* Get the combined status of the vibra control register */
int twl6040_get_vibralr_status(struct twl6040 *twl6040);

static inline int twl6040_get_revid(struct twl6040 *twl6040)
{
return twl6040->rev;
}


#endif /* End of __TWL6040_CODEC_H__ */

0 comments on commit 70601ec

Please sign in to comment.