Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
sa1111.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/dma-mapping.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <mach/hardware.h>
#include <asm/mach/irq.h>
#include <asm/mach-types.h>
#include <asm/sizes.h>
#include <asm/hardware/sa1111.h>

Go to the source code of this file.

Data Structures

struct  sa1111
 
struct  sa1111_dev_info
 
struct  sa1111_save_data
 

Macros

#define IRQ_GPAIN0   (0)
 
#define IRQ_GPAIN1   (1)
 
#define IRQ_GPAIN2   (2)
 
#define IRQ_GPAIN3   (3)
 
#define IRQ_GPBIN0   (4)
 
#define IRQ_GPBIN1   (5)
 
#define IRQ_GPBIN2   (6)
 
#define IRQ_GPBIN3   (7)
 
#define IRQ_GPBIN4   (8)
 
#define IRQ_GPBIN5   (9)
 
#define IRQ_GPCIN0   (10)
 
#define IRQ_GPCIN1   (11)
 
#define IRQ_GPCIN2   (12)
 
#define IRQ_GPCIN3   (13)
 
#define IRQ_GPCIN4   (14)
 
#define IRQ_GPCIN5   (15)
 
#define IRQ_GPCIN6   (16)
 
#define IRQ_GPCIN7   (17)
 
#define IRQ_MSTXINT   (18)
 
#define IRQ_MSRXINT   (19)
 
#define IRQ_MSSTOPERRINT   (20)
 
#define IRQ_TPTXINT   (21)
 
#define IRQ_TPRXINT   (22)
 
#define IRQ_TPSTOPERRINT   (23)
 
#define SSPXMTINT   (24)
 
#define SSPRCVINT   (25)
 
#define SSPROR   (26)
 
#define AUDXMTDMADONEA   (32)
 
#define AUDRCVDMADONEA   (33)
 
#define AUDXMTDMADONEB   (34)
 
#define AUDRCVDMADONEB   (35)
 
#define AUDTFSR   (36)
 
#define AUDRFSR   (37)
 
#define AUDTUR   (38)
 
#define AUDROR   (39)
 
#define AUDDTS   (40)
 
#define AUDRDD   (41)
 
#define AUDSTO   (42)
 
#define IRQ_USBPWR   (43)
 
#define IRQ_HCIM   (44)
 
#define IRQ_HCIBUFFACC   (45)
 
#define IRQ_HCIRMTWKP   (46)
 
#define IRQ_NHCIMFCIR   (47)
 
#define IRQ_USB_PORT_RESUME   (48)
 
#define IRQ_S0_READY_NINT   (49)
 
#define IRQ_S1_READY_NINT   (50)
 
#define IRQ_S0_CD_VALID   (51)
 
#define IRQ_S1_CD_VALID   (52)
 
#define IRQ_S0_BVD1_STSCHG   (53)
 
#define IRQ_S1_BVD1_STSCHG   (54)
 
#define SA1111_IRQ_NR   (55)
 
#define SA1111_IRQMASK_LO(x)   (1 << (x - sachip->irq_base))
 
#define SA1111_IRQMASK_HI(x)   (1 << (x - sachip->irq_base - 32))
 
#define sa1111_suspend   NULL
 
#define sa1111_resume   NULL
 
#define MODIFY_BITS(port, mask, dir)
 

Functions

void sa1110_mb_enable (void)
 
void sa1110_mb_disable (void)
 
unsigned int sa1111_pll_clock (struct sa1111_dev *sadev)
 
 EXPORT_SYMBOL (sa1111_pll_clock)
 
void sa1111_select_audio_mode (struct sa1111_dev *sadev, int mode)
 
 EXPORT_SYMBOL (sa1111_select_audio_mode)
 
int sa1111_set_audio_rate (struct sa1111_dev *sadev, int rate)
 
 EXPORT_SYMBOL (sa1111_set_audio_rate)
 
int sa1111_get_audio_rate (struct sa1111_dev *sadev)
 
 EXPORT_SYMBOL (sa1111_get_audio_rate)
 
void sa1111_set_io_dir (struct sa1111_dev *sadev, unsigned int bits, unsigned int dir, unsigned int sleep_dir)
 
 EXPORT_SYMBOL (sa1111_set_io_dir)
 
void sa1111_set_io (struct sa1111_dev *sadev, unsigned int bits, unsigned int v)
 
 EXPORT_SYMBOL (sa1111_set_io)
 
void sa1111_set_sleep_io (struct sa1111_dev *sadev, unsigned int bits, unsigned int v)
 
 EXPORT_SYMBOL (sa1111_set_sleep_io)
 
int sa1111_enable_device (struct sa1111_dev *sadev)
 
 EXPORT_SYMBOL (sa1111_enable_device)
 
void sa1111_disable_device (struct sa1111_dev *sadev)
 
 EXPORT_SYMBOL (sa1111_disable_device)
 
 EXPORT_SYMBOL (sa1111_bus_type)
 
