Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
pinctrl-coh901.c File Reference
#include <linux/module.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/io.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/gpio.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/pinctrl/consumer.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/platform_data/pinctrl-coh901.h>
#include "pinctrl-coh901.h"

Go to the source code of this file.

Data Structures

struct  u300_gpio
 
struct  u300_gpio_port
 
struct  u300_gpio_confdata
 

Macros

#define U300_GPIO_PORT_STRIDE   (0x30)
 
#define U300_GPIO_CR   (0x00)
 
#define U300_GPIO_CR_SYNC_SEL_ENABLE   (0x00000002UL)
 
#define U300_GPIO_CR_BLOCK_CLKRQ_ENABLE   (0x00000001UL)
 
#define U300_GPIO_PXPDIR   (0x04)
 
#define U300_GPIO_PXPDOR   (0x08)
 
#define U300_GPIO_PXPCR   (0x0C)
 
#define U300_GPIO_PXPCR_ALL_PINS_MODE_MASK   (0x0000FFFFUL)
 
#define U300_GPIO_PXPCR_PIN_MODE_MASK   (0x00000003UL)
 
#define U300_GPIO_PXPCR_PIN_MODE_SHIFT   (0x00000002UL)
 
#define U300_GPIO_PXPCR_PIN_MODE_INPUT   (0x00000000UL)
 
#define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_PUSH_PULL   (0x00000001UL)
 
#define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_DRAIN   (0x00000002UL)
 
#define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_SOURCE   (0x00000003UL)
 
#define U300_GPIO_PXPER   (0x10)
 
#define U300_GPIO_PXPER_ALL_PULL_UP_DISABLE_MASK   (0x000000FFUL)
 
#define U300_GPIO_PXPER_PULL_UP_DISABLE   (0x00000001UL)
 
#define U300_GPIO_PXIEV   (0x14)
 
#define U300_GPIO_PXIEN   (0x18)
 
#define U300_GPIO_PXIFR   (0x1C)
 
#define U300_GPIO_PXICR   (0x20)
 
#define U300_GPIO_PXICR_ALL_IRQ_CONFIG_MASK   (0x000000FFUL)
 
#define U300_GPIO_PXICR_IRQ_CONFIG_MASK   (0x00000001UL)
 
#define U300_GPIO_PXICR_IRQ_CONFIG_FALLING_EDGE   (0x00000000UL)
 
#define U300_GPIO_PXICR_IRQ_CONFIG_RISING_EDGE   (0x00000001UL)
 
#define U300_GPIO_PINS_PER_PORT   8
 
#define U300_GPIO_MAX   (U300_GPIO_PINS_PER_PORT * 7)
 
#define U300_PIN_REG(pin, reg)   (gpio->base + (pin >> 3) * gpio->stride + gpio->reg)
 
#define U300_PIN_BIT(pin)   (1 << (pin & 0x07))
 
#define BS335_GPIO_NUM_PORTS   7
 
#define U300_FLOATING_INPUT
 
#define U300_PULL_UP_INPUT
 
#define U300_OUTPUT_LOW
 
#define U300_OUTPUT_HIGH
 

Functions

int u300_gpio_config_get (struct gpio_chip *chip, unsigned offset, unsigned long *config)
 
