Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
pfunc_core.c File Reference
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <asm/prom.h>
#include <asm/pmac_pfunc.h>

Go to the source code of this file.

Data Structures

struct  pmf_cmd
 
struct  pmf_device
 

Macros

#define LOG_PARSE(fmt...)
 
#define LOG_ERROR(fmt...)   printk(fmt)
 
#define LOG_BLOB(t, b, c)
 
#define DBG(fmt...)
 
#define PMF_CMD_LIST   0
 
#define PMF_CMD_WRITE_GPIO   1
 
#define PMF_CMD_READ_GPIO   2
 
#define PMF_CMD_WRITE_REG32   3
 
#define PMF_CMD_READ_REG32   4
 
#define PMF_CMD_WRITE_REG16   5
 
#define PMF_CMD_READ_REG16   6
 
#define PMF_CMD_WRITE_REG8   7
 
#define PMF_CMD_READ_REG8   8
 
#define PMF_CMD_DELAY   9
 
#define PMF_CMD_WAIT_REG32   10
 
#define PMF_CMD_WAIT_REG16   11
 
#define PMF_CMD_WAIT_REG8   12
 
#define PMF_CMD_READ_I2C   13
 
#define PMF_CMD_WRITE_I2C   14
 
#define PMF_CMD_RMW_I2C   15
 
#define PMF_CMD_GEN_I2C   16
 
#define PMF_CMD_SHIFT_BYTES_RIGHT   17
 
#define PMF_CMD_SHIFT_BYTES_LEFT   18
 
#define PMF_CMD_READ_CFG   19
 
#define PMF_CMD_WRITE_CFG   20
 
#define PMF_CMD_RMW_CFG   21
 
#define PMF_CMD_READ_I2C_SUBADDR   22
 
#define PMF_CMD_WRITE_I2C_SUBADDR   23
 
#define PMF_CMD_SET_I2C_MODE   24
 
#define PMF_CMD_RMW_I2C_SUBADDR   25
 
#define PMF_CMD_READ_REG32_MASK_SHR_XOR   26
 
#define PMF_CMD_READ_REG16_MASK_SHR_XOR   27
 
#define PMF_CMD_READ_REG8_MASK_SHR_XOR   28
 
#define PMF_CMD_WRITE_REG32_SHL_MASK   29
 
#define PMF_CMD_WRITE_REG16_SHL_MASK   30
 
#define PMF_CMD_WRITE_REG8_SHL_MASK   31
 
#define PMF_CMD_MASK_AND_COMPARE   32
 
#define PMF_CMD_COUNT   33
 
#define PMF_PARSE_CALL(name, cmd, handlers, p...)
 
#define PP_PREFIX   "platform-do-"
 

Typedefs

typedef int(* pmf_cmd_parser_t )(struct pmf_cmd *cmd, struct pmf_handlers *h)
 

Functions

int pmf_register_driver (struct device_node *np, struct pmf_handlers *handlers, void *driverdata)
 
 EXPORT_SYMBOL_GPL (pmf_register_driver)
 
struct pmf_functionpmf_get_function (struct pmf_function *func)
 
 EXPORT_SYMBOL_GPL (pmf_get_function)
 
void pmf_put_function (struct pmf_function *func)
 
 EXPORT_SYMBOL_GPL (pmf_put_function)
 
void pmf_unregister_driver (struct device_node *np)
 
 EXPORT_SYMBOL_GPL (pmf_unregister_driver)
 
struct pmf_function__pmf_find_function (struct device_node *target, const char *name, u32 flags)
 
int pmf_register_irq_client (struct device_node *target, const char *name, struct pmf_irq_client *client)
 
 EXPORT_SYMBOL_GPL (pmf_register_irq_client)
 
void pmf_unregister_irq_client (struct pmf_irq_client *client)
 
 EXPORT_SYMBOL_GPL (pmf_unregister_irq_client)
 
void pmf_do_irq (struct pmf_function *func)
 
 EXPORT_SYMBOL_GPL (pmf_do_irq)
 
