Line 42... |
Line 42... |
static uint32_t gpio_read32( oraddr_t addr, void *dat );
|
static uint32_t gpio_read32( oraddr_t addr, void *dat );
|
static void gpio_write32( oraddr_t addr, uint32_t value, void *dat );
|
static void gpio_write32( oraddr_t addr, uint32_t value, void *dat );
|
|
|
static void gpio_external_clock( unsigned long value, struct gpio_device *gpio );
|
static void gpio_external_clock( unsigned long value, struct gpio_device *gpio );
|
static void gpio_device_clock( struct gpio_device *gpio );
|
static void gpio_device_clock( struct gpio_device *gpio );
|
|
static void gpio_clock( void *dat );
|
|
|
/* Initialize all parameters and state */
|
/* Initialize all parameters and state */
|
void gpio_reset( void *dat )
|
void gpio_reset( void *dat )
|
{
|
{
|
struct gpio_device *gpio = dat;
|
struct gpio_device *gpio = dat;
|
Line 54... |
Line 55... |
/* Possibly connect to VAPI */
|
/* Possibly connect to VAPI */
|
if ( gpio->base_vapi_id ) {
|
if ( gpio->base_vapi_id ) {
|
vapi_install_multi_handler( gpio->base_vapi_id, GPIO_NUM_VAPI_IDS, gpio_vapi_read, dat );
|
vapi_install_multi_handler( gpio->base_vapi_id, GPIO_NUM_VAPI_IDS, gpio_vapi_read, dat );
|
}
|
}
|
}
|
}
|
|
SCHED_ADD(gpio_clock, dat, 1);
|
}
|
}
|
|
|
|
|
/* Dump status */
|
/* Dump status */
|
void gpio_status( void *dat )
|
void gpio_status( void *dat )
|
Line 153... |
Line 155... |
break;
|
break;
|
case GPIO_VAPI_CLOCK:
|
case GPIO_VAPI_CLOCK:
|
gpio_external_clock( data, gpio );
|
gpio_external_clock( data, gpio );
|
break;
|
break;
|
}
|
}
|
|
}
|
|
|
|
/* System Clock. */
|
|
static void gpio_clock( void *dat )
|
|
{
|
|
struct gpio_device *gpio = dat;
|
|
|
/* Clock the device */
|
/* Clock the device */
|
if ( !(gpio->curr.ctrl & RGPIO_CTRL_ECLK) )
|
if ( !(gpio->curr.ctrl & RGPIO_CTRL_ECLK) )
|
gpio_device_clock( gpio );
|
gpio_device_clock( gpio );
|
|
SCHED_ADD(gpio_clock, dat, 1);
|
}
|
}
|
|
|
/* External Clock. */
|
/* External Clock. */
|
static void gpio_external_clock( unsigned long value, struct gpio_device *gpio )
|
static void gpio_external_clock( unsigned long value, struct gpio_device *gpio )
|
{
|
{
|