Date: Wed, 4 Jan 2017 00:18:38 +0000 (UTC) From: Luiz Otavio O Souza <loos@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311203 - stable/11/sys/arm/ti/am335x Message-ID: <201701040018.v040IchN075910@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: loos Date: Wed Jan 4 00:18:38 2017 New Revision: 311203 URL: https://svnweb.freebsd.org/changeset/base/311203 Log: Fixes the sensor initialization, always reset the digital outputs on start. Obtained from: pfSense Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/sys/arm/ti/am335x/am335x_scm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/ti/am335x/am335x_scm.c ============================================================================== --- stable/11/sys/arm/ti/am335x/am335x_scm.c Tue Jan 3 23:28:07 2017 (r311202) +++ stable/11/sys/arm/ti/am335x/am335x_scm.c Wed Jan 4 00:18:38 2017 (r311203) @@ -110,11 +110,14 @@ am335x_scm_attach(device_t dev) struct sysctl_oid_list *tree; uint32_t reg; - /* Set ADC to continous mode, clear output reset. */ - reg = SCM_BGAP_CLRZ | SCM_BGAP_CONTCONV; - ti_scm_reg_write_4(SCM_BGAP_CTRL, reg); - /* Flush write. */ + /* Reset the digital outputs. */ + ti_scm_reg_write_4(SCM_BGAP_CTRL, 0); + ti_scm_reg_read_4(SCM_BGAP_CTRL, ®); + DELAY(500); + /* Set continous mode. */ + ti_scm_reg_write_4(SCM_BGAP_CTRL, SCM_BGAP_CONTCONV); ti_scm_reg_read_4(SCM_BGAP_CTRL, ®); + DELAY(500); /* Start the ADC conversion. */ reg = SCM_BGAP_CLRZ | SCM_BGAP_CONTCONV | SCM_BGAP_SOC; ti_scm_reg_write_4(SCM_BGAP_CTRL, reg);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701040018.v040IchN075910>