svn commit: r311203 - stable/11/sys/arm/ti/am335x
Luiz Otavio O Souza
loos at FreeBSD.org
Wed Jan 4 00:18:39 UTC 2017
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);
More information about the svn-src-stable
mailing list