aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorMartin Peres <martin.peres@labri.fr>2012-05-12 09:28:51 -0400
committerBen Skeggs <bskeggs@redhat.com>2012-10-02 23:13:12 -0400
commite36199980b51f081671d76de7b7b8f94fe1e0ae3 (patch)
tree328e9b475734a720e7f1a8b44b5fc112e9be4c63 /drivers/gpu/drm
parentd89c8ce07168ef6cd16c71d0a9f618829e866e87 (diff)
drm/nouveau/gpio: expose the PWM/TOGGLE parameter found in the gpio vbios table
Signed-off-by: Martin Peres <martin.peres@labri.fr> Reviewed-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/nouveau/core/include/subdev/bios/gpio.h7
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/bios/gpio.c3
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/bios/gpio.h b/drivers/gpu/drm/nouveau/core/include/subdev/bios/gpio.h
index e9789cf411c5..2bf178082a36 100644
--- a/drivers/gpu/drm/nouveau/core/include/subdev/bios/gpio.h
+++ b/drivers/gpu/drm/nouveau/core/include/subdev/bios/gpio.h
@@ -16,6 +16,13 @@ struct dcb_gpio_func {
16 u8 func; 16 u8 func;
17 u8 line; 17 u8 line;
18 u8 log[2]; 18 u8 log[2];
19
20 /* so far, "param" seems to only have an influence on PWM-related
21 * GPIOs such as FAN_CONTROL and PANEL_BACKLIGHT_LEVEL.
22 * if param equals 1, hardware PWM is available
23 * if param equals 0, the host should toggle the GPIO itself
24 */
25 u8 param;
19}; 26};
20 27
21u16 dcb_gpio_table(struct nouveau_bios *); 28u16 dcb_gpio_table(struct nouveau_bios *);
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/gpio.c b/drivers/gpu/drm/nouveau/core/subdev/bios/gpio.c
index 1ae23b328bbd..4c9f1e508165 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/bios/gpio.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/bios/gpio.c
@@ -71,6 +71,7 @@ dcb_gpio_parse(struct nouveau_bios *bios, int idx, u8 func, u8 line,
71 .func = (data & 0x07e0) >> 5, 71 .func = (data & 0x07e0) >> 5,
72 .log[0] = (data & 0x1800) >> 11, 72 .log[0] = (data & 0x1800) >> 11,
73 .log[1] = (data & 0x6000) >> 13, 73 .log[1] = (data & 0x6000) >> 13,
74 .param = !!(data & 0x8000),
74 }; 75 };
75 } else 76 } else
76 if (ver < 0x41) { 77 if (ver < 0x41) {
@@ -80,6 +81,7 @@ dcb_gpio_parse(struct nouveau_bios *bios, int idx, u8 func, u8 line,
80 .func = (data & 0x0000ff00) >> 8, 81 .func = (data & 0x0000ff00) >> 8,
81 .log[0] = (data & 0x18000000) >> 27, 82 .log[0] = (data & 0x18000000) >> 27,
82 .log[1] = (data & 0x60000000) >> 29, 83 .log[1] = (data & 0x60000000) >> 29,
84 .param = !!(data & 0x80000000),
83 }; 85 };
84 } else { 86 } else {
85 u32 data = nv_ro32(bios, entry + 0); 87 u32 data = nv_ro32(bios, entry + 0);
@@ -89,6 +91,7 @@ dcb_gpio_parse(struct nouveau_bios *bios, int idx, u8 func, u8 line,
89 .func = (data & 0x0000ff00) >> 8, 91 .func = (data & 0x0000ff00) >> 8,
90 .log[0] = (data1 & 0x30) >> 4, 92 .log[0] = (data1 & 0x30) >> 4,
91 .log[1] = (data1 & 0xc0) >> 6, 93 .log[1] = (data1 & 0xc0) >> 6,
94 .param = !!(data & 0x80000000),
92 }; 95 };
93 } 96 }
94 97