From nobody Thu Feb 17 08:43:21 2022 X-Original-To: dev-commits-src-main@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 3CABD19D8CC8; Thu, 17 Feb 2022 08:43:22 +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 4JzpJ95q6cz3pXd; Thu, 17 Feb 2022 08:43:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645087402; 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=rKJpH7sEvlMRTs9BFqhR+22/8Z3/aouWQBWkWhy3i24=; b=F6t31HLanoOfZsmZJgk/h58L4rtfLibej7+N6d4QN2DZQVEMChX5KRXMnndoL8feC20Lgu eKqb4tHaegY7dPypmq3bHA/Cqz7d9D+Dl7ln3K4V9ynU8qm4Szk3vuiXoSNelfSg4AHR/w wRS7O15CAB0ISOCsqRBjf+gDyuu+lx628hMVFyfyMvU2N2RzV9cU1jkIudd2dbrQFKNZ6N cO4aVJJsEQuKpQ/DSbLJP7biGaLTckO92LkPWTsE+Ztnwizfz9AZFHiIdJYTMCXEqbTXuA RFUCIQdWKC4P8ArDdXiPZ52CI3Srrk2os5yFDgZOHcJp2ZUm4CgWKE2yAOg7+w== 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 8DEC526C18; Thu, 17 Feb 2022 08:43:21 +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 21H8hLPk045163; Thu, 17 Feb 2022 08:43:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21H8hL5U045162; Thu, 17 Feb 2022 08:43:21 GMT (envelope-from git) Date: Thu, 17 Feb 2022 08:43:21 GMT Message-Id: <202202170843.21H8hL5U045162@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 2cc3af6e1d79 - main - linuxkpi: Add backlight_device_set_brightness List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 2cc3af6e1d795c6d33afaf994c18abaab87a443b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645087402; 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=rKJpH7sEvlMRTs9BFqhR+22/8Z3/aouWQBWkWhy3i24=; b=aVfE/l9f5UFwM4fEtsujIQ0P8Id0NBTvZohXdybjHPZvww82rENkWWvdgUY0W2o3feuxfI ElJA0AnjJTJvkoiGQkvt9f1HIAPB5oYxguAwyZfWqz9iZl1A6PXsEwBCCGtXn0qr+w9uql 3WlhPVEyHfdiQDPvmsh5LVv2x2c5OQsxy31yWfGGhSqAy68MQEmiGRRhoShD0fR6YXnEkZ sVBXIznU5HQ8A8KEkRsEdFKxblJk2hVYyoDAobCPU/21XPY+WrXmFycblzLnw4I22GbtVc QmgKIxjqA+X7EBfuTlcgwJhbkBfUqvbVGvRSXBdsZP0D1AJRCGPRHiZ9cElAog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645087402; a=rsa-sha256; cv=none; b=fWxsEDOh1nowue+RZemaGjfrDgydT3WEv6hzyFFK6B93mR74ZbtcpYIHQVd/ktwurSbK1J yK5PRamwnuHm3Zi2ZuP9QrdoAZi4brteOMyh2tXnqfGUNMPkYg9BdWtOhmQruOtMaUDDr1 XeQ7wxvWuD8ZRzWtSr7BFnbHAJCnd/gylMIwRw70TG0b3CH5yEy8NLFtzMDBhsr4QxxT9z lwlqNL4zS3/B/3S9Wrh95AJE6nRQ/q3sKrGnz+ZQS/SV8OeGnFcK6g9fi82z6Bb92aQf23 +r5BtV1wXiLVvPD0DzQuVK8EgOc78Jzu6eH5ZrSaaOFUTffATF405DX0tGra+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=2cc3af6e1d795c6d33afaf994c18abaab87a443b commit 2cc3af6e1d795c6d33afaf994c18abaab87a443b Author: Emmanuel Vadot AuthorDate: 2022-02-15 11:05:07 +0000 Commit: Emmanuel Vadot CommitDate: 2022-02-17 08:31:12 +0000 linuxkpi: Add backlight_device_set_brightness This simply set the brightness of a backlight device. Needed by drm-kmod v5.8 Reviewed by: bz, emaste MFC after: 2 weeks Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D34285 --- sys/compat/linuxkpi/common/include/linux/backlight.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/backlight.h b/sys/compat/linuxkpi/common/include/linux/backlight.h index 38b3786e738d..9591a4b671ab 100644 --- a/sys/compat/linuxkpi/common/include/linux/backlight.h +++ b/sys/compat/linuxkpi/common/include/linux/backlight.h @@ -91,6 +91,16 @@ backlight_force_update(struct backlight_device *bd, int reason) bd->props.brightness = bd->ops->get_brightness(bd); } +static inline int +backlight_device_set_brightness(struct backlight_device *bd, int brightness) +{ + + if (brightness > bd->props.max_brightness) + return (EINVAL); + bd->props.brightness = brightness; + return (bd->ops->update_status(bd)); +} + static inline int backlight_enable(struct backlight_device *bd) {