From 323570540decf63ca45edf909e5934b82e4f61e6 Mon Sep 17 00:00:00 2001 From: jmcneill Date: Sat, 6 Sep 2014 16:47:03 +0000 Subject: [PATCH] seems I have to enable ADC PA for sound to come out --- sys/arch/arm/allwinner/awin_ac.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/arch/arm/allwinner/awin_ac.c b/sys/arch/arm/allwinner/awin_ac.c index 5fc7a3e830ea..5bb077a51c89 100644 --- a/sys/arch/arm/allwinner/awin_ac.c +++ b/sys/arch/arm/allwinner/awin_ac.c @@ -1,4 +1,4 @@ -/* $NetBSD: awin_ac.c,v 1.6 2014/09/06 14:53:41 jmcneill Exp $ */ +/* $NetBSD: awin_ac.c,v 1.7 2014/09/06 16:47:03 jmcneill Exp $ */ /*- * Copyright (c) 2014 Jared D. McNeill @@ -30,7 +30,7 @@ #include "opt_ddb.h" #include -__KERNEL_RCSID(0, "$NetBSD: awin_ac.c,v 1.6 2014/09/06 14:53:41 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: awin_ac.c,v 1.7 2014/09/06 16:47:03 jmcneill Exp $"); #include #include @@ -117,6 +117,7 @@ __KERNEL_RCSID(0, "$NetBSD: awin_ac.c,v 1.6 2014/09/06 14:53:41 jmcneill Exp $") #define AC_ADC_FIFOS 0x20 #define AC_ADC_RXDATA 0x24 #define AC_ADC_ACTL 0x28 +#define ADC_ACTL_PA_EN __BIT(4) #define AC_DAC_CNT 0x30 #define AC_ADC_CNT 0x34 #define AC_DAC_CAL 0x38 @@ -372,6 +373,10 @@ awinac_init(struct awinac_softc *sc) val |= __SHIFTIN(AWINAC_INIT_VOL, DAC_ACTL_PAVOL); AC_WRITE(sc, AC_DAC_ACTL, val); + val = AC_READ(sc, AC_ADC_ACTL); + val |= ADC_ACTL_PA_EN; + AC_WRITE(sc, AC_ADC_ACTL, val); + val = AC_READ(sc, AC_DAC_FIFOC); val &= ~DAC_FIFOC_IRQ_EN; val &= ~DAC_FIFOC_DRQ_EN;