From owner-svn-src-head@freebsd.org Fri Dec 14 18:37:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7836E133F06F; Fri, 14 Dec 2018 18:37:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D60C8B122; Fri, 14 Dec 2018 18:37:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A53436CE; Fri, 14 Dec 2018 18:37:28 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBEIbRf2023122; Fri, 14 Dec 2018 18:37:27 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBEIbQh7023117; Fri, 14 Dec 2018 18:37:26 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201812141837.wBEIbQh7023117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 14 Dec 2018 18:37:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342087 - in head: sys/arm/allwinner sys/dev/pwm sys/sys usr.sbin/pwm X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head: sys/arm/allwinner sys/dev/pwm sys/sys usr.sbin/pwm X-SVN-Commit-Revision: 342087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1D60C8B122 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.71 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.85)[-0.853,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-0.88)[-0.881,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2018 18:37:28 -0000 Author: manu Date: Fri Dec 14 18:37:26 2018 New Revision: 342087 URL: https://svnweb.freebsd.org/changeset/base/342087 Log: pwm: Convert period and duty to unsigned int We don't need a 64 bits value to store nanoseconds Discused with: ian, jhibbits Modified: head/sys/arm/allwinner/aw_pwm.c head/sys/dev/pwm/pwm_if.m head/sys/dev/pwm/pwmbus.c head/sys/dev/pwm/pwmbus_if.m head/sys/sys/pwm.h head/usr.sbin/pwm/pwm.c Modified: head/sys/arm/allwinner/aw_pwm.c ============================================================================== --- head/sys/arm/allwinner/aw_pwm.c Fri Dec 14 18:16:35 2018 (r342086) +++ head/sys/arm/allwinner/aw_pwm.c Fri Dec 14 18:37:26 2018 (r342087) @@ -87,8 +87,8 @@ struct aw_pwm_softc { struct resource *res; uint64_t clk_freq; - uint64_t period; - uint64_t duty; + unsigned int period; + unsigned int duty; uint32_t flags; bool enabled; }; @@ -191,7 +191,7 @@ aw_pwm_channel_max(device_t dev, int *nchannel) } static int -aw_pwm_channel_config(device_t dev, int channel, uint64_t period, uint64_t duty) +aw_pwm_channel_config(device_t dev, int channel, unsigned int period, unsigned int duty) { struct aw_pwm_softc *sc; uint64_t period_freq, duty_freq; @@ -254,7 +254,7 @@ aw_pwm_channel_config(device_t dev, int channel, uint6 } static int -aw_pwm_channel_get_config(device_t dev, int channel, uint64_t *period, uint64_t *duty) +aw_pwm_channel_get_config(device_t dev, int channel, unsigned int *period, unsigned int *duty) { struct aw_pwm_softc *sc; Modified: head/sys/dev/pwm/pwm_if.m ============================================================================== --- head/sys/dev/pwm/pwm_if.m Fri Dec 14 18:16:35 2018 (r342086) +++ head/sys/dev/pwm/pwm_if.m Fri Dec 14 18:37:26 2018 (r342087) @@ -46,8 +46,8 @@ METHOD device_t get_bus { METHOD int channel_config { device_t dev; int channel; - uint64_t period; - uint64_t duty; + unsigned int period; + unsigned duty; }; # @@ -57,8 +57,8 @@ METHOD int channel_config { METHOD int channel_get_config { device_t dev; int channel; - uint64_t *period; - uint64_t *duty; + unsigned int *period; + unsigned int *duty; }; # Modified: head/sys/dev/pwm/pwmbus.c ============================================================================== --- head/sys/dev/pwm/pwmbus.c Fri Dec 14 18:16:35 2018 (r342086) +++ head/sys/dev/pwm/pwmbus.c Fri Dec 14 18:37:26 2018 (r342087) @@ -138,7 +138,7 @@ pwmbus_detach(device_t dev) } static int -pwmbus_channel_config(device_t bus, int channel, uint64_t period, uint64_t duty) +pwmbus_channel_config(device_t bus, int channel, unsigned int period, unsigned int duty) { struct pwmbus_softc *sc; @@ -151,7 +151,7 @@ pwmbus_channel_config(device_t bus, int channel, uint6 } static int -pwmbus_channel_get_config(device_t bus, int channel, uint64_t *period, uint64_t *duty) +pwmbus_channel_get_config(device_t bus, int channel, unsigned int *period, unsigned int *duty) { struct pwmbus_softc *sc; Modified: head/sys/dev/pwm/pwmbus_if.m ============================================================================== --- head/sys/dev/pwm/pwmbus_if.m Fri Dec 14 18:16:35 2018 (r342086) +++ head/sys/dev/pwm/pwmbus_if.m Fri Dec 14 18:37:26 2018 (r342087) @@ -59,8 +59,8 @@ HEADER { METHOD int channel_config { device_t bus; int channel; - uint64_t period; - uint64_t duty; + unsigned int period; + unsigned int duty; }; # @@ -70,8 +70,8 @@ METHOD int channel_config { METHOD int channel_get_config { device_t bus; int channel; - uint64_t *period; - uint64_t *duty; + unsigned int *period; + unsigned int *duty; }; # Modified: head/sys/sys/pwm.h ============================================================================== --- head/sys/sys/pwm.h Fri Dec 14 18:16:35 2018 (r342086) +++ head/sys/sys/pwm.h Fri Dec 14 18:37:26 2018 (r342087) @@ -35,8 +35,8 @@ struct pwm_state { int channel; - uint64_t period; - uint64_t duty; + unsigned int period; + unsigned int duty; uint32_t flags; bool enable; }; Modified: head/usr.sbin/pwm/pwm.c ============================================================================== --- head/usr.sbin/pwm/pwm.c Fri Dec 14 18:16:35 2018 (r342086) +++ head/usr.sbin/pwm/pwm.c Fri Dec 14 18:37:26 2018 (r342087) @@ -190,9 +190,9 @@ main(int argc, char *argv[]) } break; case PWM_SHOW_CONFIG: - printf("period: %ju\nduty: %ju\nenabled:%d\n", - (uintmax_t) state.period, - (uintmax_t) state.duty, + printf("period: %u\nduty: %u\nenabled:%d\n", + state.period, + state.duty, state.enable); break; case PWM_PERIOD: