Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
asic3.h File Reference
#include <linux/types.h>

Go to the source code of this file.

Data Structures

struct  asic3_led
 
struct  asic3_platform_data
 

Macros

#define ASIC3_NUM_GPIO_BANKS   4
 
#define ASIC3_GPIOS_PER_BANK   16
 
#define ASIC3_NUM_GPIOS   64
 
#define ASIC3_NR_IRQS   ASIC3_NUM_GPIOS + 6
 
#define ASIC3_IRQ_LED0   64
 
#define ASIC3_IRQ_LED1   65
 
#define ASIC3_IRQ_LED2   66
 
#define ASIC3_IRQ_SPI   67
 
#define ASIC3_IRQ_SMBUS   68
 
#define ASIC3_IRQ_OWM   69
 
#define ASIC3_TO_GPIO(gpio)   (NR_BUILTIN_GPIO + (gpio))
 
#define ASIC3_GPIO_BANK_A   0
 
#define ASIC3_GPIO_BANK_B   1
 
#define ASIC3_GPIO_BANK_C   2
 
#define ASIC3_GPIO_BANK_D   3
 
#define ASIC3_GPIO(bank, gpio)   ((ASIC3_GPIOS_PER_BANK * ASIC3_GPIO_BANK_##bank) + (gpio))
 
#define ASIC3_GPIO_bit(gpio)   (1 << (gpio & 0xf))
 
#define ASIC3_DEFAULT_ADDR_SHIFT   2
 
#define ASIC3_OFFSET(base, reg)   (ASIC3_##base##_BASE + ASIC3_##base##_##reg)
 
#define ASIC3_GPIO_OFFSET(base, reg)   (ASIC3_GPIO_##base##_BASE + ASIC3_GPIO_##reg)
 
#define ASIC3_GPIO_A_BASE   0x0000
 
#define ASIC3_GPIO_B_BASE   0x0100
 
#define ASIC3_GPIO_C_BASE   0x0200
 
#define ASIC3_GPIO_D_BASE   0x0300
 
#define ASIC3_GPIO_TO_BANK(gpio)   ((gpio) >> 4)
 
#define ASIC3_GPIO_TO_BIT(gpio)
 
#define ASIC3_GPIO_TO_MASK(gpio)   (1 << ASIC3_GPIO_TO_BIT(gpio))
 
#define ASIC3_GPIO_TO_BASE(gpio)   (ASIC3_GPIO_A_BASE + (((gpio) >> 4) * 0x0100))
 
#define ASIC3_BANK_TO_BASE(bank)   (ASIC3_GPIO_A_BASE + ((bank) * 0x100))
 
#define ASIC3_GPIO_MASK   0x00 /* R/W 0:don't mask */
 
#define ASIC3_GPIO_DIRECTION   0x04 /* R/W 0:input */
 
#define ASIC3_GPIO_OUT   0x08 /* R/W 0:output low */
 
#define ASIC3_GPIO_TRIGGER_TYPE   0x0c /* R/W 0:level */
 
#define ASIC3_GPIO_EDGE_TRIGGER   0x10 /* R/W 0:falling */
 
#define ASIC3_GPIO_LEVEL_TRIGGER   0x14 /* R/W 0:low level detect */
 
#define ASIC3_GPIO_SLEEP_MASK   0x18 /* R/W 0:don't mask in sleep mode */
 
#define ASIC3_GPIO_SLEEP_OUT   0x1c /* R/W level 0:low in sleep mode */
 
#define ASIC3_GPIO_BAT_FAULT_OUT   0x20 /* R/W level 0:low in batt_fault */
 
#define ASIC3_GPIO_INT_STATUS   0x24 /* R/W 0:none, 1:detect */
 
#define ASIC3_GPIO_ALT_FUNCTION   0x28 /* R/W 1:LED register control */
 
#define ASIC3_GPIO_SLEEP_CONF
 
#define ASIC3_GPIO_STATUS   0x30 /* R Pin status */
 
#define ASIC3_CONFIG_GPIO_PIN(config)   ((config) & 0x7f)
 
#define ASIC3_CONFIG_GPIO_ALT(config)   (((config) & (0x7f << 7)) >> 7)
 
#define ASIC3_CONFIG_GPIO_DIR(config)   ((config & (1 << 14)) >> 14)
 
#define ASIC3_CONFIG_GPIO_INIT(config)   ((config & (1 << 15)) >> 15)
 
#define ASIC3_CONFIG_GPIO(gpio, alt, dir, init)
 
#define ASIC3_CONFIG_GPIO_DEFAULT(gpio, dir, init)   ASIC3_CONFIG_GPIO((gpio), 0, (dir), (init))
 
#define ASIC3_CONFIG_GPIO_DEFAULT_OUT(gpio, init)   ASIC3_CONFIG_GPIO((gpio), 0, 1, (init))
 
#define ASIC3_GPIOA11_PWM0   ASIC3_CONFIG_GPIO(11, 1, 1, 0)
 
#define ASIC3_GPIOA12_PWM1   ASIC3_CONFIG_GPIO(12, 1, 1, 0)
 
#define ASIC3_GPIOA15_CONTROL_CX   ASIC3_CONFIG_GPIO(15, 1, 1, 0)
 
