Page MenuHomeFreeBSD

D61291.1794189347.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D61291.1794189347.diff

diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c
--- a/sys/dev/asmc/asmc.c
+++ b/sys/dev/asmc/asmc.c
@@ -409,8 +409,6 @@
/* 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 @@
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 @@
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 @@
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
--- a/sys/dev/asmc/asmcvar.h
+++ b/sys/dev/asmc/asmcvar.h
@@ -64,6 +64,7 @@
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;

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 9, 1:55 AM (15 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41595943
Default Alt Text
D61291.1794189347.diff (1 KB)

Event Timeline