Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
pinctrl-bcm2835.c File Reference
#include <linux/bitmap.h>
#include <linux/bug.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/irqdesc.h>
#include <linux/irqdomain.h>
#include <linux/module.h>
#include <linux/of_address.h>
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/pinctrl/consumer.h>
#include <linux/pinctrl/machine.h>
#include <linux/pinctrl/pinconf.h>
#include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinmux.h>
#include <linux/platform_device.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/types.h>

Go to the source code of this file.

Data Structures

struct  bcm2835_gpio_irqdata
 
struct  bcm2835_pinctrl
 

Macros

#define MODULE_NAME   "pinctrl-bcm2835"
 
#define BCM2835_NUM_GPIOS   54
 
#define BCM2835_NUM_BANKS   2
 
#define BCM2835_PIN_BITMAP_SZ   DIV_ROUND_UP(BCM2835_NUM_GPIOS, sizeof(unsigned long) * 8)
 
#define GPFSEL0   0x0 /* Function Select */
 
#define GPSET0   0x1c /* Pin Output Set */
 
#define GPCLR0   0x28 /* Pin Output Clear */
 
#define GPLEV0   0x34 /* Pin Level */
 
#define GPEDS0   0x40 /* Pin Event Detect Status */
 
#define GPREN0   0x4c /* Pin Rising Edge Detect Enable */
 
#define GPFEN0   0x58 /* Pin Falling Edge Detect Enable */
 
#define GPHEN0   0x64 /* Pin High Detect Enable */
 
#define GPLEN0   0x70 /* Pin Low Detect Enable */
 
#define GPAREN0   0x7c /* Pin Async Rising Edge Detect */
 
#define GPAFEN0   0x88 /* Pin Async Falling Edge Detect */
 
#define GPPUD   0x94 /* Pin Pull-up/down Enable */
 
#define GPPUDCLK0   0x98 /* Pin Pull-up/down Enable Clock */
 
#define FSEL_REG(p)   (GPFSEL0 + (((p) / 10) * 4))
 
#define FSEL_SHIFT(p)   (((p) % 10) * 3)
 
#define GPIO_REG_OFFSET(p)   ((p) / 32)
 
#define GPIO_REG_SHIFT(p)   ((p) % 32)
 
#define BCM2835_PINCONF_PACK(_param_, _arg_)   ((_param_) << 16 | (_arg_))
 
#define BCM2835_PINCONF_UNPACK_PARAM(_conf_)   ((_conf_) >> 16)
 
#define BCM2835_PINCONF_UNPACK_ARG(_conf_)   ((_conf_) & 0xffff)
 
#define BCM2835_GPIO_PIN(a)   PINCTRL_PIN(a, "gpio" #a)
 

Enumerations

enum  bcm2835_pinconf_param { BCM2835_PINCONF_PARAM_PULL }
 
enum  bcm2835_pinconf_pull { BCM2835_PINCONFIG_PULL_NONE, BCM2835_PINCONFIG_PULL_DOWN, BCM2835_PINCONFIG_PULL_UP }
 
enum  bcm2835_fsel {
  BCM2835_FSEL_GPIO_IN = 0, BCM2835_FSEL_GPIO_OUT = 1, BCM2835_FSEL_ALT0 = 4, BCM2835_FSEL_ALT1 = 5,
  BCM2835_FSEL_ALT2 = 6, BCM2835_FSEL_ALT3 = 7, BCM2835_FSEL_ALT4 = 3, BCM2835_FSEL_ALT5 = 2,
  BCM2835_FSEL_COUNT = 8, BCM2835_FSEL_MASK = 0x7
}
 

Functions

 MODULE_DEVICE_TABLE (of, bcm2835_pinctrl_match)
 
 module_platform_driver (bcm2835_pinctrl_driver)
 
 MODULE_AUTHOR ("Chris Boot, Simon Arlott, Stephen Warren")
 
 MODULE_DESCRIPTION ("BCM2835 Pin control driver")
 
 MODULE_LICENSE ("GPL")
 

Variables

struct pinctrl_pin_desc bcm2835_gpio_pins []
 
struct pinconf_ops bcm2835_pinconf_ops
 

Macro Definition Documentation

#define BCM2835_GPIO_PIN (   a)    PINCTRL_PIN(a, "gpio" #a)

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

#define BCM2835_NUM_BANKS   2

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

#define BCM2835_NUM_GPIOS   54

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