#define ASIC3_GPIOC0_LED0   ASIC3_CONFIG_GPIO(32, 1, 0, 0)
 
#define ASIC3_GPIOC1_LED1   ASIC3_CONFIG_GPIO(33, 1, 0, 0)
 
#define ASIC3_GPIOC2_LED2   ASIC3_CONFIG_GPIO(34, 1, 0, 0)
 
#define ASIC3_GPIOC3_SPI_RXD   ASIC3_CONFIG_GPIO(35, 1, 0, 0)
 
#define ASIC3_GPIOC4_CF_nCD   ASIC3_CONFIG_GPIO(36, 1, 0, 0)
 
#define ASIC3_GPIOC4_SPI_TXD   ASIC3_CONFIG_GPIO(36, 1, 1, 0)
 
#define ASIC3_GPIOC5_SPI_CLK   ASIC3_CONFIG_GPIO(37, 1, 1, 0)
 
#define ASIC3_GPIOC5_nCIOW   ASIC3_CONFIG_GPIO(37, 1, 1, 0)
 
#define ASIC3_GPIOC6_nCIOR   ASIC3_CONFIG_GPIO(38, 1, 1, 0)
 
#define ASIC3_GPIOC7_nPCE_1   ASIC3_CONFIG_GPIO(39, 1, 0, 0)
 
#define ASIC3_GPIOC8_nPCE_2   ASIC3_CONFIG_GPIO(40, 1, 0, 0)
 
#define ASIC3_GPIOC9_nPOE   ASIC3_CONFIG_GPIO(41, 1, 0, 0)
 
#define ASIC3_GPIOC10_nPWE   ASIC3_CONFIG_GPIO(42, 1, 0, 0)
 
#define ASIC3_GPIOC11_PSKTSEL   ASIC3_CONFIG_GPIO(43, 1, 0, 0)
 
#define ASIC3_GPIOC12_nPREG   ASIC3_CONFIG_GPIO(44, 1, 0, 0)
 
#define ASIC3_GPIOC13_nPWAIT   ASIC3_CONFIG_GPIO(45, 1, 1, 0)
 
#define ASIC3_GPIOC14_nPIOIS16   ASIC3_CONFIG_GPIO(46, 1, 1, 0)
 
#define ASIC3_GPIOC15_nPIOR   ASIC3_CONFIG_GPIO(47, 1, 0, 0)
 
#define ASIC3_GPIOD4_CF_nCD   ASIC3_CONFIG_GPIO(52, 1, 0, 0)
 
#define ASIC3_GPIOD11_nCIOIS16   ASIC3_CONFIG_GPIO(59, 1, 0, 0)
 
#define ASIC3_GPIOD12_nCWAIT   ASIC3_CONFIG_GPIO(60, 1, 0, 0)
 
#define ASIC3_GPIOD15_nPIOW   ASIC3_CONFIG_GPIO(63, 1, 0, 0)
 
#define ASIC3_SPI_Base   0x0400
 
#define ASIC3_SPI_Control   0x0000
 
#define ASIC3_SPI_TxData   0x0004
 
#define ASIC3_SPI_RxData   0x0008
 
#define ASIC3_SPI_Int   0x000c
 
#define ASIC3_SPI_Status   0x0010
 
#define SPI_CONTROL_SPR(clk)   ((clk) & 0x0f) /* Clock rate */
 
#define ASIC3_PWM_0_Base   0x0500
 
#define ASIC3_PWM_1_Base   0x0600
 
#define ASIC3_PWM_TimeBase   0x0000
 
#define ASIC3_PWM_PeriodTime   0x0004
 
#define ASIC3_PWM_DutyTime   0x0008
 
#define PWM_TIMEBASE_VALUE(x)   ((x)&0xf) /* Low 4 bits sets time base */
 
#define PWM_TIMEBASE_ENABLE   (1 << 4) /* Enable clock */
 
#define ASIC3_NUM_LEDS   3
 
#define ASIC3_LED_0_Base   0x0700
 
#define ASIC3_LED_1_Base   0x0800
 
#define ASIC3_LED_2_Base   0x0900
 
#define ASIC3_LED_TimeBase   0x0000 /* R/W 7 bits */
 
#define ASIC3_LED_PeriodTime   0x0004 /* R/W 12 bits */
 
#define ASIC3_LED_DutyTime   0x0008 /* R/W 12 bits */
 
#define ASIC3_LED_AutoStopCount   0x000c /* R/W 16 bits */
 
#define LED_TBS   0x0f /* Low 4 bits sets time base, max = 13 */
 
#define LED_EN   (1 << 4) /* LED ON/OFF 0:off, 1:on */
 
#define LED_AUTOSTOP   (1 << 5) /* LED ON/OFF auto stop 0:disable, 1:enable */
 
#define LED_ALWAYS   (1 << 6) /* LED Interrupt Mask 0:No mask, 1:mask */
 
#define ASIC3_CLOCK_BASE   0x0A00
 
#define ASIC3_CLOCK_CDEX   0x00
 
#define ASIC3_CLOCK_SEL   0x04
 
#define CLOCK_CDEX_SOURCE   (1 << 0) /* 2 bits */
 
#define CLOCK_CDEX_SOURCE0   (1 << 0)
 
#define CLOCK_CDEX_SOURCE1   (1 << 1)
 
