From nobody Wed Sep 07 15:10:01 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MN5K54898z4cd5B; Wed, 7 Sep 2022 15:10:01 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MN5K53JkLz3XK7; Wed, 7 Sep 2022 15:10:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662563401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wPYXzs/SNGHn5VVMw2yQbTwul3O6MDsX3KGN3lp/cjU=; b=cPeezEtG0WroeOqtV7IVzZ2T8OcMCODwzIR29asLqRumjmGtqrYsZoxRXLxSZVTcQZRdlO NgdmE4y3S7z6w5uKSswqzNZarrlCKT87ZxgPXjLAehbX6pkmIzt9Rz8UCFyjIkuh28SG97 WQXGO+JSmHVjRIZ0VOSlnwTVOv2YIlHunfFq8v0TdR6LLa/yASb7yJu1Vs4bVW2eMZpkaW uR2M8TWsm1RGSHkhJKQvMC/rABXrVZRxVrODlEpDqB8CMT/iz2kKeuZCBJbuv96+1XbKPi O3NDVTVyH/Kxvcv+hulnZi25GOU248pt2qCNK7uxraiV5uR6O1zaJ45FSL7o3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MN5K52R1PzZ2Q; Wed, 7 Sep 2022 15:10:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 287FA1E0018628; Wed, 7 Sep 2022 15:10:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 287FA1b5018615; Wed, 7 Sep 2022 15:10:01 GMT (envelope-from git) Date: Wed, 7 Sep 2022 15:10:01 GMT Message-Id: <202209071510.287FA1b5018615@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: c4f5684feb5a - stable/13 - linuxkpi: Add pwm.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c4f5684feb5af5afab3d3fd8b1f7ae7d53a5657d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662563401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wPYXzs/SNGHn5VVMw2yQbTwul3O6MDsX3KGN3lp/cjU=; b=sXD9viP80/Q96mIU7oBYuus8dDaTyDvdhzkwJrYJrfI2aMGcEkRXJ/OinG7MOcUKMOZ3+x GXyEw3tAfnB2Jt/e9p+X312tkIJsoSpwY8Kk7yLQerdi496+JMbnPVu/C+SwCV7RFZ0eYw dAxbHSjfF0yBtGdCoMODIjKkLHJLltpbqlfeEgQkzLRS5go/8B6gYa4Lenveji/EDbbvb2 gCFKwjp0jTeSSQO1x1v0P38/eqAefETgVN47nmQB7cqkivPyAA54BtHdRfSTsNEjcHa9Sx hY7VE2TcSJ3bPdODvEYiXa4AjTB9Jn3jR6OM1bNhIUPn4JwACJl5sCl8XCVMDg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662563401; a=rsa-sha256; cv=none; b=EsCgIX9GHW4wFg60UbSCzCi5MOqsgsAySI0uNQ4wyxbKIgvikaS9Uc69hzseD7H/XiIWef QYlkQXsGu49UMy1joUMI+FTWmyWxgUXnPyPmT84uxW/oKdEydp4sD58pXPb/R3AT1kUr/3 TAywXVn5G8mKNZaAlz4LKHnSkbAC4GZ+1eYEZcxrdSuk3k19h+CaKk6Re1T0u9nzU+jRel Y30cvQ2dPPrXoSvV2C2oEnFTHQzt4OQxhyGs1nwOCuPA8PbnwmilFrCx6+zKXVwkdqE0hr GxGL5hSDURcd6fSXJQxoUaEfLMVTkpElg9eUh7qxoP7UHv7EDQ+vM4Lf7gqIlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=c4f5684feb5af5afab3d3fd8b1f7ae7d53a5657d commit c4f5684feb5af5afab3d3fd8b1f7ae7d53a5657d Author: Emmanuel Vadot AuthorDate: 2022-06-23 08:25:23 +0000 Commit: Emmanuel Vadot CommitDate: 2022-09-07 15:09:03 +0000 linuxkpi: Add pwm.h Provide dummy functions needed for drm-kmod. Reviewed by: bz MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D35572 (cherry picked from commit 2b743f65f1c9352686ba0396f8ca3914a8025c4a) --- sys/compat/linuxkpi/common/include/linux/pwm.h | 94 ++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pwm.h b/sys/compat/linuxkpi/common/include/linux/pwm.h new file mode 100644 index 000000000000..59a17f525c91 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/pwm.h @@ -0,0 +1,94 @@ +/*- + * Copyright (c) 2022 Vladimir Kondratyev + * + * 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. + */ + +#ifndef _LINUXKPI_LINUX_PWM_H_ +#define _LINUXKPI_LINUX_PWM_H_ + +#include +#include + +struct pwm_state { + uint64_t period; + bool enabled; +}; + +struct pwm_device { + struct pwm_state state; +}; + +static inline struct pwm_device * +pwm_get(struct device *dev, const char *consumer) +{ + return (ERR_PTR(-ENODEV)); +} + +static inline void +pwm_put(struct pwm_device *pwm) +{ +} + +static inline int +pwm_enable(struct pwm_device *pwm) +{ + return (-EINVAL); +} + +static inline void +pwm_disable(struct pwm_device *pwm) +{ +} + +static inline bool +pwm_is_enabled(const struct pwm_device *pwm) +{ + return (false); +} + +static inline unsigned int +pwm_get_relative_duty_cycle(const struct pwm_state *state, unsigned int scale) +{ + return (0); +} + +static inline int +pwm_set_relative_duty_cycle(struct pwm_state *state, unsigned int duty_cycle, + unsigned int scale) +{ + return (0); +} + +static inline void +pwm_get_state(const struct pwm_device *pwm, struct pwm_state *state) +{ + *state = pwm->state; +} + +static inline int +pwm_apply_state(struct pwm_device *pwm, const struct pwm_state *state) +{ + return (-ENOTSUPP); +} + +#endif /* _LINUXKPI_LINUX_PWM_H_ */