Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
gpio-pmf.c File Reference
#include <linux/slab.h>
#include <asm/pmac_feature.h>
#include <asm/pmac_pfunc.h>
#include "../aoa.h"

Go to the source code of this file.

Macros

#define PMF_GPIO(name, bit)
 

Functions

 PMF_GPIO (headphone, 0)
 
 PMF_GPIO (amp, 1)
 
 PMF_GPIO (lineout, 2)
 
 EXPORT_SYMBOL_GPL (pmf_gpio_methods)
 

Variables

struct gpio_methodspmf_gpio_methods = &methods
 

Macro Definition Documentation

#define PMF_GPIO (   name,
  bit 
)
Value:
static void pmf_gpio_set_##name(struct gpio_runtime *rt, int on)\
{ \
struct pmf_args args = { .count = 1, .u[0].v = !on }; \
int rc; \
if (unlikely(!rt)) return; \
rc = pmf_call_function(rt->node, #name "-mute", &args); \
if (rc && rc != -ENODEV) \
printk(KERN_WARNING "pmf_gpio_set_" #name \
" failed, rc: %d\n", rc); \
rt->implementation_private &= ~(1<<bit); \
rt->implementation_private |= (!!on << bit); \
} \
static int pmf_gpio_get_##name(struct gpio_runtime *rt) \
{ \
if (unlikely(!rt)) return 0; \
return (rt->implementation_private>>bit)&1; \
}

Definition at line 14 of file gpio-pmf.c.

Function Documentation

EXPORT_SYMBOL_GPL ( pmf_gpio_methods  )
PMF_GPIO ( headphone  ,
 
)
PMF_GPIO ( amp  ,
 
)
PMF_GPIO ( lineout  ,
 
)

Variable Documentation

struct gpio_methods* pmf_gpio_methods = &methods

Definition at line 252 of file gpio-pmf.c.