#define CLOCK_CDEX_SPI   (1 << 2)
 
#define CLOCK_CDEX_OWM   (1 << 3)
 
#define CLOCK_CDEX_PWM0   (1 << 4)
 
#define CLOCK_CDEX_PWM1   (1 << 5)
 
#define CLOCK_CDEX_LED0   (1 << 6)
 
#define CLOCK_CDEX_LED1   (1 << 7)
 
#define CLOCK_CDEX_LED2   (1 << 8)
 
#define CLOCK_CDEX_SD_HOST   (1 << 9) /* R/W: SD host clock source */
 
#define CLOCK_CDEX_SD_BUS   (1 << 10) /* R/W: SD bus clock source ctrl */
 
#define CLOCK_CDEX_SMBUS   (1 << 11)
 
#define CLOCK_CDEX_CONTROL_CX   (1 << 12)
 
#define CLOCK_CDEX_EX0   (1 << 13) /* R/W: 32.768 kHz crystal */
 
#define CLOCK_CDEX_EX1   (1 << 14) /* R/W: 24.576 MHz crystal */
 
#define CLOCK_SEL_SD_HCLK_SEL   (1 << 0) /* R/W: SDIO host clock select */
 
#define CLOCK_SEL_SD_BCLK_SEL   (1 << 1) /* R/W: SDIO bus clock select */
 
#define CLOCK_SEL_CX   (1 << 2)
 
#define ASIC3_INTR_BASE   0x0B00
 
#define ASIC3_INTR_INT_MASK   0x00 /* Interrupt mask control */
 
#define ASIC3_INTR_P_INT_STAT   0x04 /* Peripheral interrupt status */
 
#define ASIC3_INTR_INT_CPS   0x08 /* Interrupt timer clock pre-scale */
 
#define ASIC3_INTR_INT_TBS   0x0c /* Interrupt timer set */
 
#define ASIC3_INTMASK_GINTMASK   (1 << 0) /* Global INTs mask 1:enable */
 
#define ASIC3_INTMASK_GINTEL   (1 << 1) /* 1: rising edge, 0: hi level */
 
#define ASIC3_INTMASK_MASK0   (1 << 2)
 
#define ASIC3_INTMASK_MASK1   (1 << 3)
 
#define ASIC3_INTMASK_MASK2   (1 << 4)
 
#define ASIC3_INTMASK_MASK3   (1 << 5)
 
#define ASIC3_INTMASK_MASK4   (1 << 6)
 
#define ASIC3_INTMASK_MASK5   (1 << 7)
 
#define ASIC3_INTR_PERIPHERAL_A   (1 << 0)
 
#define ASIC3_INTR_PERIPHERAL_B   (1 << 1)
 
#define ASIC3_INTR_PERIPHERAL_C   (1 << 2)
 
#define ASIC3_INTR_PERIPHERAL_D   (1 << 3)
 
#define ASIC3_INTR_LED0   (1 << 4)
 
#define ASIC3_INTR_LED1   (1 << 5)
 
#define ASIC3_INTR_LED2   (1 << 6)
 
#define ASIC3_INTR_SPI   (1 << 7)
 
#define ASIC3_INTR_SMBUS   (1 << 8)
 
#define ASIC3_INTR_OWM   (1 << 9)
 
#define ASIC3_INTR_CPS(x)   ((x)&0x0f) /* 4 bits, max 14 */
 
#define ASIC3_INTR_CPS_SET   (1 << 4) /* Time base enable */
 
#define ASIC3_SDHWCTRL_BASE   0x0E00
 
#define ASIC3_SDHWCTRL_SDCONF   0x00
 
#define ASIC3_SDHWCTRL_SUSPEND   (1 << 0) /* 1=suspend all SD operations */
 
#define ASIC3_SDHWCTRL_CLKSEL   (1 << 1) /* 1=SDICK, 0=HCLK */
 
#define ASIC3_SDHWCTRL_PCLR   (1 << 2) /* All registers of SDIO cleared */
 
#define ASIC3_SDHWCTRL_LEVCD   (1 << 3) /* SD card detection: 0:low */
 
#define ASIC3_SDHWCTRL_LEVWP   (1 << 4)
 
#define ASIC3_SDHWCTRL_SDLED   (1 << 5) /* SD card LED signal 0=disable */
 
#define ASIC3_SDHWCTRL_SDPWR   (1 << 6)
 
#define ASIC3_EXTCF_BASE   0x1100
 
#define ASIC3_EXTCF_SELECT   0x00
 
#define ASIC3_EXTCF_RESET   0x04
 
#define ASIC3_EXTCF_SMOD0   (1 << 0) /* slot number of mode 0 */
 
#define ASIC3_EXTCF_SMOD1   (1 << 1) /* slot number of mode 1 */
 
#define ASIC3_EXTCF_SMOD2   (1 << 2) /* slot number of mode 2 */
 
#define ASIC3_EXTCF_OWM_EN   (1 << 4) /* enable onewire module */
 
#define ASIC3_EXTCF_OWM_SMB   (1 << 5) /* OWM bus selection */
 
#define ASIC3_EXTCF_OWM_RESET   (1 << 6) /* ?? used by OWM and CF */
 
#define ASIC3_EXTCF_CF0_SLEEP_MODE   (1 << 7) /* CF0 sleep state */
 
