From 2a1f073196fc44d4f6252c425b353c1e571e5a80 Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 21 Jun 2019 14:46:43 +0000 Subject: [PATCH] Catch up with recent changes in pwmbus(9). The pwm(9) and pwmbus(9) interfaces were unified into pwmbus(9), and the PWMBUS_CHANNEL_MAX method was renamed PWMBUS_CHANNEL_COUNT. The pwmbus_attach_bus() function just went away completely. Also, fix a few typos such as s/is/if/. --- share/man/man9/Makefile | 2 +- share/man/man9/pwm.9 | 93 ----------------------------------------- share/man/man9/pwmbus.9 | 31 ++++++-------- 3 files changed, 14 insertions(+), 112 deletions(-) delete mode 100644 share/man/man9/pwm.9 diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 682eb2a3950..a4fb56b891b 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -270,7 +270,6 @@ MAN= accept_filter.9 \ proc_rwmem.9 \ pseudofs.9 \ psignal.9 \ - pwm.9 \ pwmbus.9 \ random.9 \ random_harvest.9 \ @@ -1670,6 +1669,7 @@ MLINKS+=proc_rwmem.9 proc_readmem.9 \ MLINKS+=psignal.9 gsignal.9 \ psignal.9 pgsignal.9 \ psignal.9 tdsignal.9 +MLINKS+=pwmbus.9 pwm.9 MLINKS+=random.9 arc4rand.9 \ random.9 arc4random.9 \ random.9 is_random_seeded.9 \ diff --git a/share/man/man9/pwm.9 b/share/man/man9/pwm.9 deleted file mode 100644 index f7564a4eeca..00000000000 --- a/share/man/man9/pwm.9 +++ /dev/null @@ -1,93 +0,0 @@ -.\" Copyright (c) 2018 Emmanuel Vadot -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.\" -.\" $FreeBSD$ -.\" -.Dd January 12, 2019 -.Dt PWM 9 -.Os -.Sh NAME -.Nm pwm , -.Nm PWM_GET_BUS , -.Nm PWM_CHANNEL_CONFIG , -.Nm PWM_CHANNEL_GET_CONFIG , -.Nm PWM_CHANNEL_SET_FLAGS , -.Nm PWM_CHANNEL_GET_FLAGS , -.Nm PWM_CHANNEL_ENABLE , -.Nm PWM_CHANNEL_IS_ENABLED , -.Nm PWM_CHANNEL_MAX -.Nd PWM methods -.Sh SYNOPSIS -.Cd "device pwm" -.In "pwm_if.h" -.Ft device_t -.Fn PWM_GET_BUS "device_t dev" -.Ft int -.Fn PWM_CHANNEL_CONFIG "device_t dev" "int channel" "uint64_t period" "uint64_t duty" -.Ft int -.Fn PWM_CHANNEL_GET_CONFIG "device_t dev" "int channel" "uint64_t *period" "uint64_t *duty" -.Ft int -.Fn PWM_CHANNEL_SET_FLAGS "device_t dev" "int channel" "uint32_t flags" -.Ft int -.Fn PWM_CHANNEL_GET_FLAGS "device_t dev" "int channel" "uint32_t *flags" -.Ft int -.Fn PWM_CHANNEL_ENABLE "device_t dev" "int channel" "bool enable" -.Ft int -.Fn PWM_CHANNEL_IS_ENABLED "device_t dev" "int channel" "bool *enabled" -.Ft int -.Fn PWM_CHANNEL_MAX "device_t dev" "int channel" "int *nchannel" -.Sh DESCRIPTION -The PWM (Pulse-Width Modulation) interface allows the device driver to register to a global -bus so other devices in the kernel can use them in a generic way. -.Sh INTERFACE -.Bl -tag -width indent -.It Fn PWM_GET_BUS "device_t dev" -Return the bus device. -.It Fn PWM_CHANNEL_CONFIG "device_t dev" "int channel" "uint64_t period" "uint64_t duty" -Configure the period and duty (in nanoseconds) in the PWM controller for the specified channel. -Returns 0 on success or -.Er EINVAL -if the values are not supported by the controller or -.Er EBUSY -is the PWM controller is in use and does not support changing the value on the fly. -.It Fn PWM_CHANNEL_GET_CONFIG "device_t dev" "int channel" "uint64_t *period" "uint64_t *duty" -Get the current configuration of the period and duty for the specified channel. -.It Fn PWM_CHANNEL_SET_FLAGS "device_t dev" "int channel" "uint32_t flags" -Set the flags of the channel (like inverted polarity). -.It Fn PWM_CHANNEL_GET_FLAGS "device_t dev" "int channel" "uint32_t *flags" -Get the current flags for the channel. -.It Fn PWM_CHANNEL_ENABLE "device_t dev" "int channel" "bool enable" -Enable the PWM channel. -.It Fn PWM_CHANNEL_ISENABLED "device_t dev" "int channel" "bool *enable" -Test if the PWM channel is enabled. -.It Fn PWM_CHANNEL_MAX "device_t dev" "int channel" "int *nchannel" -Get the maximum number of channels supported by the controller. -.El -.Sh HISTORY -The -.Nm pwm -interface first appeared in -.Fx 13.0 . -The -.Nm pwm -interface and manual page was written by -.An Emmanuel Vadot Aq Mt manu@FreeBSD.org . diff --git a/share/man/man9/pwmbus.9 b/share/man/man9/pwmbus.9 index ba987eaf77a..74397afb104 100644 --- a/share/man/man9/pwmbus.9 +++ b/share/man/man9/pwmbus.9 @@ -22,12 +22,11 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2018 +.Dd June 21, 2019 .Dt PWMBUS 9 .Os .Sh NAME .Nm pwmbus , -.Nm pwmbus_attach_bus , .Nm PWMBUS_GET_BUS , .Nm PWMBUS_CHANNEL_CONFIG , .Nm PWMBUS_CHANNEL_GET_CONFIG , @@ -40,8 +39,6 @@ .Sh SYNOPSIS .Cd "device pwm" .In "pwmbus_if.h" -.Ft device_t -.Fn pwmbus_attach_bus "device_t dev" .Ft int .Fn PWMBUS_CHANNEL_CONFIG "device_t bus" "int channel" "uint64_t period" "uint64_t duty" .Ft int @@ -55,37 +52,35 @@ .Ft int .Fn PWMBUS_CHANNEL_IS_ENABLED "device_t bus" "int channel" "bool *enabled" .Ft int -.Fn PWMBUS_CHANNEL_MAX "device_t bus" "int channel" "int *nchannel" +.Fn PWMBUS_CHANNEL_COUNT "device_t bus" "int channel" "int *nchannel" .Sh DESCRIPTION The PWMBUS (Pulse-Width Modulation) interface allows the device driver to register to a global -bus so other devices in the kernel can use them in a generic way +bus so other devices in the kernel can use them in a generic way. .Sh INTERFACE .Bl -tag -width indent -.It Fn pwmbus_attach_bus "device_t dev" -Attach the -.Nm pwmbus -to the device driver .It Fn PWMBUS_CHANNEL_CONFIG "device_t bus" "int channel" "uint64_t period" "uint64_t duty" Configure the period and duty (in nanoseconds) in the PWM controller on the bus for the specified channel. Returns 0 on success or .Er EINVAL -is the values are not supported by the controller or +if the values are not supported by the controller or .Er EBUSY -is the PWMBUS controller is in use and doesn't support changing the value on the fly. +if the PWMBUS controller is in use and doesn't support changing the value on the fly. .It Fn PWMBUS_CHANNEL_GET_CONFIG "device_t bus" "int channel" "uint64_t *period" "uint64_t *duty" Get the current configuration of the period and duty for the specified channel. .It Fn PWMBUS_CHANNEL_SET_FLAGS "device_t bus" "int channel" "uint32_t flags" -Set the flags of the channel (like inverted polarity), if the driver or controller -doesn't support this a default method is used. +Set the flags of the channel (such as inverted polarity), if the driver or controller +doesn't support this a do-nothing default method is used. .It Fn PWMBUS_CHANNEL_GET_FLAGS "device_t bus" "int channel" "uint32_t *flags" -Get the current flags for the channel, if the driver or controller -doesn't support this, a default method is used. +Get the current flags for the channel. +If the driver or controller +doesn't support this, a default method returns a flags value of zero. .It Fn PWMBUS_CHANNEL_ENABLE "device_t bus" "int channel" "bool enable" Enable the PWM channel. .It Fn PWMBUS_CHANNEL_ISENABLED "device_t bus" "int channel" "bool *enable" Test if the PWM channel is enabled. -.It PWMBUS_CHANNEL_MAX "device_t bus" "int channel" "int *nchannel" -Get the maximum number of channel supported by the controller. +.It PWMBUS_CHANNEL_COUNT "device_t bus" "int channel" "int *nchannel" +Get the number of channels supported by the controller. +Channel numbers count up from zero. .El .Sh HISTORY The -- 2.45.0