Deleted Added
full compact
cambria_gpio.c (226325) cambria_gpio.c (239351)
1/*-
2 * Copyright (c) 2010, Andrew Thompson <thompsa@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

34 * times out and not write our latch. To get around this we grab the iicbus and
35 * then do our own bit banging. This is a comprimise to changing all the iicbb
36 * device methods to allow a flag to be passed down and is similir to how Linux
37 * does it.
38 *
39 */
40
41#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2010, Andrew Thompson <thompsa@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

34 * times out and not write our latch. To get around this we grab the iicbus and
35 * then do our own bit banging. This is a comprimise to changing all the iicbb
36 * device methods to allow a flag to be passed down and is similir to how Linux
37 * does it.
38 *
39 */
40
41#include <sys/cdefs.h>
42__FBSDID("$FreeBSD: head/sys/arm/xscale/ixp425/cambria_gpio.c 226325 2011-10-12 20:58:54Z thompsa $");
42__FBSDID("$FreeBSD: head/sys/arm/xscale/ixp425/cambria_gpio.c 239351 2012-08-17 04:44:57Z rpaulo $");
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/bus.h>
47
48#include <sys/kernel.h>
49#include <sys/module.h>
50#include <sys/rman.h>

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

430{
431 struct cambria_gpio_softc *sc = device_get_softc(dev);
432 int pin;
433
434 sc->sc_dev = dev;
435 sc->sc_iot = ixp425_softc->sc_iot;
436 sc->sc_gpio_ioh = ixp425_softc->sc_gpio_ioh;
437
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/bus.h>
47
48#include <sys/kernel.h>
49#include <sys/module.h>
50#include <sys/rman.h>

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

430{
431 struct cambria_gpio_softc *sc = device_get_softc(dev);
432 int pin;
433
434 sc->sc_dev = dev;
435 sc->sc_iot = ixp425_softc->sc_iot;
436 sc->sc_gpio_ioh = ixp425_softc->sc_gpio_ioh;
437
438 mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
439 MTX_DEF);
438 mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF);
440
441 for (pin = 0; pin < GPIO_PINS; pin++) {
442 struct cambria_gpio_pin *p = &cambria_gpio_pins[pin];
443
444 strncpy(sc->sc_pins[pin].gp_name, p->name, GPIOMAXNAME);
445 sc->sc_pins[pin].gp_pin = pin;
446 sc->sc_pins[pin].gp_caps = GPIO_PIN_INPUT|GPIO_PIN_OUTPUT;
447 sc->sc_pins[pin].gp_flags = 0;

--- 53 unchanged lines hidden ---
439
440 for (pin = 0; pin < GPIO_PINS; pin++) {
441 struct cambria_gpio_pin *p = &cambria_gpio_pins[pin];
442
443 strncpy(sc->sc_pins[pin].gp_name, p->name, GPIOMAXNAME);
444 sc->sc_pins[pin].gp_pin = pin;
445 sc->sc_pins[pin].gp_caps = GPIO_PIN_INPUT|GPIO_PIN_OUTPUT;
446 sc->sc_pins[pin].gp_flags = 0;

--- 53 unchanged lines hidden ---