[PATCH i-g-t 06/13] tools/intel_vbt_decode: Decode the backlight i2c stuff

Jani Nikula jani.nikula at intel.com
Thu Apr 11 12:44:09 UTC 2024


On Fri, 22 Mar 2024, Ville Syrjala <ville.syrjala at linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> Decode the (obsolete) backlight i2c stuff for completeness.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>  tools/intel_vbt_decode.c | 45 ++++++++++++++++++++++++++++------------
>  1 file changed, 32 insertions(+), 13 deletions(-)
>
> diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
> index 9c0774248e56..fa7bbc345eec 100644
> --- a/tools/intel_vbt_decode.c
> +++ b/tools/intel_vbt_decode.c
> @@ -592,6 +592,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>";

< missing, can be fixed while applying,

Reviewed-by: Jani Nikula <jani.nikula at intel.com>


> +	}
> +}
> +
> +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)
>  {
> @@ -615,11 +636,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];
> @@ -933,17 +963,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)
>  {

-- 
Jani Nikula, Intel


More information about the igt-dev mailing list