Date: Wed, 5 Aug 2015 15:40:55 GMT From: pratiksinghal@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r289247 - in soc2015/pratiksinghal/cubie-head/sys/arm: allwinner conf Message-ID: <201508051540.t75FetgJ000784@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pratiksinghal Date: Wed Aug 5 15:40:54 2015 New Revision: 289247 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=289247 Log: Removed the errors, however the module attach function is not being called so far. Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_ac97.c soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/files.allwinner soc2015/pratiksinghal/cubie-head/sys/arm/conf/CUBIEBOARD Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_ac97.c ============================================================================== --- soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_ac97.c Wed Aug 5 14:45:52 2015 (r289246) +++ soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_ac97.c Wed Aug 5 15:40:54 2015 (r289247) @@ -30,12 +30,13 @@ #include <sys/lock.h> #include <sys/mutex.h> #include <sys/rman.h> -#include <sys/types.H> +#include <sys/types.h> #include <sys/systm.h> +#include <dev/ofw/ofw_bus.h> +#include <dev/ofw/ofw_bus_subr.h> #include <dev/sound/pcm/sound.h> - -#include <dev/sound/ac97/ac97.h> +#include <dev/sound/pcm/ac97.h> #include "a10_ac97.h" @@ -85,17 +86,16 @@ * Enable Codec Ready interrupt */ -static ac97_attach(device_t dev) +static int ac97_attach(device_t dev) { struct a10_ac97_info *sc; - device_t gpio; int error; sc = device_get_softc(dev); sc->ac_dev = dev; sc->use_dma = 0; error = 0; - ienab = 0; + sc->ienab = 0; sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, RF_ACTIVE); if (sc->mem_res == NULL) { @@ -108,7 +108,7 @@ goto fail; } error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, - NULL, ac97_intr, &sc->intr_handle); + NULL, NULL, sc,&sc->intr_handle); if (error) { device_printf(dev, "Cannot setup interrupt handler %d\n", error); goto fail; @@ -118,17 +118,17 @@ mtx_init(&sc->ac97_mtx, device_get_nameunit(dev), "a10_ac97", MTX_DEF); - device_printf("Before resetting device"); + device_printf(dev,"Before resetting device"); uint32_t val,total; - AC97_WRITE(sc, AC_CTL, AC_WARM_RST) + AC97_WRITE(sc, AC_CTL, AC_WARM_RST); total = 0; while (1) { val = AC97_READ(sc, AC_CTL); - if ((val >> 1) & 1 == 0) + if (((val >> 1) & 1) == 0) break; else - DELAY(2) + DELAY(2); total += 2; if (total > 40) break; @@ -145,7 +145,7 @@ fail: if (sc->mem_res != NULL) - bus_release_resouce(dev, SYS_RES_MEMORY, sc->mem_rid, sc->mem_res); + bus_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, sc->mem_res); if (sc->irq_res != NULL) { bus_teardown_intr(dev, sc->irq_res, sc->intr_handle); bus_release_resource(dev, SYS_RES_IRQ, sc->irq_rid, sc->irq_res); @@ -155,7 +155,7 @@ return (ENXIO); } -static ac97_detach(device_t dev) +static int ac97_detach(device_t dev) { return (EBUSY); } @@ -173,7 +173,7 @@ static driver_t a10_ac97_driver = { "a10_ac97", a10_ac97_methods, - sizeof(struct a10_ac97_info); + sizeof(struct a10_ac97_info) }; DRIVER_MODULE(a10_ac97, pci, a10_ac97_driver, a10_ac97_devclass, 0, 0); Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/files.allwinner ============================================================================== --- soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/files.allwinner Wed Aug 5 14:45:52 2015 (r289246) +++ soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/files.allwinner Wed Aug 5 15:40:54 2015 (r289247) @@ -8,7 +8,7 @@ arm/allwinner/a10_ahci.c optional ahci arm/allwinner/a10_clk.c standard arm/allwinner/a10_common.c standard -arm/allwinner/a10_ac97.c optional ac97 +arm/allwinner/a10_ac97.c optional sound arm/allwinner/a10_dma.c optional dma arm/allwinner/a10_ehci.c optional ehci arm/allwinner/a10_gpio.c optional gpio Modified: soc2015/pratiksinghal/cubie-head/sys/arm/conf/CUBIEBOARD ============================================================================== --- soc2015/pratiksinghal/cubie-head/sys/arm/conf/CUBIEBOARD Wed Aug 5 14:45:52 2015 (r289246) +++ soc2015/pratiksinghal/cubie-head/sys/arm/conf/CUBIEBOARD Wed Aug 5 15:40:54 2015 (r289247) @@ -107,7 +107,7 @@ device miibus # AC97 Interface -device ac97 +device sound # Flattened Device Tree options FDT # Configure using FDT/DTB data
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508051540.t75FetgJ000784>