int sa1111_driver_register (struct sa1111_driver *driver)
 
 EXPORT_SYMBOL (sa1111_driver_register)
 
void sa1111_driver_unregister (struct sa1111_driver *driver)
 
 EXPORT_SYMBOL (sa1111_driver_unregister)
 
 subsys_initcall (sa1111_init)
 
 module_exit (sa1111_exit)
 
 MODULE_DESCRIPTION ("Intel Corporation SA1111 core driver")
 
 MODULE_LICENSE ("GPL")
 

Variables

struct bus_type sa1111_bus_type
 

Macro Definition Documentation

#define AUDDTS   (40)

Definition at line 74 of file sa1111.c.

#define AUDRCVDMADONEA   (33)

Definition at line 67 of file sa1111.c.

#define AUDRCVDMADONEB   (35)

Definition at line 69 of file sa1111.c.

#define AUDRDD   (41)

Definition at line 75 of file sa1111.c.

#define AUDRFSR   (37)

Definition at line 71 of file sa1111.c.

#define AUDROR   (39)

Definition at line 73 of file sa1111.c.

#define AUDSTO   (42)

Definition at line 76 of file sa1111.c.

#define AUDTFSR   (36)

Definition at line 70 of file sa1111.c.

#define AUDTUR   (38)

Definition at line 72 of file sa1111.c.

#define AUDXMTDMADONEA   (32)

Definition at line 66 of file sa1111.c.

#define AUDXMTDMADONEB   (34)

Definition at line 68 of file sa1111.c.

#define IRQ_GPAIN0   (0)

Definition at line 39 of file sa1111.c.

#define IRQ_GPAIN1   (1)

Definition at line 40 of file sa1111.c.

#define IRQ_GPAIN2   (2)

Definition at line 41 of file sa1111.c.

#define IRQ_GPAIN3   (3)

Definition at line 42 of file sa1111.c.

#define IRQ_GPBIN0   (4)

Definition at line 43 of file sa1111.c.

#define IRQ_GPBIN1   (5)

Definition at line 44 of file sa1111.c.

#define IRQ_GPBIN2   (6)

Definition at line 45 of file sa1111.c.

#define IRQ_GPBIN3   (7)

Definition at line 46 of file sa1111.c.

#define IRQ_GPBIN4   (8)

Definition at line 47 of file sa1111.c.

#define IRQ_GPBIN5   (9)

Definition at line 48 of file sa1111.c.

#define IRQ_GPCIN0   (10)

Definition at line 49 of file sa1111.c.

#define IRQ_GPCIN1   (11)

Definition at line 50 of file sa1111.c.

#define IRQ_GPCIN2   (12)

Definition at line 51 of file sa1111.c.

#define IRQ_GPCIN3   (13)

Definition at line 52 of file sa1111.c.

#define IRQ_GPCIN4   (14)

Definition at line 53 of file sa1111.c.

#define IRQ_GPCIN5   (15)

Definition at line 54 of file sa1111.c.

#define IRQ_GPCIN6   (16)

Definition at line 55 of file sa1111.c.

#define IRQ_GPCIN7   (17)

Definition at line 56 of file sa1111.c.

#define IRQ_HCIBUFFACC   (45)

Definition at line 79 of file sa1111.c.

#define IRQ_HCIM   (44)

Definition at line 78 of file sa1111.c.

#define IRQ_HCIRMTWKP   (46)

Definition at line 80 of file sa1111.c.

#define IRQ_MSRXINT   (19)

Definition at line 58 of file sa1111.c.

#define IRQ_MSSTOPERRINT   (20)

Definition at line 59 of file sa1111.c.

#define IRQ_MSTXINT   (18)

Definition at line 57 of file sa1111.c.

#define IRQ_NHCIMFCIR   (47)

Definition at line 81 of file sa1111.c.

#define IRQ_S0_BVD1_STSCHG   (53)

Definition at line 87 of file sa1111.c.

#define IRQ_S0_CD_VALID   (51)

Definition at line 85 of file sa1111.c.

#define IRQ_S0_READY_NINT   (49)

Definition at line 83 of file sa1111.c.

#define IRQ_S1_BVD1_STSCHG   (54)

Definition at line 88 of file sa1111.c.

#define IRQ_S1_CD_VALID   (52)

Definition at line 86 of file sa1111.c.

#define IRQ_S1_READY_NINT   (50)

Definition at line 84 of file sa1111.c.

#define IRQ_TPRXINT   (22)

Definition at line 61 of file sa1111.c.

#define IRQ_TPSTOPERRINT   (23)

Definition at line 62 of file sa1111.c.

#define IRQ_TPTXINT   (21)

Definition at line 60 of file sa1111.c.

#define IRQ_USB_PORT_RESUME   (48)

Definition at line 82 of file sa1111.c.

#define IRQ_USBPWR   (43)

Definition at line 77 of file sa1111.c.