#define BCM2835_PIN_BITMAP_SZ   DIV_ROUND_UP(BCM2835_NUM_GPIOS, sizeof(unsigned long) * 8)

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

#define BCM2835_PINCONF_PACK (   _param_,
  _arg_ 
)    ((_param_) << 16 | (_arg_))

Definition at line 85 of file pinctrl-bcm2835.c.

#define BCM2835_PINCONF_UNPACK_ARG (   _conf_)    ((_conf_) & 0xffff)

Definition at line 87 of file pinctrl-bcm2835.c.

#define BCM2835_PINCONF_UNPACK_PARAM (   _conf_)    ((_conf_) >> 16)

Definition at line 86 of file pinctrl-bcm2835.c.

#define FSEL_REG (   p)    (GPFSEL0 + (((p) / 10) * 4))

Definition at line 69 of file pinctrl-bcm2835.c.

#define FSEL_SHIFT (   p)    (((p) % 10) * 3)

Definition at line 70 of file pinctrl-bcm2835.c.

#define GPAFEN0   0x88 /* Pin Async Falling Edge Detect */

Definition at line 65 of file pinctrl-bcm2835.c.

#define GPAREN0   0x7c /* Pin Async Rising Edge Detect */

Definition at line 64 of file pinctrl-bcm2835.c.

#define GPCLR0   0x28 /* Pin Output Clear */

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

#define GPEDS0   0x40 /* Pin Event Detect Status */

Definition at line 59 of file pinctrl-bcm2835.c.

#define GPFEN0   0x58 /* Pin Falling Edge Detect Enable */

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

#define GPFSEL0   0x0 /* Function Select */

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

#define GPHEN0   0x64 /* Pin High Detect Enable */

Definition at line 62 of file pinctrl-bcm2835.c.

#define GPIO_REG_OFFSET (   p)    ((p) / 32)

Definition at line 71 of file pinctrl-bcm2835.c.

#define GPIO_REG_SHIFT (   p)    ((p) % 32)

Definition at line 72 of file pinctrl-bcm2835.c.

#define GPLEN0   0x70 /* Pin Low Detect Enable */

Definition at line 63 of file pinctrl-bcm2835.c.

#define GPLEV0   0x34 /* Pin Level */

Definition at line 58 of file pinctrl-bcm2835.c.

#define GPPUD   0x94 /* Pin Pull-up/down Enable */

Definition at line 66 of file pinctrl-bcm2835.c.

#define GPPUDCLK0   0x98 /* Pin Pull-up/down Enable Clock */

Definition at line 67 of file pinctrl-bcm2835.c.

#define GPREN0   0x4c /* Pin Rising Edge Detect Enable */

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

#define GPSET0   0x1c /* Pin Output Set */

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

#define MODULE_NAME   "pinctrl-bcm2835"

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

Enumeration Type Documentation

Enumerator:
BCM2835_FSEL_GPIO_IN 
BCM2835_FSEL_GPIO_OUT 
BCM2835_FSEL_ALT0 
BCM2835_FSEL_ALT1 
BCM2835_FSEL_ALT2 
BCM2835_FSEL_ALT3 
BCM2835_FSEL_ALT4 
BCM2835_FSEL_ALT5 
BCM2835_FSEL_COUNT 
BCM2835_FSEL_MASK 

Definition at line 231 of file pinctrl-bcm2835.c.

Enumerator:
BCM2835_PINCONF_PARAM_PULL 

Definition at line 74 of file pinctrl-bcm2835.c.

Enumerator:
BCM2835_PINCONFIG_PULL_NONE 
BCM2835_PINCONFIG_PULL_DOWN 
BCM2835_PINCONFIG_PULL_UP 

Definition at line 79 of file pinctrl-bcm2835.c.

Function Documentation

MODULE_AUTHOR ( "Chris  Boot,
Simon  Arlott,
Stephen Warren"   
)
MODULE_DESCRIPTION ( "BCM2835 Pin control driver )
MODULE_DEVICE_TABLE ( of  ,
bcm2835_pinctrl_match   
)
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( bcm2835_pinctrl_driver  )

Variable Documentation

struct pinctrl_pin_desc bcm2835_gpio_pins[]

Definition at line 116 of file pinctrl-bcm2835.c.

struct pinconf_ops bcm2835_pinconf_ops
Initial value:
= {
.pin_config_get = bcm2835_pinconf_get,
.pin_config_set = bcm2835_pinconf_set,
}

Definition at line 919 of file pinctrl-bcm2835.c.