#define ASIC3_EXTCF_CF1_SLEEP_MODE   (1 << 8) /* CF1 sleep state */
 
#define ASIC3_EXTCF_CF0_PWAIT_EN   (1 << 10) /* CF0 PWAIT_n control */
 
#define ASIC3_EXTCF_CF1_PWAIT_EN   (1 << 11) /* CF1 PWAIT_n control */
 
#define ASIC3_EXTCF_CF0_BUF_EN   (1 << 12) /* CF0 buffer control */
 
#define ASIC3_EXTCF_CF1_BUF_EN   (1 << 13) /* CF1 buffer control */
 
#define ASIC3_EXTCF_SD_MEM_ENABLE   (1 << 14)
 
#define ASIC3_EXTCF_CF_SLEEP   (1 << 15) /* CF sleep mode control */
 
#define ASIC3_OWM_BASE   0xC00
 
#define ASIC3_SD_CONFIG_BASE   0x0400 /* Assumes 32 bit addressing */
 
#define ASIC3_SD_CONFIG_SIZE   0x0200 /* Assumes 32 bit addressing */
 
#define ASIC3_SD_CTRL_BASE   0x1000
 
#define ASIC3_SDIO_CTRL_BASE   0x1200
 
#define ASIC3_MAP_SIZE_32BIT   0x2000
 
#define ASIC3_MAP_SIZE_16BIT   0x1000
 

Functions

void asic3_write_register (struct asic3 *asic, unsigned int reg, u32 val)
 
u32 asic3_read_register (struct asic3 *asic, unsigned int reg)
 

Macro Definition Documentation

#define ASIC3_BANK_TO_BASE (   bank)    (ASIC3_GPIO_A_BASE + ((bank) * 0x100))

Definition at line 78 of file asic3.h.

#define ASIC3_CLOCK_BASE   0x0A00

Definition at line 183 of file asic3.h.

#define ASIC3_CLOCK_CDEX   0x00

Definition at line 184 of file asic3.h.

#define ASIC3_CLOCK_SEL   0x04

Definition at line 185 of file asic3.h.

#define ASIC3_CONFIG_GPIO (   gpio,
  alt,
  dir,
  init 
)
Value:
(((gpio) & 0x7f) \
| (((alt) & 0x7f) << 7) | (((dir) & 0x1) << 14) \
| (((init) & 0x1) << 15))

Definition at line 107 of file asic3.h.

#define ASIC3_CONFIG_GPIO_ALT (   config)    (((config) & (0x7f << 7)) >> 7)

Definition at line 104 of file asic3.h.

#define ASIC3_CONFIG_GPIO_DEFAULT (   gpio,
  dir,
  init 
)    ASIC3_CONFIG_GPIO((gpio), 0, (dir), (init))

Definition at line 110 of file asic3.h.

#define ASIC3_CONFIG_GPIO_DEFAULT_OUT (   gpio,
  init 
)    ASIC3_CONFIG_GPIO((gpio), 0, 1, (init))

Definition at line 112 of file asic3.h.

#define ASIC3_CONFIG_GPIO_DIR (   config)    ((config & (1 << 14)) >> 14)

Definition at line 105 of file asic3.h.

#define ASIC3_CONFIG_GPIO_INIT (   config)    ((config & (1 << 15)) >> 15)

Definition at line 106 of file asic3.h.

#define ASIC3_CONFIG_GPIO_PIN (   config)    ((config) & 0x7f)

Definition at line 103 of file asic3.h.

#define ASIC3_DEFAULT_ADDR_SHIFT   2

Definition at line 62 of file asic3.h.

#define ASIC3_EXTCF_BASE   0x1100

Definition at line 261 of file asic3.h.

#define ASIC3_EXTCF_CF0_BUF_EN   (1 << 12) /* CF0 buffer control */

Definition at line 276 of file asic3.h.

#define ASIC3_EXTCF_CF0_PWAIT_EN   (1 << 10) /* CF0 PWAIT_n control */

Definition at line 274 of file asic3.h.

#define ASIC3_EXTCF_CF0_SLEEP_MODE   (1 << 7) /* CF0 sleep state */

Definition at line 272 of file asic3.h.

#define ASIC3_EXTCF_CF1_BUF_EN   (1 << 13) /* CF1 buffer control */

Definition at line 277 of file asic3.h.

#define ASIC3_EXTCF_CF1_PWAIT_EN   (1 << 11) /* CF1 PWAIT_n control */

Definition at line 275 of file asic3.h.

#define ASIC3_EXTCF_CF1_SLEEP_MODE   (1 << 8) /* CF1 sleep state */

Definition at line 273 of file asic3.h.

#define ASIC3_EXTCF_CF_SLEEP   (1 << 15) /* CF sleep mode control */

Definition at line 279 of file asic3.h.

#define ASIC3_EXTCF_OWM_EN   (1 << 4) /* enable onewire module */

Definition at line 269 of file asic3.h.

#define ASIC3_EXTCF_OWM_RESET   (1 << 6) /* ?? used by OWM and CF */

Definition at line 271 of file asic3.h.

#define ASIC3_EXTCF_OWM_SMB   (1 << 5) /* OWM bus selection */

Definition at line 270 of file asic3.h.