int pmf_call_one (struct pmf_function *func, struct pmf_args *args)
 
 EXPORT_SYMBOL_GPL (pmf_call_one)
 
int pmf_do_functions (struct device_node *np, const char *name, u32 phandle, u32 fflags, struct pmf_args *args)
 
 EXPORT_SYMBOL_GPL (pmf_do_functions)
 
struct pmf_functionpmf_find_function (struct device_node *target, const char *name)
 
 EXPORT_SYMBOL_GPL (pmf_find_function)
 
int pmf_call_function (struct device_node *target, const char *name, struct pmf_args *args)
 
 EXPORT_SYMBOL_GPL (pmf_call_function)
 

Macro Definition Documentation

#define DBG (   fmt...)

Definition at line 28 of file pfunc_core.c.

#define LOG_BLOB (   t,
  b,
  c 
)

Definition at line 22 of file pfunc_core.c.

#define LOG_ERROR (   fmt...)    printk(fmt)

Definition at line 21 of file pfunc_core.c.

#define LOG_PARSE (   fmt...)

Definition at line 20 of file pfunc_core.c.

#define PMF_CMD_COUNT   33

Definition at line 65 of file pfunc_core.c.

#define PMF_CMD_DELAY   9

Definition at line 41 of file pfunc_core.c.

#define PMF_CMD_GEN_I2C   16

Definition at line 48 of file pfunc_core.c.

#define PMF_CMD_LIST   0

Definition at line 32 of file pfunc_core.c.

#define PMF_CMD_MASK_AND_COMPARE   32

Definition at line 64 of file pfunc_core.c.

#define PMF_CMD_READ_CFG   19

Definition at line 51 of file pfunc_core.c.

#define PMF_CMD_READ_GPIO   2

Definition at line 34 of file pfunc_core.c.

#define PMF_CMD_READ_I2C   13

Definition at line 45 of file pfunc_core.c.

#define PMF_CMD_READ_I2C_SUBADDR   22

Definition at line 54 of file pfunc_core.c.

#define PMF_CMD_READ_REG16   6

Definition at line 38 of file pfunc_core.c.

#define PMF_CMD_READ_REG16_MASK_SHR_XOR   27

Definition at line 59 of file pfunc_core.c.

#define PMF_CMD_READ_REG32   4

Definition at line 36 of file pfunc_core.c.

#define PMF_CMD_READ_REG32_MASK_SHR_XOR   26

Definition at line 58 of file pfunc_core.c.

#define PMF_CMD_READ_REG8   8

Definition at line 40 of file pfunc_core.c.

#define PMF_CMD_READ_REG8_MASK_SHR_XOR   28

Definition at line 60 of file pfunc_core.c.

#define PMF_CMD_RMW_CFG   21

Definition at line 53 of file pfunc_core.c.

#define PMF_CMD_RMW_I2C   15

Definition at line 47 of file pfunc_core.c.

#define PMF_CMD_RMW_I2C_SUBADDR   25

Definition at line 57 of file pfunc_core.c.

#define PMF_CMD_SET_I2C_MODE   24

Definition at line 56 of file pfunc_core.c.

#define PMF_CMD_SHIFT_BYTES_LEFT   18

Definition at line 50 of file pfunc_core.c.

#define PMF_CMD_SHIFT_BYTES_RIGHT   17

Definition at line 49 of file pfunc_core.c.

#define PMF_CMD_WAIT_REG16   11

Definition at line 43 of file pfunc_core.c.

#define PMF_CMD_WAIT_REG32   10

Definition at line 42 of file pfunc_core.c.

#define PMF_CMD_WAIT_REG8   12

Definition at line 44 of file pfunc_core.c.

#define PMF_CMD_WRITE_CFG   20

Definition at line 52 of file pfunc_core.c.

#define PMF_CMD_WRITE_GPIO   1

Definition at line 33 of file pfunc_core.c.

