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

Go to the source code of this file.

Macros

#define SWITCH_GPIO(name, v, on)
 
#define FTR_GPIO(name, bit)
 

Functions

 FTR_GPIO (headphone, 0)
 
 FTR_GPIO (amp, 1)
 
 FTR_GPIO (lineout, 2)
 
 FTR_GPIO (master, 3)
 
 EXPORT_SYMBOL_GPL (ftr_gpio_methods)
 

Variables

struct gpio_methodsftr_gpio_methods = &methods
 

Macro Definition Documentation

#define FTR_GPIO (   name,
  bit 
)
Value:
static void ftr_gpio_set_##name(struct gpio_runtime *rt, int on)\
{ \
int v; \
if (unlikely(!rt)) return; \
\
if (name##_mute_gpio < 0) \
return; \
\
v = pmac_call_feature(PMAC_FTR_READ_GPIO, NULL, \
name##_mute_gpio, \
0); \
\
/* muted = !on... */ \
v = SWITCH_GPIO(name##_mute, v, !on); \
\
pmac_call_feature(PMAC_FTR_WRITE_GPIO, NULL, \
name##_mute_gpio, v); \
\
rt->implementation_private &= ~(1<<bit); \
rt->implementation_private |= (!!on << bit); \
} \
static int ftr_gpio_get_##name(struct gpio_runtime *rt) \
{ \
if (unlikely(!rt)) return 0; \
return (rt->implementation_private>>bit)&1; \
}

Definition at line 129 of file gpio-feature.c.

#define SWITCH_GPIO (   name,
  v,
  on 
)
Value:
(((v)&~1) | ((on)? \
(name##_gpio_activestate==0?4:5): \
(name##_gpio_activestate==0?5:4)))

Definition at line 124 of file gpio-feature.c.

Function Documentation

EXPORT_SYMBOL_GPL ( ftr_gpio_methods  )
FTR_GPIO ( headphone  ,
 
)
FTR_GPIO ( amp  ,
 
)
FTR_GPIO ( lineout  ,
 
)
FTR_GPIO ( master  ,
 
)

Variable Documentation

struct gpio_methods* ftr_gpio_methods = &methods

Definition at line 421 of file gpio-feature.c.