Deleted Added
full compact
cambria_gpio.c (256281) cambria_gpio.c (278782)
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: stable/10/sys/arm/xscale/ixp425/cambria_gpio.c 249449 2013-04-13 21:21:13Z dim $");
42__FBSDID("$FreeBSD: stable/10/sys/arm/xscale/ixp425/cambria_gpio.c 278782 2015-02-14 20:37:33Z loos $");
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>

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

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;
447 cambria_gpio_pin_setflags(dev, pin, p->flags);
448 }
449
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>

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

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;
447 cambria_gpio_pin_setflags(dev, pin, p->flags);
448 }
449
450 device_add_child(dev, "gpioc", device_get_unit(dev));
451 device_add_child(dev, "gpiobus", device_get_unit(dev));
450 device_add_child(dev, "gpioc", -1);
451 device_add_child(dev, "gpiobus", -1);
452
452 return (bus_generic_attach(dev));
453}
454
455static int
456cambria_gpio_detach(device_t dev)
457{
458 struct cambria_gpio_softc *sc = device_get_softc(dev);
459

--- 40 unchanged lines hidden ---
453 return (bus_generic_attach(dev));
454}
455
456static int
457cambria_gpio_detach(device_t dev)
458{
459 struct cambria_gpio_softc *sc = device_get_softc(dev);
460

--- 40 unchanged lines hidden ---