#define ASIC3_EXTCF_RESET   0x04

Definition at line 264 of file asic3.h.

#define ASIC3_EXTCF_SD_MEM_ENABLE   (1 << 14)

Definition at line 278 of file asic3.h.

#define ASIC3_EXTCF_SELECT   0x00

Definition at line 263 of file asic3.h.

#define ASIC3_EXTCF_SMOD0   (1 << 0) /* slot number of mode 0 */

Definition at line 266 of file asic3.h.

#define ASIC3_EXTCF_SMOD1   (1 << 1) /* slot number of mode 1 */

Definition at line 267 of file asic3.h.

#define ASIC3_EXTCF_SMOD2   (1 << 2) /* slot number of mode 2 */

Definition at line 268 of file asic3.h.

#define ASIC3_GPIO (   bank,
  gpio 
)    ((ASIC3_GPIOS_PER_BANK * ASIC3_GPIO_BANK_##bank) + (gpio))

Definition at line 58 of file asic3.h.

#define ASIC3_GPIO_A_BASE   0x0000

Definition at line 68 of file asic3.h.

#define ASIC3_GPIO_ALT_FUNCTION   0x28 /* R/W 1:LED register control */

Definition at line 90 of file asic3.h.

#define ASIC3_GPIO_B_BASE   0x0100

Definition at line 69 of file asic3.h.

#define ASIC3_GPIO_BANK_A   0

Definition at line 53 of file asic3.h.

#define ASIC3_GPIO_BANK_B   1

Definition at line 54 of file asic3.h.

#define ASIC3_GPIO_BANK_C   2

Definition at line 55 of file asic3.h.

#define ASIC3_GPIO_BANK_D   3

Definition at line 56 of file asic3.h.

#define ASIC3_GPIO_BAT_FAULT_OUT   0x20 /* R/W level 0:low in batt_fault */

Definition at line 88 of file asic3.h.

#define ASIC3_GPIO_bit (   gpio)    (1 << (gpio & 0xf))

Definition at line 60 of file asic3.h.

#define ASIC3_GPIO_C_BASE   0x0200

Definition at line 70 of file asic3.h.

#define ASIC3_GPIO_D_BASE   0x0300

Definition at line 71 of file asic3.h.

#define ASIC3_GPIO_DIRECTION   0x04 /* R/W 0:input */

Definition at line 81 of file asic3.h.

#define ASIC3_GPIO_EDGE_TRIGGER   0x10 /* R/W 0:falling */

Definition at line 84 of file asic3.h.

#define ASIC3_GPIO_INT_STATUS   0x24 /* R/W 0:none, 1:detect */

Definition at line 89 of file asic3.h.

#define ASIC3_GPIO_LEVEL_TRIGGER   0x14 /* R/W 0:low level detect */

Definition at line 85 of file asic3.h.

#define ASIC3_GPIO_MASK   0x00 /* R/W 0:don't mask */

Definition at line 80 of file asic3.h.

#define ASIC3_GPIO_OFFSET (   base,
  reg 
)    (ASIC3_GPIO_##base##_BASE + ASIC3_GPIO_##reg)

Definition at line 65 of file asic3.h.

#define ASIC3_GPIO_OUT   0x08 /* R/W 0:output low */

Definition at line 82 of file asic3.h.

#define ASIC3_GPIO_SLEEP_CONF
Value:
0x2c /*
* R/W bit 1: autosleep
* 0: disable gposlpout in normal mode,
* enable gposlpout in sleep mode.
*/

Definition at line 91 of file asic3.h.

#define ASIC3_GPIO_SLEEP_MASK   0x18 /* R/W 0:don't mask in sleep mode */

Definition at line 86 of file asic3.h.

#define ASIC3_GPIO_SLEEP_OUT   0x1c /* R/W level 0:low in sleep mode */

Definition at line 87 of file asic3.h.

#define ASIC3_GPIO_STATUS   0x30 /* R Pin status */

Definition at line 92 of file asic3.h.

#define ASIC3_GPIO_TO_BANK (   gpio)    ((gpio) >> 4)

Definition at line 73 of file asic3.h.

#define ASIC3_GPIO_TO_BASE (   gpio)    (ASIC3_GPIO_A_BASE + (((gpio) >> 4) * 0x0100))

Definition at line 77 of file asic3.h.

#define ASIC3_GPIO_TO_BIT (   gpio)
Value:
((gpio) - \
(ASIC3_GPIOS_PER_BANK * ((gpio) >> 4)))

Definition at line 74 of file asic3.h.

#define ASIC3_GPIO_TO_MASK (   gpio)    (1 << ASIC3_GPIO_TO_BIT(gpio))

Definition at line 76 of file asic3.h.

#define ASIC3_GPIO_TRIGGER_TYPE   0x0c /* R/W 0:level */

Definition at line 83 of file asic3.h.

#define ASIC3_GPIOA11_PWM0   ASIC3_CONFIG_GPIO(11, 1, 1, 0)

Definition at line 118 of file asic3.h.

#define ASIC3_GPIOA12_PWM1   ASIC3_CONFIG_GPIO(12, 1, 1, 0)

Definition at line 119 of file asic3.h.

#define ASIC3_GPIOA15_CONTROL_CX   ASIC3_CONFIG_GPIO(15, 1, 1, 0)

Definition at line 120 of file asic3.h.

#define ASIC3_GPIOC0_LED0   ASIC3_CONFIG_GPIO(32, 1, 0, 0)

Definition at line 121 of file asic3.h.

#define ASIC3_GPIOC10_nPWE   ASIC3_CONFIG_GPIO(42, 1, 0, 0)

Definition at line 133 of file asic3.h.

#define ASIC3_GPIOC11_PSKTSEL   ASIC3_CONFIG_GPIO(43, 1, 0, 0)

Definition at line 134 of file asic3.h.

#define ASIC3_GPIOC12_nPREG   ASIC3_CONFIG_GPIO(44, 1, 0, 0)

Definition at line 135 of file asic3.h.

#define ASIC3_GPIOC13_nPWAIT   ASIC3_CONFIG_GPIO(45, 1, 1, 0)

Definition at line 136 of file asic3.h.

#define ASIC3_GPIOC14_nPIOIS16   ASIC3_CONFIG_GPIO(46, 1, 1, 0)

Definition at line 137 of file asic3.h.

#define ASIC3_GPIOC15_nPIOR   ASIC3_CONFIG_GPIO(47, 1, 0, 0)

Definition at line 138 of file asic3.h.

#define ASIC3_GPIOC1_LED1   ASIC3_CONFIG_GPIO(33, 1, 0, 0)

Definition at line 122 of file asic3.h.

#define ASIC3_GPIOC2_LED2   ASIC3_CONFIG_GPIO(34, 1, 0, 0)

Definition at line 123 of file asic3.h.

#define ASIC3_GPIOC3_SPI_RXD   ASIC3_CONFIG_GPIO(35, 1, 0, 0)

Definition at line 124 of file asic3.h.

#define ASIC3_GPIOC4_CF_nCD   ASIC3_CONFIG_GPIO(36, 1, 0, 0)

Definition at line 125 of file asic3.h.

#define ASIC3_GPIOC4_SPI_TXD   ASIC3_CONFIG_GPIO(36, 1, 1, 0)

Definition at line 126 of file asic3.h.

#define ASIC3_GPIOC5_nCIOW   ASIC3_CONFIG_GPIO(37, 1, 1, 0)

Definition at line 128 of file asic3.h.

#define ASIC3_GPIOC5_SPI_CLK   ASIC3_CONFIG_GPIO(37, 1, 1, 0)

Definition at line 127 of file asic3.h.

#define ASIC3_GPIOC6_nCIOR   ASIC3_CONFIG_GPIO(38, 1, 1, 0)

Definition at line 129 of file asic3.h.

#define ASIC3_GPIOC7_nPCE_1   ASIC3_CONFIG_GPIO(39, 1, 0, 0)

Definition at line 130 of file asic3.h.

#define ASIC3_GPIOC8_nPCE_2   ASIC3_CONFIG_GPIO(40, 1, 0, 0)

Definition at line 131 of file asic3.h.

#define ASIC3_GPIOC9_nPOE   ASIC3_CONFIG_GPIO(41, 1, 0, 0)

Definition at line 132 of file asic3.h.

#define ASIC3_GPIOD11_nCIOIS16   ASIC3_CONFIG_GPIO(59, 1, 0, 0)

Definition at line 140 of file asic3.h.

#define ASIC3_GPIOD12_nCWAIT   ASIC3_CONFIG_GPIO(60, 1, 0, 0)

Definition at line 141 of file asic3.h.

#define ASIC3_GPIOD15_nPIOW   ASIC3_CONFIG_GPIO(63, 1, 0, 0)

Definition at line 142 of file asic3.h.

#define ASIC3_GPIOD4_CF_nCD   ASIC3_CONFIG_GPIO(52, 1, 0, 0)

Definition at line 139 of file asic3.h.

#define ASIC3_GPIOS_PER_BANK   16

Definition at line 40 of file asic3.h.

#define ASIC3_INTMASK_GINTEL   (1 << 1) /* 1: rising edge, 0: hi level */

Definition at line 222 of file asic3.h.

#define ASIC3_INTMASK_GINTMASK   (1 << 0) /* Global INTs mask 1:enable */

Definition at line 221 of file asic3.h.

#define ASIC3_INTMASK_MASK0   (1 << 2)

Definition at line 223 of file asic3.h.

#define ASIC3_INTMASK_MASK1   (1 << 3)

Definition at line 224 of file asic3.h.

#define ASIC3_INTMASK_MASK2   (1 << 4)

Definition at line 225 of file asic3.h.

#define ASIC3_INTMASK_MASK3   (1 << 5)

Definition at line 226 of file asic3.h.

#define ASIC3_INTMASK_MASK4   (1 << 6)

Definition at line 227 of file asic3.h.

#define ASIC3_INTMASK_MASK5   (1 << 7)

Definition at line 228 of file asic3.h.

#define ASIC3_INTR_BASE   0x0B00

Definition at line 214 of file asic3.h.

#define ASIC3_INTR_CPS (   x)    ((x)&0x0f) /* 4 bits, max 14 */

Definition at line 241 of file asic3.h.

#define ASIC3_INTR_CPS_SET   (1 << 4) /* Time base enable */

Definition at line 242 of file asic3.h.

#define ASIC3_INTR_INT_CPS   0x08 /* Interrupt timer clock pre-scale */

Definition at line 218 of file asic3.h.

#define ASIC3_INTR_INT_MASK   0x00 /* Interrupt mask control */

Definition at line 216 of file asic3.h.

#define ASIC3_INTR_INT_TBS   0x0c /* Interrupt timer set */

Definition at line 219 of file asic3.h.

#define ASIC3_INTR_LED0   (1 << 4)

Definition at line 234 of file asic3.h.

#define ASIC3_INTR_LED1   (1 << 5)

Definition at line 235 of file asic3.h.

#define ASIC3_INTR_LED2   (1 << 6)

Definition at line 236 of file asic3.h.

#define ASIC3_INTR_OWM   (1 << 9)

Definition at line 239 of file asic3.h.

#define ASIC3_INTR_P_INT_STAT   0x04 /* Peripheral interrupt status */

Definition at line 217 of file asic3.h.

#define ASIC3_INTR_PERIPHERAL_A   (1 << 0)

Definition at line 230 of file asic3.h.

#define ASIC3_INTR_PERIPHERAL_B   (1 << 1)

Definition at line 231 of file asic3.h.

#define ASIC3_INTR_PERIPHERAL_C   (1 << 2)

Definition at line 232 of file asic3.h.

#define ASIC3_INTR_PERIPHERAL_D   (1 << 3)

Definition at line 233 of file asic3.h.

#define ASIC3_INTR_SMBUS   (1 << 8)

Definition at line 238 of file asic3.h.

#define ASIC3_INTR_SPI   (1 << 7)

Definition at line 237 of file asic3.h.

#define ASIC3_IRQ_LED0   64

Definition at line 44 of file asic3.h.

#define ASIC3_IRQ_LED1   65

Definition at line 45 of file asic3.h.

#define ASIC3_IRQ_LED2   66

Definition at line 46 of file asic3.h.

#define ASIC3_IRQ_OWM   69

Definition at line 49 of file asic3.h.

#define ASIC3_IRQ_SMBUS   68

Definition at line 48 of file asic3.h.

#define ASIC3_IRQ_SPI   67

Definition at line 47 of file asic3.h.

#define ASIC3_LED_0_Base   0x0700

Definition at line 164 of file asic3.h.

#define ASIC3_LED_1_Base   0x0800

Definition at line 165 of file asic3.h.

#define ASIC3_LED_2_Base   0x0900

Definition at line 166 of file asic3.h.

#define ASIC3_LED_AutoStopCount   0x000c /* R/W 16 bits */

Definition at line 170 of file asic3.h.

#define ASIC3_LED_DutyTime   0x0008 /* R/W 12 bits */

Definition at line 169 of file asic3.h.

#define ASIC3_LED_PeriodTime   0x0004 /* R/W 12 bits */

Definition at line 168 of file asic3.h.

#define ASIC3_LED_TimeBase   0x0000 /* R/W 7 bits */

Definition at line 167 of file asic3.h.

#define ASIC3_MAP_SIZE_16BIT   0x1000

Definition at line 304 of file asic3.h.

#define ASIC3_MAP_SIZE_32BIT   0x2000

Definition at line 303 of file asic3.h.

#define ASIC3_NR_IRQS   ASIC3_NUM_GPIOS + 6

Definition at line 42 of file asic3.h.

#define ASIC3_NUM_GPIO_BANKS   4

Definition at line 39 of file asic3.h.

#define ASIC3_NUM_GPIOS   64

Definition at line 41 of file asic3.h.

#define ASIC3_NUM_LEDS   3

Definition at line 163 of file asic3.h.

#define ASIC3_OFFSET (   base,
  reg 
)    (ASIC3_##base##_BASE + ASIC3_##base##_##reg)

Definition at line 64 of file asic3.h.

#define ASIC3_OWM_BASE   0xC00

Definition at line 287 of file asic3.h.

#define ASIC3_PWM_0_Base   0x0500

Definition at line 154 of file asic3.h.

#define ASIC3_PWM_1_Base   0x0600

Definition at line 155 of file asic3.h.

#define ASIC3_PWM_DutyTime   0x0008

Definition at line 158 of file asic3.h.

#define ASIC3_PWM_PeriodTime   0x0004

Definition at line 157 of file asic3.h.

#define ASIC3_PWM_TimeBase   0x0000

Definition at line 156 of file asic3.h.

#define ASIC3_SD_CONFIG_BASE   0x0400 /* Assumes 32 bit addressing */

Definition at line 298 of file asic3.h.

#define ASIC3_SD_CONFIG_SIZE   0x0200 /* Assumes 32 bit addressing */

Definition at line 299 of file asic3.h.

#define ASIC3_SD_CTRL_BASE   0x1000

Definition at line 300 of file asic3.h.

#define ASIC3_SDHWCTRL_BASE   0x0E00

Definition at line 246 of file asic3.h.

#define ASIC3_SDHWCTRL_CLKSEL   (1 << 1) /* 1=SDICK, 0=HCLK */

Definition at line 250 of file asic3.h.

#define ASIC3_SDHWCTRL_LEVCD   (1 << 3) /* SD card detection: 0:low */

Definition at line 252 of file asic3.h.

#define ASIC3_SDHWCTRL_LEVWP   (1 << 4)

Definition at line 255 of file asic3.h.

#define ASIC3_SDHWCTRL_PCLR   (1 << 2) /* All registers of SDIO cleared */

Definition at line 251 of file asic3.h.

#define ASIC3_SDHWCTRL_SDCONF   0x00

Definition at line 247 of file asic3.h.

#define ASIC3_SDHWCTRL_SDLED   (1 << 5) /* SD card LED signal 0=disable */

Definition at line 256 of file asic3.h.

#define ASIC3_SDHWCTRL_SDPWR   (1 << 6)

Definition at line 259 of file asic3.h.

#define ASIC3_SDHWCTRL_SUSPEND   (1 << 0) /* 1=suspend all SD operations */

Definition at line 249 of file asic3.h.

#define ASIC3_SDIO_CTRL_BASE   0x1200

Definition at line 301 of file asic3.h.

#define ASIC3_SPI_Base   0x0400

Definition at line 145 of file asic3.h.

#define ASIC3_SPI_Control   0x0000

Definition at line 146 of file asic3.h.

#define ASIC3_SPI_Int   0x000c

Definition at line 149 of file asic3.h.

#define ASIC3_SPI_RxData   0x0008

Definition at line 148 of file asic3.h.

#define ASIC3_SPI_Status   0x0010

Definition at line 150 of file asic3.h.

#define ASIC3_SPI_TxData   0x0004

Definition at line 147 of file asic3.h.

#define ASIC3_TO_GPIO (   gpio)    (NR_BUILTIN_GPIO + (gpio))

Definition at line 51 of file asic3.h.

#define CLOCK_CDEX_CONTROL_CX   (1 << 12)

Definition at line 202 of file asic3.h.

#define CLOCK_CDEX_EX0   (1 << 13) /* R/W: 32.768 kHz crystal */

Definition at line 204 of file asic3.h.

#define CLOCK_CDEX_EX1   (1 << 14) /* R/W: 24.576 MHz crystal */

Definition at line 205 of file asic3.h.

#define CLOCK_CDEX_LED0   (1 << 6)

Definition at line 194 of file asic3.h.

#define CLOCK_CDEX_LED1   (1 << 7)

Definition at line 195 of file asic3.h.

#define CLOCK_CDEX_LED2   (1 << 8)

Definition at line 196 of file asic3.h.

#define CLOCK_CDEX_OWM   (1 << 3)

Definition at line 191 of file asic3.h.

#define CLOCK_CDEX_PWM0   (1 << 4)

Definition at line 192 of file asic3.h.

#define CLOCK_CDEX_PWM1   (1 << 5)

Definition at line 193 of file asic3.h.

#define CLOCK_CDEX_SD_BUS   (1 << 10) /* R/W: SD bus clock source ctrl */

Definition at line 200 of file asic3.h.

#define CLOCK_CDEX_SD_HOST   (1 << 9) /* R/W: SD host clock source */

Definition at line 199 of file asic3.h.

#define CLOCK_CDEX_SMBUS   (1 << 11)

Definition at line 201 of file asic3.h.

#define CLOCK_CDEX_SOURCE   (1 << 0) /* 2 bits */

Definition at line 187 of file asic3.h.

#define CLOCK_CDEX_SOURCE0   (1 << 0)

Definition at line 188 of file asic3.h.

#define CLOCK_CDEX_SOURCE1   (1 << 1)

Definition at line 189 of file asic3.h.

#define CLOCK_CDEX_SPI   (1 << 2)

Definition at line 190 of file asic3.h.

#define CLOCK_SEL_CX   (1 << 2)

Definition at line 211 of file asic3.h.

#define CLOCK_SEL_SD_BCLK_SEL   (1 << 1) /* R/W: SDIO bus clock select */

Definition at line 208 of file asic3.h.

#define CLOCK_SEL_SD_HCLK_SEL   (1 << 0) /* R/W: SDIO host clock select */

Definition at line 207 of file asic3.h.

#define LED_ALWAYS   (1 << 6) /* LED Interrupt Mask 0:No mask, 1:mask */

Definition at line 181 of file asic3.h.

#define LED_AUTOSTOP   (1 << 5) /* LED ON/OFF auto stop 0:disable, 1:enable */

Definition at line 180 of file asic3.h.

#define LED_EN   (1 << 4) /* LED ON/OFF 0:off, 1:on */

Definition at line 179 of file asic3.h.

#define LED_TBS   0x0f /* Low 4 bits sets time base, max = 13 */

Definition at line 173 of file asic3.h.

#define PWM_TIMEBASE_ENABLE   (1 << 4) /* Enable clock */

Definition at line 161 of file asic3.h.

#define PWM_TIMEBASE_VALUE (   x)    ((x)&0xf) /* Low 4 bits sets time base */

Definition at line 160 of file asic3.h.

#define SPI_CONTROL_SPR (   clk)    ((clk) & 0x0f) /* Clock rate */

Definition at line 152 of file asic3.h.

Function Documentation

u32 asic3_read_register ( struct asic3 asic,
unsigned int  reg 
)

Definition at line 99 of file asic3.c.

void asic3_write_register ( struct asic3 asic,
unsigned int  reg,
u32  val 
)

Definition at line 92 of file asic3.c.