Deleted Added
full compact
gpio.c (186909) gpio.c (191140)
1/*-
2 * Copyright (c) 2006 Benno Rice.
3 * Copyright (C) 2008 MARVELL INTERNATIONAL LTD.
4 * All rights reserved.
5 *
6 * Adapted and extended for Marvell SoCs by Semihalf.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * from: FreeBSD: //depot/projects/arm/src/sys/arm/xscale/pxa2x0/pxa2x0_gpio.c, rev 1
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2006 Benno Rice.
3 * Copyright (C) 2008 MARVELL INTERNATIONAL LTD.
4 * All rights reserved.
5 *
6 * Adapted and extended for Marvell SoCs by Semihalf.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * from: FreeBSD: //depot/projects/arm/src/sys/arm/xscale/pxa2x0/pxa2x0_gpio.c, rev 1
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/arm/mv/gpio.c 186909 2009-01-08 18:31:43Z raj $");
32__FBSDID("$FreeBSD: head/sys/arm/mv/gpio.c 191140 2009-04-16 11:20:18Z raj $");
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/bus.h>
37#include <sys/kernel.h>
38#include <sys/lock.h>
39#include <sys/interrupt.h>
40#include <sys/module.h>

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

118 uint32_t dev_id, rev_id;
119
120 sc = (struct mv_gpio_softc *)device_get_softc(dev);
121
122 if (mv_gpio_softc != NULL)
123 return (ENXIO);
124 mv_gpio_softc = sc;
125
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/bus.h>
37#include <sys/kernel.h>
38#include <sys/lock.h>
39#include <sys/interrupt.h>
40#include <sys/module.h>

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

118 uint32_t dev_id, rev_id;
119
120 sc = (struct mv_gpio_softc *)device_get_softc(dev);
121
122 if (mv_gpio_softc != NULL)
123 return (ENXIO);
124 mv_gpio_softc = sc;
125
126 /* Get board id and revision */
126 /* Get chip id and revision */
127 soc_id(&dev_id, &rev_id);
128
129 if (dev_id == MV_DEV_88F5182 ||
130 dev_id == MV_DEV_88F5281 ||
127 soc_id(&dev_id, &rev_id);
128
129 if (dev_id == MV_DEV_88F5182 ||
130 dev_id == MV_DEV_88F5281 ||
131 dev_id == MV_DEV_MV78100) {
131 dev_id == MV_DEV_MV78100 ||
132 dev_id == MV_DEV_MV78100_Z0 ) {
132 sc->pin_num = 32;
133 sc->irq_num = 4;
134 sc->use_high = 0;
135
136 } else if (dev_id == MV_DEV_88F6281) {
137 sc->pin_num = 50;
138 sc->irq_num = 7;
139 sc->use_high = 1;
140
141 } else {
133 sc->pin_num = 32;
134 sc->irq_num = 4;
135 sc->use_high = 0;
136
137 } else if (dev_id == MV_DEV_88F6281) {
138 sc->pin_num = 50;
139 sc->irq_num = 7;
140 sc->use_high = 1;
141
142 } else {
142 device_printf(dev, "unknown board id=0x%x\n", dev_id);
143 device_printf(dev, "unknown chip id=0x%x\n", dev_id);
143 return (ENXIO);
144 }
145
146 error = bus_alloc_resources(dev, mv_gpio_res, sc->res);
147 if (error) {
148 device_printf(dev, "could not allocate resources\n");
149 return (ENXIO);
150 }

--- 378 unchanged lines hidden ---
144 return (ENXIO);
145 }
146
147 error = bus_alloc_resources(dev, mv_gpio_res, sc->res);
148 if (error) {
149 device_printf(dev, "could not allocate resources\n");
150 return (ENXIO);
151 }

--- 378 unchanged lines hidden ---