| .. | .. |
|---|
| 1 | 1 | /* |
|---|
| 2 | 2 | * DaVinci GPIO Platform Related Defines |
|---|
| 3 | 3 | * |
|---|
| 4 | | - * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ |
|---|
| 4 | + * Copyright (C) 2013 Texas Instruments Incorporated - https://www.ti.com/ |
|---|
| 5 | 5 | * |
|---|
| 6 | 6 | * This program is free software; you can redistribute it and/or |
|---|
| 7 | 7 | * modify it under the terms of the GNU General Public License as |
|---|
| .. | .. |
|---|
| 16 | 16 | #ifndef __DAVINCI_GPIO_PLATFORM_H |
|---|
| 17 | 17 | #define __DAVINCI_GPIO_PLATFORM_H |
|---|
| 18 | 18 | |
|---|
| 19 | | -#include <linux/io.h> |
|---|
| 20 | | -#include <linux/spinlock.h> |
|---|
| 21 | | - |
|---|
| 22 | | -#include <asm-generic/gpio.h> |
|---|
| 23 | | - |
|---|
| 24 | | -#define MAX_REGS_BANKS 5 |
|---|
| 25 | | -#define MAX_INT_PER_BANK 32 |
|---|
| 26 | | - |
|---|
| 27 | 19 | struct davinci_gpio_platform_data { |
|---|
| 20 | + bool no_auto_base; |
|---|
| 21 | + u32 base; |
|---|
| 28 | 22 | u32 ngpio; |
|---|
| 29 | 23 | u32 gpio_unbanked; |
|---|
| 30 | 24 | }; |
|---|
| 31 | 25 | |
|---|
| 32 | | -struct davinci_gpio_irq_data { |
|---|
| 33 | | - void __iomem *regs; |
|---|
| 34 | | - struct davinci_gpio_controller *chip; |
|---|
| 35 | | - int bank_num; |
|---|
| 36 | | -}; |
|---|
| 37 | | - |
|---|
| 38 | | -struct davinci_gpio_controller { |
|---|
| 39 | | - struct gpio_chip chip; |
|---|
| 40 | | - struct irq_domain *irq_domain; |
|---|
| 41 | | - /* Serialize access to GPIO registers */ |
|---|
| 42 | | - spinlock_t lock; |
|---|
| 43 | | - void __iomem *regs[MAX_REGS_BANKS]; |
|---|
| 44 | | - int gpio_unbanked; |
|---|
| 45 | | - int irqs[MAX_INT_PER_BANK]; |
|---|
| 46 | | - unsigned int base; |
|---|
| 47 | | -}; |
|---|
| 48 | | - |
|---|
| 49 | | -/* |
|---|
| 50 | | - * basic gpio routines |
|---|
| 51 | | - */ |
|---|
| 52 | | -#define GPIO(X) (X) /* 0 <= X <= (DAVINCI_N_GPIO - 1) */ |
|---|
| 53 | | - |
|---|
| 54 | 26 | /* Convert GPIO signal to GPIO pin number */ |
|---|
| 55 | 27 | #define GPIO_TO_PIN(bank, gpio) (16 * (bank) + (gpio)) |
|---|
| 56 | 28 | |
|---|
| 57 | | -static inline u32 __gpio_mask(unsigned gpio) |
|---|
| 58 | | -{ |
|---|
| 59 | | - return 1 << (gpio % 32); |
|---|
| 60 | | -} |
|---|
| 61 | 29 | #endif |
|---|