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

Karol Herbst
2017-09-15T17:11:25Z

drm/nouveau/include/nvkm/subdev/bios/vpstate.h | 1 +
 drm/nouveau/nvkm/subdev/bios/vpstate.c         | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

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
--
2.14.1