bcm2835_spi.c (302408) | bcm2835_spi.c (307575) |
---|---|
1/*- 2 * Copyright (c) 2012 Oleksandr Tymoshenko <gonzo@freebsd.org> 3 * Copyright (c) 2013 Luiz Otavio O Souza <loos@freebsd.org> 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: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * 27 */ 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2012 Oleksandr Tymoshenko <gonzo@freebsd.org> 3 * Copyright (c) 2013 Luiz Otavio O Souza <loos@freebsd.org> 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: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * 27 */ 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: stable/11/sys/arm/broadcom/bcm2835/bcm2835_spi.c 283918 2015-06-02 16:07:28Z ian $"); | 29__FBSDID("$FreeBSD: stable/11/sys/arm/broadcom/bcm2835/bcm2835_spi.c 307575 2016-10-18 19:15:43Z gonzo $"); |
30 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/bus.h> 34 35#include <sys/kernel.h> 36#include <sys/module.h> 37#include <sys/rman.h> --- 15 unchanged lines hidden (view full) --- 53#include <dev/spibus/spibusvar.h> 54 55#include <arm/broadcom/bcm2835/bcm2835_gpio.h> 56#include <arm/broadcom/bcm2835/bcm2835_spireg.h> 57#include <arm/broadcom/bcm2835/bcm2835_spivar.h> 58 59#include "spibus_if.h" 60 | 30 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/bus.h> 34 35#include <sys/kernel.h> 36#include <sys/module.h> 37#include <sys/rman.h> --- 15 unchanged lines hidden (view full) --- 53#include <dev/spibus/spibusvar.h> 54 55#include <arm/broadcom/bcm2835/bcm2835_gpio.h> 56#include <arm/broadcom/bcm2835/bcm2835_spireg.h> 57#include <arm/broadcom/bcm2835/bcm2835_spivar.h> 58 59#include "spibus_if.h" 60 |
61static struct ofw_compat_data compat_data[] = { 62 {"broadcom,bcm2835-spi", 1}, 63 {"brcm,bcm2835-spi", 1}, 64 {NULL, 0} 65}; 66 |
|
61static void bcm_spi_intr(void *); 62 63#ifdef BCM_SPI_DEBUG 64static void 65bcm_spi_printr(device_t dev) 66{ 67 struct bcm_spi_softc *sc; 68 uint32_t reg; --- 159 unchanged lines hidden (view full) --- 228 229static int 230bcm_spi_probe(device_t dev) 231{ 232 233 if (!ofw_bus_status_okay(dev)) 234 return (ENXIO); 235 | 67static void bcm_spi_intr(void *); 68 69#ifdef BCM_SPI_DEBUG 70static void 71bcm_spi_printr(device_t dev) 72{ 73 struct bcm_spi_softc *sc; 74 uint32_t reg; --- 159 unchanged lines hidden (view full) --- 234 235static int 236bcm_spi_probe(device_t dev) 237{ 238 239 if (!ofw_bus_status_okay(dev)) 240 return (ENXIO); 241 |
236 if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-spi")) | 242 if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) |
237 return (ENXIO); 238 239 device_set_desc(dev, "BCM2708/2835 SPI controller"); 240 241 return (BUS_PROBE_DEFAULT); 242} 243 244static int --- 277 unchanged lines hidden --- | 243 return (ENXIO); 244 245 device_set_desc(dev, "BCM2708/2835 SPI controller"); 246 247 return (BUS_PROBE_DEFAULT); 248} 249 250static int --- 277 unchanged lines hidden --- |