[RFC,25/29] bios/vpstate: parse max battery id

Submitted by Karol Herbst on Sept. 15, 2017, 5:11 p.m.

Details

Message ID 20170915171129.5009-26-karolherbst@gmail.com
State New
Headers show
Series "Current State of my clk patches" ( rev: 1 ) in Nouveau

Not browsing as part of any series.

Commit Message

Karol Herbst Sept. 15, 2017, 5:11 p.m.
Signed-off-by: Karol Herbst <karolherbst@gmail.com>
---
 drm/nouveau/include/nvkm/subdev/bios/vpstate.h | 1 +
 drm/nouveau/nvkm/subdev/bios/vpstate.c         | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drm/nouveau/include/nvkm/subdev/bios/vpstate.h b/drm/nouveau/include/nvkm/subdev/bios/vpstate.h
index 87f804fc..181de47b 100644
--- a/drm/nouveau/include/nvkm/subdev/bios/vpstate.h
+++ b/drm/nouveau/include/nvkm/subdev/bios/vpstate.h
@@ -10,6 +10,7 @@  struct nvbios_vpstate_header {
 	u8 scount;
 	u8 slen;
 
+	u8 battery_id;
 	u8 base_id;
 	u8 boost_id;
 	u8 tdp_id;
diff --git a/drm/nouveau/nvkm/subdev/bios/vpstate.c b/drm/nouveau/nvkm/subdev/bios/vpstate.c
index 71524548..c1de6421 100644
--- a/drm/nouveau/nvkm/subdev/bios/vpstate.c
+++ b/drm/nouveau/nvkm/subdev/bios/vpstate.c
@@ -57,7 +57,8 @@  nvbios_vpstate_parse(struct nvkm_bios *b, struct nvbios_vpstate_header *h)
 		h->scount   = nvbios_rd08(b, h->offset + 0x4);
 		h->ecount   = nvbios_rd08(b, h->offset + 0x5);
 
-		h->base_id  = nvbios_rd08(b, h->offset + 0x0f);
+		h->battery_id = nvbios_rd08(b, h->offset + 0x0c);
+		h->base_id    = nvbios_rd08(b, h->offset + 0x0f);
 		if (h->hlen > 0x10)
 			h->boost_id = nvbios_rd08(b, h->offset + 0x10);
 		else