Date: Sat, 15 Jun 2019 19:46:59 +0000 (UTC) From: Ian Lepore <ian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349074 - in head: . etc/mtree include sys/dev/pwm sys/sys usr.sbin/pwm Message-ID: <201906151946.x5FJkxeI016189@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ian Date: Sat Jun 15 19:46:59 2019 New Revision: 349074 URL: https://svnweb.freebsd.org/changeset/base/349074 Log: Move/rename the sys/pwm.h header file to dev/pwm/pwmc.h. The file contains ioctl definitions and related datatypes that allow userland control of pwm hardware via the pwmc device. The new name and location better reflects its assocation with a single device driver. Added: head/sys/dev/pwm/pwmc.h - copied unchanged from r349073, head/sys/sys/pwm.h Deleted: head/sys/sys/pwm.h Modified: head/ObsoleteFiles.inc head/etc/mtree/BSD.include.dist head/include/Makefile head/sys/dev/pwm/pwmc.c head/usr.sbin/pwm/pwm.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Jun 15 19:43:33 2019 (r349073) +++ head/ObsoleteFiles.inc Sat Jun 15 19:46:59 2019 (r349074) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20190615: sys/pwm.h renamed to dev/pwmc.h +OLD_FILES+=usr/include/sys/pwm.h # 20190612: new clang import which bumps version from 8.0.0 to 8.0.1. OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/8.0.0/include/sanitizer/asan_interface.h Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Sat Jun 15 19:43:33 2019 (r349073) +++ head/etc/mtree/BSD.include.dist Sat Jun 15 19:46:59 2019 (r349074) @@ -152,6 +152,8 @@ .. ppbus .. + pwm + .. smbus .. speaker Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sat Jun 15 19:43:33 2019 (r349073) +++ head/include/Makefile Sat Jun 15 19:46:59 2019 (r349074) @@ -46,8 +46,8 @@ LSUBDIRS= cam/ata cam/mmc cam/nvme cam/scsi \ dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/filemon dev/firewire \ dev/hwpmc dev/hyperv \ dev/ic dev/iicbus dev/io dev/mfi dev/mmc dev/nvme \ - dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \ - dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/wi \ + dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/pwm \ + dev/smbus dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/wi \ fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/nullfs \ fs/procfs fs/smbfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ Modified: head/sys/dev/pwm/pwmc.c ============================================================================== --- head/sys/dev/pwm/pwmc.c Sat Jun 15 19:43:33 2019 (r349073) +++ head/sys/dev/pwm/pwmc.c Sat Jun 15 19:46:59 2019 (r349074) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include <sys/module.h> #include <sys/time.h> -#include <sys/pwm.h> +#include <dev/pwm/pwmc.h> #include "pwmbus_if.h" #include "pwm_if.h" Copied: head/sys/dev/pwm/pwmc.h (from r349073, head/sys/sys/pwm.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/pwm/pwmc.h Sat Jun 15 19:46:59 2019 (r349074, copy of r349073, head/sys/sys/pwm.h) @@ -0,0 +1,53 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Emmanuel Vadot <manu@FreeBSD.org> + * All rights reserved. + * + * 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 AUTHOR AND CONTRIBUTORS ``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 AUTHOR OR CONTRIBUTORS 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$ + */ + +#ifndef _PWM_H_ +#define _PWM_H_ + +#define PWM_POLARITY_INVERTED (1 << 0) + +struct pwm_state { + int channel; + unsigned int period; + unsigned int duty; + uint32_t flags; + bool enable; +}; + +/* + * ioctls + */ + +#define PWMMAXCHANNEL _IOWR('G', 0, int) +#define PWMGETSTATE _IOWR('G', 1, struct pwm_state) +#define PWMSETSTATE _IOWR('G', 2, struct pwm_state) + + +#endif /* _PWM_H_ */ Modified: head/usr.sbin/pwm/pwm.c ============================================================================== --- head/usr.sbin/pwm/pwm.c Sat Jun 15 19:43:33 2019 (r349073) +++ head/usr.sbin/pwm/pwm.c Sat Jun 15 19:46:59 2019 (r349074) @@ -31,8 +31,8 @@ #include <sys/types.h> #include <sys/ioctl.h> #include <stdbool.h> -#include <sys/pwm.h> #include <sys/capsicum.h> +#include <dev/pwm/pwmc.h> #include <err.h> #include <errno.h>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906151946.x5FJkxeI016189>