#define PMF_CMD_WRITE_I2C   14

Definition at line 46 of file pfunc_core.c.

#define PMF_CMD_WRITE_I2C_SUBADDR   23

Definition at line 55 of file pfunc_core.c.

#define PMF_CMD_WRITE_REG16   5

Definition at line 37 of file pfunc_core.c.

#define PMF_CMD_WRITE_REG16_SHL_MASK   30

Definition at line 62 of file pfunc_core.c.

#define PMF_CMD_WRITE_REG32   3

Definition at line 35 of file pfunc_core.c.

#define PMF_CMD_WRITE_REG32_SHL_MASK   29

Definition at line 61 of file pfunc_core.c.

#define PMF_CMD_WRITE_REG8   7

Definition at line 39 of file pfunc_core.c.

#define PMF_CMD_WRITE_REG8_SHL_MASK   31

Definition at line 63 of file pfunc_core.c.

#define PMF_PARSE_CALL (   name,
  cmd,
  handlers,
  p... 
)
Value:
do { \
if (cmd->error) \
return -ENXIO; \
if (handlers == NULL) \
return 0; \
if (handlers->name) \
return handlers->name(cmd->func, cmd->instdata, \
cmd->args, p); \
return -1; \
} while(0) \

Definition at line 124 of file pfunc_core.c.

#define PP_PREFIX   "platform-do-"

Typedef Documentation

typedef int(* pmf_cmd_parser_t)(struct pmf_cmd *cmd, struct pmf_handlers *h)

Definition at line 500 of file pfunc_core.c.

Function Documentation

struct pmf_function* __pmf_find_function ( struct device_node target,
const char name,
u32  flags 
)
read

Definition at line 808 of file pfunc_core.c.

EXPORT_SYMBOL_GPL ( pmf_register_driver  )
EXPORT_SYMBOL_GPL ( pmf_get_function  )
EXPORT_SYMBOL_GPL ( pmf_put_function  )
EXPORT_SYMBOL_GPL ( pmf_unregister_driver  )
EXPORT_SYMBOL_GPL ( pmf_register_irq_client  )
EXPORT_SYMBOL_GPL ( pmf_unregister_irq_client  )
EXPORT_SYMBOL_GPL ( pmf_do_irq  )
EXPORT_SYMBOL_GPL ( pmf_call_one  )
EXPORT_SYMBOL_GPL ( pmf_do_functions  )
EXPORT_SYMBOL_GPL ( pmf_find_function  )
EXPORT_SYMBOL_GPL ( pmf_call_function  )
int pmf_call_function ( struct device_node target,
const char name,
struct pmf_args args 
)

Definition at line 1008 of file pfunc_core.c.

int pmf_call_one ( struct pmf_function func,
struct pmf_args args 
)

Definition at line 938 of file pfunc_core.c.

int pmf_do_functions ( struct device_node np,
const char name,
u32  phandle,
u32  fflags,
struct pmf_args args 
)

Definition at line 956 of file pfunc_core.c.

void pmf_do_irq ( struct pmf_function func)

Definition at line 918 of file pfunc_core.c.

struct pmf_function* pmf_find_function ( struct device_node target,
const char name 
)
read

Definition at line 993 of file pfunc_core.c.

struct pmf_function* pmf_get_function ( struct pmf_function func)
read

Definition at line 749 of file pfunc_core.c.

void pmf_put_function ( struct pmf_function func)

Definition at line 771 of file pfunc_core.c.

int pmf_register_driver ( struct device_node np,
struct pmf_handlers handlers,
void driverdata 
)

Definition at line 701 of file pfunc_core.c.

int pmf_register_irq_client ( struct device_node target,
const char name,
struct pmf_irq_client client 
)

Definition at line 862 of file pfunc_core.c.

void pmf_unregister_driver ( struct device_node np)

Definition at line 780 of file pfunc_core.c.

void pmf_unregister_irq_client ( struct pmf_irq_client client)

Definition at line 894 of file pfunc_core.c.