From nobody Sat Mar 05 18:40:20 2022 X-Original-To: freebsd-hackers@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 8ED5919EF82F for ; Sat, 5 Mar 2022 18:40:31 +0000 (UTC) (envelope-from freebsd-hackers@dino.sk) Received: from mailhost.netlabit.sk (mailhost.netlabit.sk [84.245.65.72]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4K9tnp2ynkz3gyV for ; Sat, 5 Mar 2022 18:40:30 +0000 (UTC) (envelope-from freebsd-hackers@dino.sk) Received: from zeta.dino.sk (fw3.dino.sk [84.245.95.254]) (AUTH: LOGIN milan, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by mailhost.netlabit.sk with ESMTPSA; Sat, 05 Mar 2022 19:40:21 +0100 id 00DADC7E.6223AE95.0000C17B Date: Sat, 5 Mar 2022 19:40:20 +0100 From: Milan Obuch To: freebsd-hackers@freebsd.org Subject: Re: GPD Micro PC power button and lid close Message-ID: <20220305194020.1b86f11c@zeta.dino.sk> In-Reply-To: References: <20220304144235.26276414@zeta.dino.sk> <20220304161609.5654c1b3@zeta.dino.sk> X-Mailer: Claws Mail 3.18.0git333 (GTK+ 2.24.33; i386-portbld-freebsd11.4) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4K9tnp2ynkz3gyV X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd-hackers@dino.sk designates 84.245.65.72 as permitted sender) smtp.mailfrom=freebsd-hackers@dino.sk X-Spamd-Result: default: False [-3.30 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[dino.sk]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_MATCH_FROMTLD(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MLMMJ_DEST(0.00)[freebsd-hackers]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:5578, ipnet:84.245.64.0/18, country:SK]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On Sat, 5 Mar 2022 19:19:35 +0100 georg.lastname@web.de wrote: > > Gesendet: Freitag, den 04.03.2022 um 16:16 Uhr > > Von: "Milan Obuch" > > An: freebsd-hackers@freebsd.org > > Betreff: GPD Micro PC power button and lid close [originally Re: > > GPD Micro PC serial port] [ snip ] > > Just for info, output from 'pciconf -lv' is attached. 'dmidecode' > > output added as well. Now, with serial port working, I see there is > > something else I forgot - power button does nothing when FreeBSD is > > running, just long press powers it off without proper shutdown > > sequence. 'dmesg | grep acpi' tells > > > > acpi0: > > cpu0: on acpi0 > > attimer0: port 0x40-0x43,0x50-0x53 irq 0 on acpi0 > > atrtc0: port 0x70-0x77 on acpi0 > > hpet0: iomem 0xfed00000-0xfed003ff irq > > 8 on acpi0 acpi_timer0: <32-bit timer at 3.579545MHz> port > > 0x408-0x40b on acpi0 acpi_ec0: port > > 0x62,0x66 on acpi0 pcib0: port 0xcf8-0xcff > > on acpi0 acpi_button0: on acpi0 > > acpi_tz0: on acpi0 > > atkbdc0: port 0x60,0x64 irq 1 on acpi0 > > uart1: <16550 or compatible> port 0x2f8-0x2ff irq 3 on acpi0 > > acpi_acad0: on acpi0 > > battery0: on acpi0 > > acpi_lid0: on acpi0 > > > > so there should be something handling power button (and lid close > > event, as well). Any idea here? > > > > Regards, > > Milan > > Hey, > > You can turn on verbose logging of acpi with "hw.acpi.verbose" kernel > environment variable. On pressing the power button, you should see > the log "power button pressed\n" and maybe more.. Maybe this cpu > doesnt support sleep state S5 (I'm a noob), as it should be triggered > when pressing the power button (see the hw.acpi.power_button_state > sysctl). > This is output of 'sysctl hw.acpi' (minus battery, acline and thermal objects, not relevant here): hw.acpi.cpu.cx_lowest: C1 hw.acpi.reset_video: 0 hw.acpi.handle_reboot: 1 hw.acpi.disable_on_reboot: 0 hw.acpi.verbose: 1 hw.acpi.s4bios: 0 hw.acpi.sleep_delay: 1 hw.acpi.suspend_state: S3 hw.acpi.standby_state: NONE hw.acpi.lid_switch_state: NONE hw.acpi.sleep_button_state: S3 hw.acpi.power_button_state: S5 hw.acpi.supported_sleep_state: S3 S4 S5 Setting hw.acpi.verbose to 1 did not achieve anything in console log, i.e. pressing power button does not geenrate any event logged there. Regards, Milan