mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
drm/nouveau/bios/fan: pointers are 32-bit
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
6496b4e5ab
commit
4a8daacf50
2 changed files with 10 additions and 10 deletions
|
@ -2,5 +2,5 @@
|
|||
#define __NVBIOS_FAN_H__
|
||||
#include <subdev/bios/therm.h>
|
||||
|
||||
u16 nvbios_fan_parse(struct nvkm_bios *bios, struct nvbios_therm_fan *fan);
|
||||
u32 nvbios_fan_parse(struct nvkm_bios *bios, struct nvbios_therm_fan *fan);
|
||||
#endif
|
||||
|
|
|
@ -25,15 +25,15 @@
|
|||
#include <subdev/bios/bit.h>
|
||||
#include <subdev/bios/fan.h>
|
||||
|
||||
static u16
|
||||
static u32
|
||||
nvbios_fan_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
|
||||
{
|
||||
struct bit_entry bit_P;
|
||||
u16 fan = 0x0000;
|
||||
u32 fan = 0;
|
||||
|
||||
if (!bit_entry(bios, 'P', &bit_P)) {
|
||||
if (bit_P.version == 2 && bit_P.length >= 0x5a)
|
||||
fan = nvbios_rd16(bios, bit_P.offset + 0x58);
|
||||
fan = nvbios_rd32(bios, bit_P.offset + 0x58);
|
||||
|
||||
if (fan) {
|
||||
*ver = nvbios_rd08(bios, fan + 0);
|
||||
|
@ -49,25 +49,25 @@ nvbios_fan_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
|
|||
}
|
||||
}
|
||||
|
||||
return 0x0000;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static u16
|
||||
static u32
|
||||
nvbios_fan_entry(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr,
|
||||
u8 *cnt, u8 *len)
|
||||
{
|
||||
u16 data = nvbios_fan_table(bios, ver, hdr, cnt, len);
|
||||
u32 data = nvbios_fan_table(bios, ver, hdr, cnt, len);
|
||||
if (data && idx < *cnt)
|
||||
return data + *hdr + (idx * (*len));
|
||||
return 0x0000;
|
||||
return 0;
|
||||
}
|
||||
|
||||
u16
|
||||
u32
|
||||
nvbios_fan_parse(struct nvkm_bios *bios, struct nvbios_therm_fan *fan)
|
||||
{
|
||||
u8 ver, hdr, cnt, len;
|
||||
|
||||
u16 data = nvbios_fan_entry(bios, 0, &ver, &hdr, &cnt, &len);
|
||||
u32 data = nvbios_fan_entry(bios, 0, &ver, &hdr, &cnt, &len);
|
||||
if (data) {
|
||||
u8 type = nvbios_rd08(bios, data + 0x00);
|
||||
switch (type) {
|
||||
|
|
Loading…
Reference in a new issue