#define MODIFY_BITS (   port,
  mask,
  dir 
)
Value:
if (mask) { \
val = sa1111_readl(port); \
val &= ~(mask); \
val |= (dir) & (mask); \
sa1111_writel(val, port); \
}
#define SA1111_IRQ_NR   (55)

Definition at line 89 of file sa1111.c.

#define SA1111_IRQMASK_HI (   x)    (1 << (x - sachip->irq_base - 32))

Definition at line 233 of file sa1111.c.

#define SA1111_IRQMASK_LO (   x)    (1 << (x - sachip->irq_base))

Definition at line 232 of file sa1111.c.

#define sa1111_resume   NULL

Definition at line 1011 of file sa1111.c.

#define sa1111_suspend   NULL

Definition at line 1010 of file sa1111.c.

#define SSPRCVINT   (25)

Definition at line 64 of file sa1111.c.

#define SSPROR   (26)

Definition at line 65 of file sa1111.c.

#define SSPXMTINT   (24)

Definition at line 63 of file sa1111.c.

Function Documentation

EXPORT_SYMBOL ( sa1111_pll_clock  )
EXPORT_SYMBOL ( sa1111_select_audio_mode  )
EXPORT_SYMBOL ( sa1111_set_audio_rate  )
EXPORT_SYMBOL ( sa1111_get_audio_rate  )
EXPORT_SYMBOL ( sa1111_set_io_dir  )
EXPORT_SYMBOL ( sa1111_set_io  )
EXPORT_SYMBOL ( sa1111_set_sleep_io  )
EXPORT_SYMBOL ( sa1111_enable_device  )
EXPORT_SYMBOL ( sa1111_disable_device  )
EXPORT_SYMBOL ( sa1111_bus_type  )
EXPORT_SYMBOL ( sa1111_driver_register  )
EXPORT_SYMBOL ( sa1111_driver_unregister  )
MODULE_DESCRIPTION ( "Intel Corporation SA1111 core driver )
module_exit ( sa1111_exit  )
MODULE_LICENSE ( "GPL"  )
void sa1110_mb_disable ( void  )

Definition at line 420 of file generic.c.

void sa1110_mb_enable ( void  )

Definition at line 439 of file generic.c.

void sa1111_disable_device ( struct sa1111_dev sadev)

sa1111_disable_device - disable an on-chip SA1111 function block : SA1111 function block device to disable

Definition at line 1271 of file sa1111.c.

int sa1111_driver_register ( struct sa1111_driver driver)

Definition at line 1364 of file sa1111.c.

void sa1111_driver_unregister ( struct sa1111_driver driver)

Definition at line 1371 of file sa1111.c.

int sa1111_enable_device ( struct sa1111_dev sadev)

sa1111_enable_device - enable an on-chip SA1111 function block : SA1111 function block device to enable

Definition at line 1247 of file sa1111.c.

int sa1111_get_audio_rate ( struct sa1111_dev sadev)

sa1111_get_audio_rate - get the audio sample rate : SA1111 SAC function block device

Definition at line 1166 of file sa1111.c.

unsigned int sa1111_pll_clock ( struct sa1111_dev sadev)

sa1111_pll_clock - return the current PLL clock frequency. : SA1111 function block

BUG: we should look at SKCR. We also blindly believe that the chip is being fed with the 3.6864MHz clock.

Returns the PLL clock in Hz.

Definition at line 1101 of file sa1111.c.

void sa1111_select_audio_mode ( struct sa1111_dev sadev,
int  mode 
)

sa1111_select_audio_mode - select I2S or AC link mode : SA1111 function block : One of SA1111_AUDIO_ACLINK or SA1111_AUDIO_I2S

Frob the SKCR to select AC Link mode or I2S mode for the audio block.

Definition at line 1117 of file sa1111.c.

int sa1111_set_audio_rate ( struct sa1111_dev sadev,
int  rate 
)

sa1111_set_audio_rate - set the audio sample rate : SA1111 SAC function block : sample rate to select

Definition at line 1142 of file sa1111.c.

void sa1111_set_io ( struct sa1111_dev sadev,
unsigned int  bits,
unsigned int  v 
)

Definition at line 1209 of file sa1111.c.

void sa1111_set_io_dir ( struct sa1111_dev sadev,
unsigned int  bits,
unsigned int  dir,
unsigned int  sleep_dir 
)

Definition at line 1180 of file sa1111.c.

void sa1111_set_sleep_io ( struct sa1111_dev sadev,
unsigned int  bits,
unsigned int  v 
)

Definition at line 1224 of file sa1111.c.

subsys_initcall ( sa1111_init  )

Variable Documentation

struct bus_type sa1111_bus_type
Initial value:
= {
.name = "sa1111-rab",
.match = sa1111_match,
.probe = sa1111_bus_probe,
.remove = sa1111_bus_remove,
.suspend = sa1111_bus_suspend,
.resume = sa1111_bus_resume,
.shutdown = sa1111_bus_shutdown,
}

Definition at line 1353 of file sa1111.c.