Deleted Added
full compact
ar71xx_gpio.c (213286) ar71xx_gpio.c (221518)
1/*-
2 * Copyright (c) 2009, Oleksandr Tymoshenko <gonzo@FreeBSD.org>
3 * Copyright (c) 2009, Luiz Otavio O Souza.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 17 unchanged lines hidden (view full) ---

26 * SUCH DAMAGE.
27 */
28
29/*
30 * GPIO driver for AR71xx
31 */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2009, Oleksandr Tymoshenko <gonzo@FreeBSD.org>
3 * Copyright (c) 2009, Luiz Otavio O Souza.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 17 unchanged lines hidden (view full) ---

26 * SUCH DAMAGE.
27 */
28
29/*
30 * GPIO driver for AR71xx
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/mips/atheros/ar71xx_gpio.c 213286 2010-09-29 23:06:41Z gonzo $");
34__FBSDID("$FreeBSD: head/sys/mips/atheros/ar71xx_gpio.c 221518 2011-05-06 02:45:02Z adrian $");
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/bus.h>
39
40#include <sys/kernel.h>
41#include <sys/module.h>
42#include <sys/rman.h>
43#include <sys/lock.h>
44#include <sys/mutex.h>
45#include <sys/gpio.h>
46
47#include <machine/bus.h>
48#include <machine/resource.h>
49#include <mips/atheros/ar71xxreg.h>
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/bus.h>
39
40#include <sys/kernel.h>
41#include <sys/module.h>
42#include <sys/rman.h>
43#include <sys/lock.h>
44#include <sys/mutex.h>
45#include <sys/gpio.h>
46
47#include <machine/bus.h>
48#include <machine/resource.h>
49#include <mips/atheros/ar71xxreg.h>
50#include <mips/atheros/ar71xx_setup.h>
50#include <mips/atheros/ar71xx_gpiovar.h>
51
52#include "gpio_if.h"
53
54#define DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT)
55
56struct ar71xx_gpio_pin {
57 const char *name;

--- 81 unchanged lines hidden (view full) ---

139
140 GPIO_UNLOCK(sc);
141}
142
143static int
144ar71xx_gpio_pin_max(device_t dev, int *maxpin)
145{
146
51#include <mips/atheros/ar71xx_gpiovar.h>
52
53#include "gpio_if.h"
54
55#define DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT)
56
57struct ar71xx_gpio_pin {
58 const char *name;

--- 81 unchanged lines hidden (view full) ---

140
141 GPIO_UNLOCK(sc);
142}
143
144static int
145ar71xx_gpio_pin_max(device_t dev, int *maxpin)
146{
147
147 *maxpin = AR71XX_GPIO_PINS - 1;
148 switch (ar71xx_soc) {
149 case AR71XX_SOC_AR9130:
150 case AR71XX_SOC_AR9132:
151 *maxpin = AR91XX_GPIO_PINS - 1;
152 break;
153 case AR71XX_SOC_AR7240:
154 case AR71XX_SOC_AR7241:
155 case AR71XX_SOC_AR7242:
156 *maxpin = AR724X_GPIO_PINS - 1;
157 break;
158 default:
159 *maxpin = AR71XX_GPIO_PINS - 1;
160 }
148 return (0);
149}
150
151static int
152ar71xx_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps)
153{
154 struct ar71xx_gpio_softc *sc = device_get_softc(dev);
155 int i;

--- 291 unchanged lines hidden ---
161 return (0);
162}
163
164static int
165ar71xx_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps)
166{
167 struct ar71xx_gpio_softc *sc = device_get_softc(dev);
168 int i;

--- 291 unchanged lines hidden ---