summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2009-08-17 15:19:41 -0700
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-08-18 10:57:18 -0700
commit320f21669900f99a7daf8f2294f37be9ad71d05f (patch)
tree0aad75df7dae9d978f4b4aab5a2eaf86801b2400
parenta50916530426a662f5ed262892080b860a445da3 (diff)
Dump LVDS backlight info from bios_reader
Add LVDS backlight and power VBT structures and dump from the BIOS reader.
-rw-r--r--src/bios_reader/bios_reader.c34
-rw-r--r--src/i830_bios.h38
2 files changed, 72 insertions, 0 deletions
diff --git a/src/bios_reader/bios_reader.c b/src/bios_reader/bios_reader.c
index 3b880a7d..2a69d278 100644
--- a/src/bios_reader/bios_reader.c
+++ b/src/bios_reader/bios_reader.c
@@ -163,6 +163,39 @@ static void dump_general_features(void)
free(block);
}
+static void dump_backlight_info(void)
+{
+ struct bdb_block *block;
+ struct bdb_lvds_backlight *backlight;
+ struct blc_struct *blc;
+
+ block = find_section(BDB_LVDS_BACKLIGHT);
+
+ if (!block)
+ return;
+
+ backlight = block->data;
+
+ printf("Backlight info block:\n");
+
+ if (sizeof(struct blc_struct) != backlight->blcstruct_size) {
+ printf("\tBacklight struct sizes don't match (expected %d, got %d), skipping\n",
+ sizeof(struct blc_struct), backlight->blcstruct_size);
+ return;
+ }
+
+ blc = &backlight->panels[panel_type];
+
+ printf("\tInverter type: %d\n", blc->inverter_type);
+ printf("\t polarity: %d\n", blc->inverter_polarity);
+ printf("\t GPIO pins: %d\n", blc->gpio_pins);
+ printf("\t GMBUS speed: %d\n", blc->gmbus_speed);
+ printf("\t PWM freq: %d\n", blc->pwm_freq);
+ printf("\tMinimum brightness: %d\n", blc->min_brightness);
+ printf("\tI2C slave addr: 0x%02x\n", blc->i2c_slave_addr);
+ printf("\tI2C command: 0x%02x\n", blc->i2c_cmd);
+}
+
static void dump_general_definitions(void)
{
struct bdb_block *block;
@@ -524,6 +557,7 @@ int main(int argc, char **argv)
dump_lvds_options();
dump_lvds_data();
dump_lvds_ptr_data();
+ dump_backlight_info();
dump_driver_feature();
diff --git a/src/i830_bios.h b/src/i830_bios.h
index 8a3025e7..754fc86e 100644
--- a/src/i830_bios.h
+++ b/src/i830_bios.h
@@ -395,6 +395,44 @@ struct vch_bdb_22 {
struct vch_panel_data panels[16];
} __attribute__((packed));
+#define BLC_INVERTER_TYPE_NONE 0
+#define BLC_INVERTER_TYPE_I2C 1
+#define BLC_INVERTER_TYPE_PWM 2
+
+#define BLC_GPIO_NONE 0
+#define BLC_GPIO_I2C 1
+#define BLC_GPIO_CRT_DDC 2
+#define BLC_GPIO_DVI_DDC 3
+#define BLC_GPIO_SDVO_I2C 5
+
+struct blc_struct {
+ uint8_t inverter_type:2;
+ uint8_t inverter_polarity:1; /* 1 means inverted (0 = max brightness) */
+ uint8_t gpio_pins:3;
+ uint8_t gmbus_speed:2;
+ uint16_t pwm_freq; /* in Hz */
+ uint8_t min_brightness; /* (0-255) */
+ uint8_t i2c_slave_addr;
+ uint8_t i2c_cmd;
+} __attribute__((packed));
+
+struct bdb_lvds_backlight {
+ uint8_t blcstruct_size;
+ struct blc_struct panels[16];
+} __attribute__((packed));
+
+struct bdb_lvds_power {
+ uint8_t dpst_enabled:1;
+ uint8_t pwr_prefs:3;
+ uint8_t rsvd1:3;
+ uint8_t als_enabled:1;
+ uint16_t als_backlight1;
+ uint16_t als_backlight2;
+ uint16_t als_backlight3;
+ uint16_t als_backlight4;
+ uint16_t als_backlight5;
+} __attribute__((packed));
+
#define BDB_DRIVER_NO_LVDS 0
#define BDB_DRIVER_INT_LVDS 1
#define BDB_DRIVER_SDVO_LVDS 2