Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
mcbsp.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>
#include <linux/platform_data/asoc-ti-mcbsp.h>
#include <plat/cpu.h>
#include "mcbsp.h"

Go to the source code of this file.

Macros

#define MCBSP_READ(mcbsp, reg)   omap_mcbsp_read(mcbsp, OMAP_MCBSP_REG_##reg, 0)
 
#define MCBSP_WRITE(mcbsp, reg, val)   omap_mcbsp_write(mcbsp, OMAP_MCBSP_REG_##reg, val)
 
#define MCBSP_READ_CACHE(mcbsp, reg)   omap_mcbsp_read(mcbsp, OMAP_MCBSP_REG_##reg, 1)
 
#define MCBSP_ST_READ(mcbsp, reg)   omap_mcbsp_st_read(mcbsp, OMAP_ST_REG_##reg)
 
#define MCBSP_ST_WRITE(mcbsp, reg, val)   omap_mcbsp_st_write(mcbsp, OMAP_ST_REG_##reg, val)
 
#define max_thres(m)   (mcbsp->pdata->buffer_size)
 
#define valid_threshold(m, val)   ((val) <= max_thres(m))
 
#define THRESHOLD_PROP_BUILDER(prop)
 

Functions

void omap_mcbsp_config (struct omap_mcbsp *mcbsp, const struct omap_mcbsp_reg_cfg *config)
 
int omap_st_set_chgain (struct omap_mcbsp *mcbsp, int channel, s16 chgain)
 
int omap_st_get_chgain (struct omap_mcbsp *mcbsp, int channel, s16 *chgain)
 
int omap_st_enable (struct omap_mcbsp *mcbsp)
 
int omap_st_disable (struct omap_mcbsp *mcbsp)
 
int omap_st_is_enabled (struct omap_mcbsp *mcbsp)
 
void omap_mcbsp_set_tx_threshold (struct omap_mcbsp *mcbsp, u16 threshold)
 
void omap_mcbsp_set_rx_threshold (struct omap_mcbsp *mcbsp, u16 threshold)
 
u16 omap_mcbsp_get_tx_delay (struct omap_mcbsp *mcbsp)
 
u16 omap_mcbsp_get_rx_delay (struct omap_mcbsp *mcbsp)
 
int omap_mcbsp_request (struct omap_mcbsp *mcbsp)
 
void omap_mcbsp_free (struct omap_mcbsp *mcbsp)
 
void omap_mcbsp_start (struct omap_mcbsp *mcbsp, int tx, int rx)
 
void omap_mcbsp_stop (struct omap_mcbsp *mcbsp, int tx, int rx)
 
int omap2_mcbsp_set_clks_src (struct omap_mcbsp *mcbsp, u8 fck_src_id)
 
 THRESHOLD_PROP_BUILDER (max_tx_thres)
 
 THRESHOLD_PROP_BUILDER (max_rx_thres)
 
int __devinit omap_mcbsp_init (struct platform_device *pdev)
 
void __devexit omap_mcbsp_sysfs_remove (struct omap_mcbsp *mcbsp)
 

Macro Definition Documentation

#define max_thres (   m)    (mcbsp->pdata->buffer_size)

Definition at line 767 of file mcbsp.c.

