Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
mcp-core.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/smp.h>
#include <linux/device.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/mfd/mcp.h>

Go to the source code of this file.

Macros

#define to_mcp(d)   container_of(d, struct mcp, attached_device)
 
#define to_mcp_driver(d)   container_of(d, struct mcp_driver, drv)
 

Functions

void mcp_set_telecom_divisor (struct mcp *mcp, unsigned int div)
 
 EXPORT_SYMBOL (mcp_set_telecom_divisor)
 
void mcp_set_audio_divisor (struct mcp *mcp, unsigned int div)
 
 EXPORT_SYMBOL (mcp_set_audio_divisor)
 
void mcp_reg_write (struct mcp *mcp, unsigned int reg, unsigned int val)
 
 EXPORT_SYMBOL (mcp_reg_write)
 
unsigned int mcp_reg_read (struct mcp *mcp, unsigned int reg)
 
 EXPORT_SYMBOL (mcp_reg_read)
 
void mcp_enable (struct mcp *mcp)
 
 EXPORT_SYMBOL (mcp_enable)
 
void mcp_disable (struct mcp *mcp)
 
 EXPORT_SYMBOL (mcp_disable)
 
struct mcpmcp_host_alloc (struct device *parent, size_t size)
 
 EXPORT_SYMBOL (mcp_host_alloc)
 
int mcp_host_add (struct mcp *mcp, void *pdata)
 
 EXPORT_SYMBOL (mcp_host_add)
 
void mcp_host_del (struct mcp *mcp)
 
 EXPORT_SYMBOL (mcp_host_del)
 
void mcp_host_free (struct mcp *mcp)
 
 EXPORT_SYMBOL (mcp_host_free)
 
int mcp_driver_register (struct mcp_driver *mcpdrv)
 
 EXPORT_SYMBOL (mcp_driver_register)
 
void mcp_driver_unregister (struct mcp_driver *mcpdrv)
 
 EXPORT_SYMBOL (mcp_driver_unregister)
 
 module_init (mcp_init)
 
 module_exit (mcp_exit)
 
 MODULE_AUTHOR ("Russell King <[email protected]>")
 
 MODULE_DESCRIPTION ("Core multimedia communications port driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define to_mcp (   d)    container_of(d, struct mcp, attached_device)

Definition at line 23 of file mcp-core.c.

#define to_mcp_driver (   d)    container_of(d, struct mcp_driver, drv)

Definition at line 24 of file mcp-core.c.

Function Documentation

EXPORT_SYMBOL ( mcp_set_telecom_divisor  )
EXPORT_SYMBOL ( mcp_set_audio_divisor  )
EXPORT_SYMBOL ( mcp_reg_write  )
EXPORT_SYMBOL ( mcp_reg_read  )
EXPORT_SYMBOL ( mcp_enable  )
EXPORT_SYMBOL ( mcp_disable  )
EXPORT_SYMBOL ( mcp_host_alloc  )
EXPORT_SYMBOL ( mcp_host_add  )
EXPORT_SYMBOL ( mcp_host_del  )
EXPORT_SYMBOL ( mcp_host_free  )
EXPORT_SYMBOL ( mcp_driver_register  )
EXPORT_SYMBOL ( mcp_driver_unregister  )
void mcp_disable ( struct mcp mcp)

mcp_disable - disable the MCP interface : MCP interface to disable

Disable the MCP interface. The MCP interface will only be disabled once the number of calls to mcp_enable matches the number of calls to mcp_disable.

Definition at line 155 of file mcp-core.c.

int mcp_driver_register ( struct mcp_driver mcpdrv)

Definition at line 210 of file mcp-core.c.

void mcp_driver_unregister ( struct mcp_driver mcpdrv)

Definition at line 217 of file mcp-core.c.

void mcp_enable ( struct mcp mcp)

mcp_enable - enable the MCP interface : MCP interface to enable

Enable the MCP interface. Each call to mcp_enable will need a corresponding call to mcp_disable to disable the interface.

Definition at line 137 of file mcp-core.c.

int mcp_host_add ( struct mcp mcp,
void pdata 
)

Definition at line 190 of file mcp-core.c.

struct mcp* mcp_host_alloc ( struct device parent,
size_t  size 
)
read

Definition at line 173 of file mcp-core.c.

void mcp_host_del ( struct mcp mcp)

Definition at line 198 of file mcp-core.c.

void mcp_host_free ( struct mcp mcp)

Definition at line 204 of file mcp-core.c.

unsigned int mcp_reg_read ( struct mcp mcp,
unsigned int  reg 
)

mcp_reg_read - read a device register : MCP interface structure : 4-bit register index

Read a device register and return its value. The MCP interface must be enabled to prevent this function hanging.

Definition at line 117 of file mcp-core.c.

void mcp_reg_write ( struct mcp mcp,
unsigned int  reg,
unsigned int  val 
)

mcp_reg_write - write a device register : MCP interface structure : 4-bit register index : 16-bit data value

Write a device register. The MCP interface must be enabled to prevent this function hanging.

Definition at line 99 of file mcp-core.c.

void mcp_set_audio_divisor ( struct mcp mcp,
unsigned int  div 
)

mcp_set_audio_divisor - set the audio divisor : MCP interface structure : SIB clock divisor

Set the audio divisor on the MCP interface.

Definition at line 80 of file mcp-core.c.

void mcp_set_telecom_divisor ( struct mcp mcp,
unsigned int  div 
)

mcp_set_telecom_divisor - set the telecom divisor : MCP interface structure : SIB clock divisor

Set the telecom divisor on the MCP interface. The resulting sample rate is SIBCLOCK/div.

Definition at line 63 of file mcp-core.c.

MODULE_AUTHOR ( "Russell King <[email protected]>"  )
MODULE_DESCRIPTION ( "Core multimedia communications port driver )
module_exit ( mcp_exit  )
module_init ( mcp_init  )
MODULE_LICENSE ( "GPL"  )