From nobody Sat Nov 07 22:15:09 2026 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 4jMVj93Y29z6xtyQ for ; Sat, 07 Nov 2026 22:15:09 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jMVj919Cpz4N1R for ; Sat, 07 Nov 2026 22:15:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794089709; 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=YkKQLJ8xXXSJiSuC1KWmA+GmqmNEPCf/7ywILGfqVkA=; b=jDd0bpfuQzfwndesbEZuvm6JBkp5PQVmlEQnHGO49ZgqODyg86fFKFYrqQ4pkAmjDzAb+R O/JN4O9fZgjAVxPW7kWxiyhr24LXetur5aV84Dalblsn5oc5QSnZ1DKiFjQ7dDQYPnQARx g+HWIfZ/NSjur+wkZG/IPvWzWTXHhk8R9CcdKRqUVQC1cDJpa7P54jqkZrKna7qSRvFz+M FrFx5PG/m1rp8WFw5M2Ri/LwMY2VLVT1UrnbKiQyzLZFnUrxpk7B8dbUtACcjeSobx5hsP EVRlrNyESqLQcYRQCyK1Bcpmst1FmZWF18LrR0li1rp2LlFRYIzp50e09TkWrA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794089709; b=b0HXEk1rO1hbrqnoS0oYNIU4zewVtFewHNI0GhzIcE9dDaro545H5HgJcNTvLtZcrTsRct BxMitvqQv5oaYNV2h2b038XIYETY8k5hTCEgjWnle0B2H3DmWMltAxNokQHQHSpL/r5Dkm U9ePBy5E1dxsXVpnbKY3tVHeubA8U395La5oHjt9KncAls5VQPOpGZdMPIr1def+cH/9JY jrvIDymknE2153+oUAD+tptBIKzT9DvyzxHH4hFnNXU05Rz1ijvWz3pTnPpdWxKPL2w211 dVb96JlJNcv1HvDzBO3TYBocE2RW96gA1GyMcgaa3kE9lGOkAvqF3ZCUvcDVjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794089709; 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=YkKQLJ8xXXSJiSuC1KWmA+GmqmNEPCf/7ywILGfqVkA=; b=T6+wlIAOCNGfGLC9B0VQ2k+SAWk7o7QiD//d5aa6d5WR65fmhe5WgF3M6/uBUvOJm2trzz aD07F2lz0eImT9fLPYfSuh7NcrTHbnyW6nzExI52L5hUyopAnXevk3VMKLv1HZ+UhJsTdL EmgigMUTmU9r+FIYOIWFHzQ/uX1BBopMsRrthR+ERgmADQmS+Y2plBE4RPWMvAkOTg8xIO RTjBywe6Iy7dmPhrj2xJu7b6gia7Q3KoYTXUeP4tfxugkDXjQ3NSALcsS2tMz9nZOf6Ann hwm6P+UlXiBginYPfycHkn35e/dXsfhTQ8UcEjstcza5yEIi9yYy648sIL7LJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jMVj90MfCzh4W for ; Sat, 07 Nov 2026 22:15:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3e740 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 07 Nov 2026 22:15:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Abdelkader Boudih Subject: git: 73b1453e6d87 - main - asmc: move the backlight control level into the softc List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: seuros X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 73b1453e6d87f9af4c4761049640c238fcee3bcd Auto-Submitted: auto-generated Date: Sat, 07 Nov 2026 22:15:09 +0000 Message-Id: <6aefa2ed.3e740.1d392e43@gitrepo.freebsd.org> The branch main has been updated by seuros: URL: https://cgit.FreeBSD.org/src/commit/?id=73b1453e6d87f9af4c4761049640c238fcee3bcd commit 73b1453e6d87f9af4c4761049640c238fcee3bcd Author: Abdelkader Boudih AuthorDate: 2026-11-07 20:27:37 +0000 Commit: Abdelkader Boudih CommitDate: 2026-11-07 20:27:37 +0000 asmc: move the backlight control level into the softc light_control was a file-scope static shared by resume, the light.control sysctl and the backlight method. Per-device state belongs in the softc. No functional change. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D61291 --- sys/dev/asmc/asmc.c | 15 +++++++-------- sys/dev/asmc/asmcvar.h | 1 + 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c index 75ccb933f4d9..f5110a894c5b 100644 --- a/sys/dev/asmc/asmc.c +++ b/sys/dev/asmc/asmc.c @@ -409,8 +409,6 @@ ACPI_MODULE_NAME("ASMC") /* NB: can't be const */ static char *asmc_ids[] = { "APP0001", NULL }; -static unsigned int light_control = 0; - ACPI_PNP_INFO(asmc_ids); DRIVER_MODULE(asmc, acpi, asmc_driver, NULL, NULL); MODULE_DEPEND(asmc, acpi, 1, 1, 1); @@ -936,9 +934,10 @@ asmc_detach(device_t dev) static int asmc_resume(device_t dev) { + struct asmc_softc *sc = device_get_softc(dev); uint8_t buf[2]; - buf[0] = light_control; + buf[0] = sc->sc_light_control; buf[1] = 0x00; asmc_key_write(dev, ASMC_KEY_LIGHTVALUE, buf, sizeof(buf)); @@ -2352,15 +2351,15 @@ asmc_mbp_sysctl_light_control(SYSCTL_HANDLER_ARGS) int error; int v; - v = light_control; + v = sc->sc_light_control; error = sysctl_handle_int(oidp, &v, 0, req); if (error == 0 && req->newptr != NULL) { if (v < 0 || v > 255) return (EINVAL); - light_control = v; + sc->sc_light_control = v; sc->sc_kbd_bkl_level = v * 100 / 255; - buf[0] = light_control; + buf[0] = sc->sc_light_control; buf[1] = 0x00; asmc_key_write(dev, ASMC_KEY_LIGHTVALUE, buf, sizeof(buf)); } @@ -2465,8 +2464,8 @@ asmc_backlight_update_status(device_t dev, struct backlight_props *props) uint8_t buf[2]; sc->sc_kbd_bkl_level = props->brightness; - light_control = props->brightness * 255 / 100; - buf[0] = light_control; + sc->sc_light_control = props->brightness * 255 / 100; + buf[0] = sc->sc_light_control; buf[1] = 0x00; asmc_key_write(dev, ASMC_KEY_LIGHTVALUE, buf, sizeof(buf)); diff --git a/sys/dev/asmc/asmcvar.h b/sys/dev/asmc/asmcvar.h index 32449a72cc48..4a11008239f5 100644 --- a/sys/dev/asmc/asmcvar.h +++ b/sys/dev/asmc/asmcvar.h @@ -64,6 +64,7 @@ struct asmc_softc { uint8_t sc_sms_intr_works; struct cdev *sc_kbd_bkl; uint32_t sc_kbd_bkl_level; + unsigned int sc_light_control; #ifdef ASMC_DEBUG /* Raw key access */ struct sysctl_oid *sc_raw_tree;