From owner-svn-soc-all@freebsd.org Wed Aug 5 15:40:56 2015 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD9459B4965 for ; Wed, 5 Aug 2015 15:40:56 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B3D51000 for ; Wed, 5 Aug 2015 15:40:56 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id t75FeuW5001370 for ; Wed, 5 Aug 2015 15:40:56 GMT (envelope-from pratiksinghal@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id t75FetgJ000784 for svn-soc-all@FreeBSD.org; Wed, 5 Aug 2015 15:40:55 GMT (envelope-from pratiksinghal@FreeBSD.org) Date: Wed, 5 Aug 2015 15:40:55 GMT Message-Id: <201508051540.t75FetgJ000784@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to pratiksinghal@FreeBSD.org using -f From: pratiksinghal@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r289247 - in soc2015/pratiksinghal/cubie-head/sys/arm: allwinner conf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2015 15:40:56 -0000 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 #include #include -#include +#include #include +#include +#include #include - -#include +#include #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