summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2024-02-21 20:28:21 +0200
committerVille Syrjälä <ville.syrjala@linux.intel.com>2024-04-18 14:05:04 +0300
commit7264fef45bd3802ff180cd241e58f7b9fcb3b29e (patch)
tree54fcdf1526c05af0fb38209ebfcf66abae8f751e
parent959f8db1cfabe1ecff7e41a831dbb1459d0f08d8 (diff)
tools/intel_vbt_decode: Decode the backlight i2c stuff
Decode the (obsolete) backlight i2c stuff for completeness. v2: Add missing '<' to "<reserved>" (Jani) Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
-rw-r--r--tools/intel_vbt_decode.c45
1 files changed, 32 insertions, 13 deletions
diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index 5b2bdc7e7..5acaf1835 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -620,6 +620,27 @@ static void dump_general_features(struct context *context,
printf("\tDP SSC dongle supported: %s\n", YESNO(features->dp_ssc_dongle_supported));
}
+static const char *inverter_type(u8 type)
+{
+ switch (type) {
+ case 0: return "none/external";
+ case 1: return "I2C";
+ case 2: return "PWM";
+ default: return "<reserved>";
+ }
+}
+
+static const char *i2c_speed(u8 i2c_speed)
+{
+ switch (i2c_speed) {
+ case 0: return "100 kHz";
+ case 1: return "50 kHz";
+ case 2: return "400 kHz";
+ case 3: return "1 MHz";
+ default: return "<unknown>";
+ }
+}
+
static void dump_backlight_info(struct context *context,
const struct bdb_block *block)
{
@@ -642,11 +663,20 @@ static void dump_backlight_info(struct context *context,
blc = &backlight->data[i];
- printf("\t\tInverter type: %u\n", blc->type);
- printf("\t\tActive low: %u\n", blc->active_low_pwm);
+ printf("\t\tInverter type: %s (%u)\n",
+ inverter_type(blc->type), blc->type);
+ printf("\t\tActive low: %s\n", YESNO(blc->active_low_pwm));
printf("\t\tPWM freq: %u\n", blc->pwm_freq_hz);
printf("\t\tMinimum brightness: %u\n", blc->min_brightness);
+ if (blc->type == 1) {
+ printf("\t\tI2C pin: 0x%02x\n", blc->i2c_pin);
+ printf("\t\tI2C speed: %s (0x%02x)\n",
+ i2c_speed(blc->i2c_speed), blc->i2c_speed);
+ printf("\t\tI2C address: 0x%02x\n", blc->i2c_address);
+ printf("\t\tI2C command: 0x%02x\n", blc->i2c_command);
+ }
+
printf("\t\tLevel: %u\n", backlight->level[i]);
control = &backlight->backlight_control[i];
@@ -960,17 +990,6 @@ static const char *hdmi_frl_rate(u8 frl_rate)
}
}
-static const char *i2c_speed(u8 i2c_speed)
-{
- switch (i2c_speed) {
- case 0: return "100 kHz";
- case 1: return "50 kHz";
- case 2: return "400 kHz";
- case 3: return "1 MHz";
- default: return "<unknown>";
- }
-}
-
static void dump_child_device(struct context *context,
const struct child_device_config *child)
{