aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorIan Lepore <ian@FreeBSD.org>2019-06-15 19:46:59 +0000
committerIan Lepore <ian@FreeBSD.org>2019-06-15 19:46:59 +0000
commit71fb373934f636f01d0d3de44519d06ce8582a1c (patch)
treeee28f0cb056f30122aeb07a0e32932936df2fdc1 /sys/dev
parentf9d8090ea8c9898b94908a9704ba439fa628dc3c (diff)
downloadsrc-71fb373934f636f01d0d3de44519d06ce8582a1c.tar.gz
src-71fb373934f636f01d0d3de44519d06ce8582a1c.zip
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.
Notes
Notes: svn path=/head/; revision=349074
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pwm/pwmc.c2
-rw-r--r--sys/dev/pwm/pwmc.h53
2 files changed, 54 insertions, 1 deletions
diff --git a/sys/dev/pwm/pwmc.c b/sys/dev/pwm/pwmc.c
index 18bebcca8f62..58cb78653446 100644
--- a/sys/dev/pwm/pwmc.c
+++ b/sys/dev/pwm/pwmc.c
@@ -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"
diff --git a/sys/dev/pwm/pwmc.h b/sys/dev/pwm/pwmc.h
new file mode 100644
index 000000000000..9940c8cad9e9
--- /dev/null
+++ b/sys/dev/pwm/pwmc.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_ */