Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
intel_msic.c File Reference
#include <linux/gpio.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/mfd/core.h>
#include <linux/mfd/intel_msic.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <asm/intel_scu_ipc.h>

Go to the source code of this file.

Data Structures

struct  intel_msic
 

Macros

#define MSIC_VENDOR(id)   ((id >> 6) & 3)
 
#define MSIC_VERSION(id)   (id & 0x3f)
 
#define MSIC_MAJOR(id)   ('A' + ((id >> 3) & 7))
 
#define MSIC_MINOR(id)   (id & 7)
 
#define MSIC_IRQ_STATUS(x)   (INTEL_MSIC_IRQ_PHYS_BASE + ((x) - 2))
 
#define MSIC_IRQ_STATUS_ACCDET   MSIC_IRQ_STATUS(INTEL_MSIC_ACCDET)
 
#define SCU_IPC_RWBUF_LIMIT   16
 

Functions

int intel_msic_reg_read (unsigned short reg, u8 *val)
 
 EXPORT_SYMBOL_GPL (intel_msic_reg_read)
 
int intel_msic_reg_write (unsigned short reg, u8 val)
 
 EXPORT_SYMBOL_GPL (intel_msic_reg_write)
 
int intel_msic_reg_update (unsigned short reg, u8 val, u8 mask)
 
 EXPORT_SYMBOL_GPL (intel_msic_reg_update)
 
int intel_msic_bulk_read (unsigned short *reg, u8 *buf, size_t count)
 
 EXPORT_SYMBOL_GPL (intel_msic_bulk_read)
 
int intel_msic_bulk_write (unsigned short *reg, u8 *buf, size_t count)
 
 EXPORT_SYMBOL_GPL (intel_msic_bulk_write)
 
int intel_msic_irq_read (struct intel_msic *msic, unsigned short reg, u8 *val)
 
 EXPORT_SYMBOL_GPL (intel_msic_irq_read)
 
 module_platform_driver (intel_msic_driver)
 
 MODULE_DESCRIPTION ("Driver for Intel MSIC")
 
 MODULE_AUTHOR ("Mika Westerberg <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define MSIC_IRQ_STATUS (   x)    (INTEL_MSIC_IRQ_PHYS_BASE + ((x) - 2))

Definition at line 32 of file intel_msic.c.

#define MSIC_IRQ_STATUS_ACCDET   MSIC_IRQ_STATUS(INTEL_MSIC_ACCDET)

Definition at line 33 of file intel_msic.c.

#define MSIC_MAJOR (   id)    ('A' + ((id >> 3) & 7))

Definition at line 24 of file intel_msic.c.

#define MSIC_MINOR (   id)    (id & 7)

Definition at line 25 of file intel_msic.c.

#define MSIC_VENDOR (   id)    ((id >> 6) & 3)

Definition at line 22 of file intel_msic.c.

#define MSIC_VERSION (   id)    (id & 0x3f)

Definition at line 23 of file intel_msic.c.

#define SCU_IPC_RWBUF_LIMIT   16

Definition at line 39 of file intel_msic.c.

Function Documentation

EXPORT_SYMBOL_GPL ( intel_msic_reg_read  )
EXPORT_SYMBOL_GPL ( intel_msic_reg_write  )
EXPORT_SYMBOL_GPL ( intel_msic_reg_update  )
EXPORT_SYMBOL_GPL ( intel_msic_bulk_read  )
EXPORT_SYMBOL_GPL ( intel_msic_bulk_write  )
EXPORT_SYMBOL_GPL ( intel_msic_irq_read  )
int intel_msic_bulk_read ( unsigned short reg,
u8 buf,
size_t  count 
)

intel_msic_bulk_read - read an array of registers : array of register addresses to read : array where the read values are placed : number of registers to read

Function reads registers from the MSIC using addresses passed in . Read values are placed in . Reads are performed atomically wrt. MSIC.

Returns %0 in case of success and negative errno in case of failure.

Function may sleep.

Definition at line 253 of file intel_msic.c.

int intel_msic_bulk_write ( unsigned short reg,
u8 buf,
size_t  count 
)

intel_msic_bulk_write - write an array of values to the MSIC registers : array of registers to write : values to write to each register : number of registers to write

Function writes registers in to MSIC. Writes are performed atomically wrt MSIC. Returns %0 in case of success and negative errno in case of failure.

Function may sleep.

Definition at line 274 of file intel_msic.c.

int intel_msic_irq_read ( struct intel_msic msic,
unsigned short  reg,
u8 val 
)

intel_msic_irq_read - read a register from an MSIC interrupt tree : MSIC instance : interrupt register (between INTEL_MSIC_IRQLVL1 and INTEL_MSIC_RESETIRQ2) : value of the register is placed here

This function can be used by an MSIC subdevice interrupt handler to read a register value from the MSIC interrupt tree. In this way subdevice drivers don't have to map in the interrupt tree themselves but can just call this function instead.

Function doesn't sleep and is callable from interrupt context.

Returns %-EINVAL if is outside of the allowed register region.

Definition at line 299 of file intel_msic.c.

int intel_msic_reg_read ( unsigned short  reg,
u8 val 
)

intel_msic_reg_read - read a single MSIC register : register to read : register value is placed here

Read a single register from MSIC. Returns %0 on success and negative errno in case of failure.

Function may sleep.

Definition at line 198 of file intel_msic.c.

int intel_msic_reg_update ( unsigned short  reg,
u8  val,
u8  mask 
)

intel_msic_reg_update - update a single MSIC register : register to update : value to write to the register : specifies which of the bits are updated (%0 = don't update, %1 = update)

Perform an update to a register . is used to specify which bits are updated. Returns %0 in case of success and negative errno in case of failure.

Function may sleep.

Definition at line 233 of file intel_msic.c.

int intel_msic_reg_write ( unsigned short  reg,
u8  val 
)

intel_msic_reg_write - write a single MSIC register : register to write : value to write to that register

Write a single MSIC register. Returns 0 on success and negative errno in case of failure.

Function may sleep.

Definition at line 214 of file intel_msic.c.

MODULE_AUTHOR ( "Mika Westerberg <[email protected]>"  )
MODULE_DESCRIPTION ( "Driver for Intel MSIC"  )
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( intel_msic_driver  )