#define MCBSP_READ (   mcbsp,
  reg 
)    omap_mcbsp_read(mcbsp, OMAP_MCBSP_REG_##reg, 0)

Definition at line 71 of file mcbsp.c.

#define MCBSP_READ_CACHE (   mcbsp,
  reg 
)    omap_mcbsp_read(mcbsp, OMAP_MCBSP_REG_##reg, 1)

Definition at line 75 of file mcbsp.c.

#define MCBSP_ST_READ (   mcbsp,
  reg 
)    omap_mcbsp_st_read(mcbsp, OMAP_ST_REG_##reg)

Definition at line 78 of file mcbsp.c.

#define MCBSP_ST_WRITE (   mcbsp,
  reg,
  val 
)    omap_mcbsp_st_write(mcbsp, OMAP_ST_REG_##reg, val)

Definition at line 80 of file mcbsp.c.

#define MCBSP_WRITE (   mcbsp,
  reg,
  val 
)    omap_mcbsp_write(mcbsp, OMAP_MCBSP_REG_##reg, val)

Definition at line 73 of file mcbsp.c.

#define THRESHOLD_PROP_BUILDER (   prop)
Value:
static ssize_t prop##_show(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
\
return sprintf(buf, "%u\n", mcbsp->prop); \
} \
\
static ssize_t prop##_store(struct device *dev, \
const char *buf, size_t size) \
{ \
unsigned long val; \
int status; \
\
status = strict_strtoul(buf, 0, &val); \
if (status) \
return status; \
if (!valid_threshold(mcbsp, val)) \
return -EDOM; \
\
mcbsp->prop = val; \
return size; \
} \
\
static DEVICE_ATTR(prop, 0644, prop##_show, prop##_store);

Definition at line 769 of file mcbsp.c.

#define valid_threshold (   m,
  val 
)    ((val) <= max_thres(m))

Definition at line 768 of file mcbsp.c.

Function Documentation

int omap2_mcbsp_set_clks_src ( struct omap_mcbsp mcbsp,
u8  fck_src_id 
)

Definition at line 730 of file mcbsp.c.

void omap_mcbsp_config ( struct omap_mcbsp mcbsp,
const struct omap_mcbsp_reg_cfg config 
)

Definition at line 198 of file mcbsp.c.

void omap_mcbsp_free ( struct omap_mcbsp mcbsp)

Definition at line 584 of file mcbsp.c.

u16 omap_mcbsp_get_rx_delay ( struct omap_mcbsp mcbsp)

Definition at line 489 of file mcbsp.c.

u16 omap_mcbsp_get_tx_delay ( struct omap_mcbsp mcbsp)

Definition at line 471 of file mcbsp.c.

int __devinit omap_mcbsp_init ( struct platform_device pdev)

Definition at line 962 of file mcbsp.c.

int omap_mcbsp_request ( struct omap_mcbsp mcbsp)

Definition at line 508 of file mcbsp.c.

void omap_mcbsp_set_rx_threshold ( struct omap_mcbsp mcbsp,
u16  threshold 
)

Definition at line 459 of file mcbsp.c.

void omap_mcbsp_set_tx_threshold ( struct omap_mcbsp mcbsp,
u16  threshold 
)

Definition at line 445 of file mcbsp.c.

void omap_mcbsp_start ( struct omap_mcbsp mcbsp,
int  tx,
int  rx 
)

Definition at line 635 of file mcbsp.c.

void omap_mcbsp_stop ( struct omap_mcbsp mcbsp,
int  tx,
int  rx 
)

Definition at line 692 of file mcbsp.c.

void __devexit omap_mcbsp_sysfs_remove ( struct omap_mcbsp mcbsp)

Definition at line 1090 of file mcbsp.c.

int omap_st_disable ( struct omap_mcbsp mcbsp)

Definition at line 414 of file mcbsp.c.

int omap_st_enable ( struct omap_mcbsp mcbsp)

Definition at line 385 of file mcbsp.c.

int omap_st_get_chgain ( struct omap_mcbsp mcbsp,
int  channel,
s16 chgain 
)

Definition at line 348 of file mcbsp.c.

int omap_st_is_enabled ( struct omap_mcbsp mcbsp)

Definition at line 430 of file mcbsp.c.

int omap_st_set_chgain ( struct omap_mcbsp mcbsp,
int  channel,
s16  chgain 
)

Definition at line 325 of file mcbsp.c.

THRESHOLD_PROP_BUILDER ( max_tx_thres  )
THRESHOLD_PROP_BUILDER ( max_rx_thres  )