int u300_gpio_config_set (struct gpio_chip *chip, unsigned offset, enum pin_config_param param)
 
 arch_initcall (u300_gpio_init)
 
 module_exit (u300_gpio_exit)
 
 MODULE_AUTHOR ("Linus Walleij <[email protected]>")
 
 MODULE_DESCRIPTION ("ST-Ericsson AB COH 901 335/COH 901 571/3 GPIO driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define BS335_GPIO_NUM_PORTS   7

Definition at line 115 of file pinctrl-coh901.c.

#define U300_FLOATING_INPUT
Value:
{ \
.bias_mode = PIN_CONFIG_BIAS_HIGH_IMPEDANCE, \
.output = false, \
}

Definition at line 117 of file pinctrl-coh901.c.

#define U300_GPIO_CR   (0x00)

Definition at line 34 of file pinctrl-coh901.c.

#define U300_GPIO_CR_BLOCK_CLKRQ_ENABLE   (0x00000001UL)

Definition at line 36 of file pinctrl-coh901.c.

#define U300_GPIO_CR_SYNC_SEL_ENABLE   (0x00000002UL)

Definition at line 35 of file pinctrl-coh901.c.

#define U300_GPIO_MAX   (U300_GPIO_PINS_PER_PORT * 7)

Definition at line 61 of file pinctrl-coh901.c.

#define U300_GPIO_PINS_PER_PORT   8

Definition at line 60 of file pinctrl-coh901.c.

#define U300_GPIO_PORT_STRIDE   (0x30)

Definition at line 27 of file pinctrl-coh901.c.

#define U300_GPIO_PXICR   (0x20)

Definition at line 53 of file pinctrl-coh901.c.

#define U300_GPIO_PXICR_ALL_IRQ_CONFIG_MASK   (0x000000FFUL)

Definition at line 54 of file pinctrl-coh901.c.

#define U300_GPIO_PXICR_IRQ_CONFIG_FALLING_EDGE   (0x00000000UL)

Definition at line 56 of file pinctrl-coh901.c.

#define U300_GPIO_PXICR_IRQ_CONFIG_MASK   (0x00000001UL)

Definition at line 55 of file pinctrl-coh901.c.

#define U300_GPIO_PXICR_IRQ_CONFIG_RISING_EDGE   (0x00000001UL)

Definition at line 57 of file pinctrl-coh901.c.

#define U300_GPIO_PXIEN   (0x18)

Definition at line 51 of file pinctrl-coh901.c.

#define U300_GPIO_PXIEV   (0x14)

Definition at line 50 of file pinctrl-coh901.c.

#define U300_GPIO_PXIFR   (0x1C)

Definition at line 52 of file pinctrl-coh901.c.

#define U300_GPIO_PXPCR   (0x0C)

Definition at line 39 of file pinctrl-coh901.c.

#define U300_GPIO_PXPCR_ALL_PINS_MODE_MASK   (0x0000FFFFUL)

Definition at line 40 of file pinctrl-coh901.c.

#define U300_GPIO_PXPCR_PIN_MODE_INPUT   (0x00000000UL)

Definition at line 43 of file pinctrl-coh901.c.

#define U300_GPIO_PXPCR_PIN_MODE_MASK   (0x00000003UL)

Definition at line 41 of file pinctrl-coh901.c.

#define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_DRAIN   (0x00000002UL)

Definition at line 45 of file pinctrl-coh901.c.

#define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_OPEN_SOURCE   (0x00000003UL)

Definition at line 46 of file pinctrl-coh901.c.

#define U300_GPIO_PXPCR_PIN_MODE_OUTPUT_PUSH_PULL   (0x00000001UL)

Definition at line 44 of file pinctrl-coh901.c.

#define U300_GPIO_PXPCR_PIN_MODE_SHIFT   (0x00000002UL)

Definition at line 42 of file pinctrl-coh901.c.

#define U300_GPIO_PXPDIR   (0x04)

Definition at line 37 of file pinctrl-coh901.c.

#define U300_GPIO_PXPDOR   (0x08)

Definition at line 38 of file pinctrl-coh901.c.

#define U300_GPIO_PXPER   (0x10)

Definition at line 47 of file pinctrl-coh901.c.

#define U300_GPIO_PXPER_ALL_PULL_UP_DISABLE_MASK   (0x000000FFUL)

Definition at line 48 of file pinctrl-coh901.c.

#define U300_GPIO_PXPER_PULL_UP_DISABLE   (0x00000001UL)

Definition at line 49 of file pinctrl-coh901.c.

#define U300_OUTPUT_HIGH
Value:
{ \
.output = true, \
.outval = 1, \
}

Definition at line 132 of file pinctrl-coh901.c.

#define U300_OUTPUT_LOW
Value:
{ \
.output = true, \
.outval = 0, \
}

Definition at line 127 of file pinctrl-coh901.c.

#define U300_PIN_BIT (   pin)    (1 << (pin & 0x07))

Definition at line 105 of file pinctrl-coh901.c.

#define U300_PIN_REG (   pin,
  reg 
)    (gpio->base + (pin >> 3) * gpio->stride + gpio->reg)

Definition at line 98 of file pinctrl-coh901.c.

#define U300_PULL_UP_INPUT
Value:
{ \
.bias_mode = PIN_CONFIG_BIAS_PULL_UP, \
.output = false, \
}

Definition at line 122 of file pinctrl-coh901.c.

Function Documentation

arch_initcall ( u300_gpio_init  )
MODULE_AUTHOR ( "Linus Walleij <[email protected]>"  )
MODULE_DESCRIPTION ( "ST-Ericsson AB COH 901 335/COH 901 571/3 GPIO driver )
module_exit ( u300_gpio_exit  )
MODULE_LICENSE ( "GPL"  )
int u300_gpio_config_get ( struct gpio_chip *  chip,
unsigned  offset,
unsigned long config 
)

Definition at line 325 of file pinctrl-coh901.c.

int u300_gpio_config_set ( struct gpio_chip *  chip,
unsigned  offset,
enum pin_config_param  param 
)

Definition at line 384 of file pinctrl-coh901.c.