Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Sep 2020 07:40:56 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r366141 - head/sys/arm/allwinner
Message-ID:  <202009250740.08P7euZE097623@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Fri Sep 25 07:40:56 2020
New Revision: 366141
URL: https://svnweb.freebsd.org/changeset/base/366141

Log:
  aw_pwm: ensure sane configuration, just in case
  
  Make sure that the hardware is configured to cycle mode and that the
  bypass is disabled.
  
  MFC after:	2 weeks

Modified:
  head/sys/arm/allwinner/aw_pwm.c

Modified: head/sys/arm/allwinner/aw_pwm.c
==============================================================================
--- head/sys/arm/allwinner/aw_pwm.c	Fri Sep 25 07:40:26 2020	(r366140)
+++ head/sys/arm/allwinner/aw_pwm.c	Fri Sep 25 07:40:56 2020	(r366141)
@@ -290,6 +290,13 @@ aw_pwm_channel_config(device_t dev, u_int channel, u_i
 	/* Write the prescalar */
 	reg &= ~AW_PWM_CTRL_PRESCALE_MASK;
 	reg |= prescaler;
+
+	reg &= ~AW_PWM_CTRL_MODE_MASK;
+	reg |= AW_PWM_CTRL_CYCLE_MODE;
+
+	reg &= ~AW_PWM_CTRL_PULSE_START;
+	reg &= ~AW_PWM_CTRL_CLK_BYPASS;
+
 	AW_PWM_WRITE(sc, AW_PWM_CTRL, reg);
 
 	/* Write the total/active cycles */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009250740.08P7euZE097623>