From nobody Wed Dec 11 07:15:34 2024 X-Original-To: freebsd-arm@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 4Y7Rhc2l3Xz5gXns for ; Wed, 11 Dec 2024 07:15:44 +0000 (UTC) (envelope-from toby@tobykurien.com) Received: from spe14.ucebox.co.za (spe14.ucebox.co.za [197.242.154.255]) (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 (2048 bits) client-digest SHA256) (Client CN "*.ucebox.co.za", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y7Rhb3LgGz4XVq for ; Wed, 11 Dec 2024 07:15:43 +0000 (UTC) (envelope-from toby@tobykurien.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of toby@tobykurien.com designates 197.242.154.255 as permitted sender) smtp.mailfrom=toby@tobykurien.com; dmarc=none Received: from doxy.aserv.co.za ([154.0.166.100]) by spe6.ucebox.co.za with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1tLGwa-000GWD-4a for freebsd-arm@freebsd.org; Wed, 11 Dec 2024 09:15:40 +0200 Received: from cloud.nextcloudhosting.co.za (unknown [129.232.144.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by doxy.aserv.co.za (Postfix) with ESMTPSA id 3B58626344E for ; Wed, 11 Dec 2024 09:15:34 +0200 (SAST) From: Toby Kurien To: freebsd-arm@freebsd.org Cc: Subject: Battery info sysctl for arm devices Message-ID: <20241211071534.Horde.gSiFIgVN4paXTOU2_b343Cw@cloud.nextcloudhosting.co.za> User-Agent: Horde Application Framework 5 Date: Wed, 11 Dec 2024 07:15:34 +0000 Content-Type: text/plain; charset=utf-8 List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@FreeBSD.org MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Originating-IP: 154.0.166.100 X-Afrihost-Domain: doxy.aserv.co.za X-Afrihost-Username: 154.0.166.100 X-Afrihost-Outgoing-Class: ham X-Afrihost-Outgoing-Evidence: Combined (0.20) X-Recommended-Action: accept X-Filter-ID: Pt3MvcO5N4iKaDQ5O6lkdGlMVN6RH8bjRMzItlySaT8cjhcTdzIGqj7BloAT3Nj+PUtbdvnXkggZ 3YnVId/Y5jcf0yeVQAvfjHznO7+bT5wOvGg18h18lTsuUGH1KgAagLCWYuPCxwJEfxKP87A95+fH zJ6mVE7ewsipSVIfs4bBfr27I4/2JTBKq0o12/tLABHVTw1lV42ob3hDgXVUNbZJMuJHHFnTdGKa 3VxxhLA8U1774x9DQql3n5V1vHjnkuW1FFLwEW3UVQ/02r/eitdn5CXCG6zzUxxWbE5VnshZuq+G 2oQ/vt6xiyrRL0L0XzxdcSEOF5ZgjdwpVsfMm9dCYgcgr835yVjKQZA6hJL1LiMHCxRezvZaFOrU Vh8zNqs59tg7m1SQLJtFApHh60KEcxAcIwRZNf0cSHBI/j8xKX6Z6/Qz1w7TE/bz3YPRDfgblxZ8 KT4UwlLW+nAm2eZE7YJwhBWCb1PmFojBOyjXs2KsRjKrCowEavDwQuKoDMwQiNpECc6NeluD4mMa /1YmDHeI9dU6Rq238kXYC+KNLtSRWKGmohoil/1AiKo+tkgXyuidojvEg3qjfiiAf/vg7iEFLP+S SY+Av5+AiC4Q9+LS5YIOCn3baNtafsxJZeE9X7Qt/tT9vYsw+9vzxProLw1ESV6ToKzqj0qJdsxi 7wLmYnntkb2D1B9sGkgX6AI6pTFIoVI/Peqa8FJgmUNU9Dp8x6/UEw+9D2q7hxbTPpuFqUUQz+mM 8JAD4ECW9PdzDiFcua4kRkwYuiwnwmE+oieZBNWjQp7KvA9rL5W0d+Ug/0Y6tyoB8uXgS0TfHcCD ooCuxDL/i74+7vgEMUM8OjekMmVSVDbk9qyMgwitCXpBfzDSSC+2Vj74VH+F647lNwN4qOsSZg+f YhVZG+6SG5hefERz8WXBhqzmHmG1eaUj5FoXNEbhBLK2TBmEJmdCcA9AKNTczwKtUhS2Zh/E4CzA yNqD5493DFdserUCBqkPbb/kCP/GyVrsfgKvwxD5pmmzp2dFEfeM7zSAr/Y4ocfmWv3Fe9Iziczd q+A= X-Report-Abuse-To: spam@spe1.ucebox.co.za X-Spamd-Result: default: False [-3.11 / 15.00]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-0.81)[-0.805]; R_SPF_ALLOW(-0.20)[+ip4:197.242.144.0/20:c]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[tobykurien.com]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ASN(0.00)[asn:37611, ipnet:197.242.144.0/20, country:ZA]; ARC_NA(0.00)[]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[freebsd-arm@freebsd.org]; HAS_XOIP(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; RCPT_COUNT_ONE(0.00)[1] X-Rspamd-Queue-Id: 4Y7Rhb3LgGz4XVq X-Spamd-Bar: --- I am new to FreeBSD and busy implementing a driver for the battery and charge controller in the Pinephone Pro. Everything battery-related appears to fall under ACPI, including the sysctls in hw.acpi.battery.* and I was wondering how battery on ARM is normally handled? Is there a /dev/acpi on ARM or is there a different standard for handling battery on ARM?    I looked into the source for upower to see how it handles FreeBSD, but it seems to be based on ACPI. I was wondering if I should "emulate" ACPI by registering "hw.acpi.battery.*" to expose the battery info, but then it seems upower will try to use /dev/acpi, which would fail. Any pointers on how to expose battery state on ARM would be appreciated.    --   http://tobykurien.com     --   tobykurien.com