106
106
7, 8, 9, 10, 11, 12, -1, -1,
109
int gpio_to_irq(int gpio)
109
static int ixp4xx_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
376
375
unsigned long ixp4xx_exp_bus_size;
377
376
EXPORT_SYMBOL(ixp4xx_exp_bus_size);
378
static int ixp4xx_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
380
gpio_line_config(gpio, IXP4XX_GPIO_IN);
385
static int ixp4xx_gpio_direction_output(struct gpio_chip *chip, unsigned gpio,
388
gpio_line_set(gpio, level);
389
gpio_line_config(gpio, IXP4XX_GPIO_OUT);
394
static int ixp4xx_gpio_get_value(struct gpio_chip *chip, unsigned gpio)
398
gpio_line_get(gpio, &value);
403
static void ixp4xx_gpio_set_value(struct gpio_chip *chip, unsigned gpio,
406
gpio_line_set(gpio, value);
409
static struct gpio_chip ixp4xx_gpio_chip = {
410
.label = "IXP4XX_GPIO_CHIP",
411
.direction_input = ixp4xx_gpio_direction_input,
412
.direction_output = ixp4xx_gpio_direction_output,
413
.get = ixp4xx_gpio_get_value,
414
.set = ixp4xx_gpio_set_value,
415
.to_irq = ixp4xx_gpio_to_irq,
379
420
void __init ixp4xx_sys_init(void)
381
422
ixp4xx_exp_bus_size = SZ_16M;
383
424
platform_add_devices(ixp4xx_devices, ARRAY_SIZE(ixp4xx_devices));
426
gpiochip_add(&ixp4xx_gpio_chip);
385
428
if (cpu_is_ixp46x()) {
406
static DEFINE_CLOCK_DATA(cd);
408
unsigned long long notrace sched_clock(void)
410
u32 cyc = *IXP4XX_OSTS;
411
return cyc_to_sched_clock(&cd, cyc, (u32)~0);
414
static void notrace ixp4xx_update_sched_clock(void)
416
u32 cyc = *IXP4XX_OSTS;
417
update_sched_clock(&cd, cyc, (u32)~0);
449
static u32 notrace ixp4xx_read_sched_clock(void)
430
464
EXPORT_SYMBOL(ixp4xx_timer_freq);
431
465
static void __init ixp4xx_clocksource_init(void)
433
init_sched_clock(&cd, ixp4xx_update_sched_clock, 32, ixp4xx_timer_freq);
467
setup_sched_clock(ixp4xx_read_sched_clock, 32, ixp4xx_timer_freq);
435
469
clocksource_mmio_init(NULL, "OSTS", ixp4xx_timer_freq, 200, 32,
436
470
ixp4xx_clocksource_read);