drm/nouveau/gpio: expose the PWM/TOGGLE parameter found in the gpio vbios table
authorMartin Peres <martin.peres@labri.fr>
Sat, 12 May 2012 13:28:51 +0000 (15:28 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 3 Oct 2012 03:13:12 +0000 (13:13 +1000)
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/include/subdev/bios/gpio.h
drivers/gpu/drm/nouveau/core/subdev/bios/gpio.c

index e9789cf411c59150730d9a65ba23fe35fa1b27e2..2bf178082a36dd5a9fa866b20d278b595ea674bb 100644 (file)
@@ -16,6 +16,13 @@ struct dcb_gpio_func {
        u8 func;
        u8 line;
        u8 log[2];
+
+       /* so far, "param" seems to only have an influence on PWM-related
+        * GPIOs such as FAN_CONTROL and PANEL_BACKLIGHT_LEVEL.
+        * if param equals 1, hardware PWM is available
+        * if param equals 0, the host should toggle the GPIO itself
+        */
+       u8 param;
 };
 
 u16 dcb_gpio_table(struct nouveau_bios *);
index 1ae23b328bbd44b858e0e3d78fe84f2c6703d4b2..4c9f1e508165bbd4d4d0ed1b2b777c223fe2962f 100644 (file)
@@ -71,6 +71,7 @@ dcb_gpio_parse(struct nouveau_bios *bios, int idx, u8 func, u8 line,
                                .func = (data & 0x07e0) >> 5,
                                .log[0] = (data & 0x1800) >> 11,
                                .log[1] = (data & 0x6000) >> 13,
+                               .param = !!(data & 0x8000),
                        };
                } else
                if (ver < 0x41) {
@@ -80,6 +81,7 @@ dcb_gpio_parse(struct nouveau_bios *bios, int idx, u8 func, u8 line,
                                .func = (data & 0x0000ff00) >> 8,
                                .log[0] = (data & 0x18000000) >> 27,
                                .log[1] = (data & 0x60000000) >> 29,
+                               .param = !!(data & 0x80000000),
                        };
                } else {
                        u32 data = nv_ro32(bios, entry + 0);
@@ -89,6 +91,7 @@ dcb_gpio_parse(struct nouveau_bios *bios, int idx, u8 func, u8 line,
                                .func = (data & 0x0000ff00) >> 8,
                                .log[0] = (data1 & 0x30) >> 4,
                                .log[1] = (data1 & 0xc0) >> 6,
+                               .param = !!(data & 0x80000000),
                        };
                }