From af93336da378fed9b2f15734518a1ca05c7769b7 Mon Sep 17 00:00:00 2001 From: Elyes Haouas Date: Sun, 19 Mar 2023 08:01:53 +0100 Subject: [PATCH] ec/lenovo/pmh7/chip.h: Use 'bool' instead of 'int' This to fix following error using Clang-16.0.0: /cb-build/coreboot-toolchain.0/clang/LENOVO_W500/mainboard/lenovo/t400/static.c:135:22: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion] .backlight_enable = 0x01, ^~~~ /cb-build/coreboot-toolchain.0/clang/LENOVO_W500/mainboard/lenovo/t400/static.c:136:23: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion] .dock_event_enable = 0x01, ^~~~ Change-Id: Icd35224877fee355e1bbb8a8e838cb047604babb Signed-off-by: Elyes Haouas Reviewed-on: https://review.coreboot.org/c/coreboot/+/73810 Tested-by: build bot (Jenkins) Reviewed-by: Felix Singer --- src/ec/lenovo/pmh7/chip.h | 6 ++++-- src/mainboard/lenovo/haswell/variants/t440p/devicetree.cb | 4 ++-- src/mainboard/lenovo/haswell/variants/w541/devicetree.cb | 4 ++-- src/mainboard/lenovo/l520/devicetree.cb | 4 ++-- src/mainboard/lenovo/t400/devicetree.cb | 4 ++-- src/mainboard/lenovo/t410/devicetree.cb | 4 ++-- src/mainboard/lenovo/t420/devicetree.cb | 4 ++-- src/mainboard/lenovo/t420s/devicetree.cb | 4 ++-- src/mainboard/lenovo/t430/devicetree.cb | 4 ++-- src/mainboard/lenovo/t430s/devicetree.cb | 4 ++-- src/mainboard/lenovo/t520/devicetree.cb | 4 ++-- src/mainboard/lenovo/t530/devicetree.cb | 4 ++-- src/mainboard/lenovo/t60/devicetree.cb | 4 ++-- src/mainboard/lenovo/x1_carbon_gen1/devicetree.cb | 4 ++-- src/mainboard/lenovo/x200/devicetree.cb | 2 +- src/mainboard/lenovo/x200/variants/x200/overridetree.cb | 2 +- src/mainboard/lenovo/x201/devicetree.cb | 4 ++-- src/mainboard/lenovo/x220/devicetree.cb | 4 ++-- src/mainboard/lenovo/x230/devicetree.cb | 4 ++-- src/mainboard/lenovo/x60/devicetree.cb | 4 ++-- util/autoport/ec_lenovo.go | 4 ++-- 21 files changed, 42 insertions(+), 40 deletions(-) diff --git a/src/ec/lenovo/pmh7/chip.h b/src/ec/lenovo/pmh7/chip.h index 1302139fe2..896578f1bf 100644 --- a/src/ec/lenovo/pmh7/chip.h +++ b/src/ec/lenovo/pmh7/chip.h @@ -3,9 +3,11 @@ #ifndef EC_LENOVO_PMH7_CHIP_H #define EC_LENOVO_PMH7_CHIP_H +#include + struct ec_lenovo_pmh7_config { - int backlight_enable:1; - int dock_event_enable:1; + bool backlight_enable; + bool dock_event_enable; }; #endif /* EC_LENOVO_PMH7_CHIP_H */ diff --git a/src/mainboard/lenovo/haswell/variants/t440p/devicetree.cb b/src/mainboard/lenovo/haswell/variants/t440p/devicetree.cb index fb05027d10..f8467c7edc 100644 --- a/src/mainboard/lenovo/haswell/variants/t440p/devicetree.cb +++ b/src/mainboard/lenovo/haswell/variants/t440p/devicetree.cb @@ -55,8 +55,8 @@ chip northbridge/intel/haswell device pci 1d.0 on end # USB2 EHCI #1 device pci 1f.0 on # LPC bridge chip ec/lenovo/pmh7 - register "backlight_enable" = "0x01" - register "dock_event_enable" = "0x01" + register "backlight_enable" = "true" + register "dock_event_enable" = "true" device pnp ff.1 on end # dummy end chip ec/lenovo/h8 diff --git a/src/mainboard/lenovo/haswell/variants/w541/devicetree.cb b/src/mainboard/lenovo/haswell/variants/w541/devicetree.cb index 292a30df60..0d705fb9bd 100644 --- a/src/mainboard/lenovo/haswell/variants/w541/devicetree.cb +++ b/src/mainboard/lenovo/haswell/variants/w541/devicetree.cb @@ -54,8 +54,8 @@ chip northbridge/intel/haswell device pci 1d.0 on end # USB2 EHCI #1 device pci 1f.0 on # LPC bridge chip ec/lenovo/pmh7 - register "backlight_enable" = "0x01" - register "dock_event_enable" = "0x01" + register "backlight_enable" = "true" + register "dock_event_enable" = "true" device pnp ff.1 on end # dummy end chip ec/lenovo/h8 # FIXME: has_power_management_beeps, has_uwb diff --git a/src/mainboard/lenovo/l520/devicetree.cb b/src/mainboard/lenovo/l520/devicetree.cb index a012741800..dd431dfda4 100644 --- a/src/mainboard/lenovo/l520/devicetree.cb +++ b/src/mainboard/lenovo/l520/devicetree.cb @@ -54,8 +54,8 @@ chip northbridge/intel/sandybridge device ref pci_bridge off end # PCI bridge device ref lpc on # LPC bridge PCI-LPC bridge chip ec/lenovo/pmh7 - register "backlight_enable" = "0x01" - register "dock_event_enable" = "0x01" + register "backlight_enable" = "true" + register "dock_event_enable" = "true" device pnp ff.1 on end # dummy end chip ec/lenovo/h8 diff --git a/src/mainboard/lenovo/t400/devicetree.cb b/src/mainboard/lenovo/t400/devicetree.cb index 1df350ab67..259c3e1b21 100644 --- a/src/mainboard/lenovo/t400/devicetree.cb +++ b/src/mainboard/lenovo/t400/devicetree.cb @@ -120,8 +120,8 @@ chip northbridge/intel/gm45 chip ec/lenovo/pmh7 device pnp ff.1 on end # dummy - register "backlight_enable" = "0x01" - register "dock_event_enable" = "0x01" + register "backlight_enable" = "true" + register "dock_event_enable" = "true" end chip ec/lenovo/h8 diff --git a/src/mainboard/lenovo/t410/devicetree.cb b/src/mainboard/lenovo/t410/devicetree.cb index 200cabbb92..8d4ab5f633 100644 --- a/src/mainboard/lenovo/t410/devicetree.cb +++ b/src/mainboard/lenovo/t410/devicetree.cb @@ -99,8 +99,8 @@ chip northbridge/intel/ironlake end chip ec/lenovo/pmh7 device pnp ff.1 on end # dummy - register "backlight_enable" = "0x01" - register "dock_event_enable" = "0x01" + register "backlight_enable" = "true" + register "dock_event_enable" = "true" end chip ec/lenovo/h8 device pnp ff.2 on # dummy diff --git a/src/mainboard/lenovo/t420/devicetree.cb b/src/mainboard/lenovo/t420/devicetree.cb index 33070ebb74..953044a5d2 100644 --- a/src/mainboard/lenovo/t420/devicetree.cb +++ b/src/mainboard/lenovo/t420/devicetree.cb @@ -77,8 +77,8 @@ chip northbridge/intel/sandybridge device ref lpc on chip ec/lenovo/pmh7 device pnp ff.1 on end # dummy - register "backlight_enable" = "0x01" - register "dock_event_enable" = "0x01" + register "backlight_enable" = "true" + register "dock_event_enable" = "true" end chip drivers/pc80/tpm diff --git a/src/mainboard/lenovo/t420s/devicetree.cb b/src/mainboard/lenovo/t420s/devicetree.cb index b5576b2bf0..fc3b12c1dd 100644 --- a/src/mainboard/lenovo/t420s/devicetree.cb +++ b/src/mainboard/lenovo/t420s/devicetree.cb @@ -75,8 +75,8 @@ chip northbridge/intel/sandybridge device ref lpc on chip ec/lenovo/pmh7 device pnp ff.1 on end # dummy - register "backlight_enable" = "0x01" - register "dock_event_enable" = "0x01" + register "backlight_enable" = "true" + register "dock_event_enable" = "true" end chip drivers/pc80/tpm diff --git a/src/mainboard/lenovo/t430/devicetree.cb b/src/mainboard/lenovo/t430/devicetree.cb index 7e54383aa4..35c23b82c8 100644 --- a/src/mainboard/lenovo/t430/devicetree.cb +++ b/src/mainboard/lenovo/t430/devicetree.cb @@ -64,8 +64,8 @@ chip northbridge/intel/sandybridge device ref pci_bridge off end # PCI bridge device ref lpc on # LPC bridge PCI-LPC bridge chip ec/lenovo/pmh7 - register "backlight_enable" = "0x01" - register "dock_event_enable" = "0x01" + register "backlight_enable" = "true" + register "dock_event_enable" = "true" device pnp ff.1 on end # dummy end chip ec/lenovo/h8 diff --git a/src/mainboard/lenovo/t430s/devicetree.cb b/src/mainboard/lenovo/t430s/devicetree.cb index 175a5c84ee..23a41d6eb5 100644 --- a/src/mainboard/lenovo/t430s/devicetree.cb +++ b/src/mainboard/lenovo/t430s/devicetree.cb @@ -77,8 +77,8 @@ chip northbridge/intel/sandybridge device ref lpc on chip ec/lenovo/pmh7 device pnp ff.1 on end # dummy - register "backlight_enable" = "0x01" - register "dock_event_enable" = "0x01" + register "backlight_enable" = "true" + register "dock_event_enable" = "true" end chip drivers/pc80/tpm diff --git a/src/mainboard/lenovo/t520/devicetree.cb b/src/mainboard/lenovo/t520/devicetree.cb index 7ef12ba2ac..3cb18b4789 100644 --- a/src/mainboard/lenovo/t520/devicetree.cb +++ b/src/mainboard/lenovo/t520/devicetree.cb @@ -73,8 +73,8 @@ chip northbridge/intel/sandybridge device ref lpc on #LPC bridge chip ec/lenovo/pmh7 device pnp ff.1 on end # dummy - register "backlight_enable" = "0x01" - register "dock_event_enable" = "0x01" + register "backlight_enable" = "true" + register "dock_event_enable" = "true" end chip drivers/pc80/tpm diff --git a/src/mainboard/lenovo/t530/devicetree.cb b/src/mainboard/lenovo/t530/devicetree.cb index d47acda2e7..becc3575db 100644 --- a/src/mainboard/lenovo/t530/devicetree.cb +++ b/src/mainboard/lenovo/t530/devicetree.cb @@ -78,8 +78,8 @@ chip northbridge/intel/sandybridge device ref lpc on # PCI-LPC bridge chip ec/lenovo/pmh7 device pnp ff.1 on end # dummy - register "backlight_enable" = "0x01" - register "dock_event_enable" = "0x01" + register "backlight_enable" = "true" + register "dock_event_enable" = "true" end chip drivers/pc80/tpm diff --git a/src/mainboard/lenovo/t60/devicetree.cb b/src/mainboard/lenovo/t60/devicetree.cb index f72b2e90cd..25782e97e0 100644 --- a/src/mainboard/lenovo/t60/devicetree.cb +++ b/src/mainboard/lenovo/t60/devicetree.cb @@ -109,8 +109,8 @@ chip northbridge/intel/i945 subsystemid 0x17aa 0x2009 chip ec/lenovo/pmh7 device pnp ff.1 on end # dummy - register "backlight_enable" = "0x01" - register "dock_event_enable" = "0x01" + register "backlight_enable" = "true" + register "dock_event_enable" = "true" end chip ec/lenovo/h8 device pnp ff.2 on # dummy diff --git a/src/mainboard/lenovo/x1_carbon_gen1/devicetree.cb b/src/mainboard/lenovo/x1_carbon_gen1/devicetree.cb index 704a410251..a423246051 100644 --- a/src/mainboard/lenovo/x1_carbon_gen1/devicetree.cb +++ b/src/mainboard/lenovo/x1_carbon_gen1/devicetree.cb @@ -77,8 +77,8 @@ chip northbridge/intel/sandybridge device ref lpc on #LPC bridge chip ec/lenovo/pmh7 device pnp ff.1 on end # dummy - register "backlight_enable" = "0x01" - register "dock_event_enable" = "0x01" + register "backlight_enable" = "true" + register "dock_event_enable" = "true" end chip drivers/pc80/tpm diff --git a/src/mainboard/lenovo/x200/devicetree.cb b/src/mainboard/lenovo/x200/devicetree.cb index 6ddd0905a8..7871cfd00d 100644 --- a/src/mainboard/lenovo/x200/devicetree.cb +++ b/src/mainboard/lenovo/x200/devicetree.cb @@ -110,7 +110,7 @@ chip northbridge/intel/gm45 chip ec/lenovo/pmh7 device pnp ff.1 on end # dummy - register "backlight_enable" = "0x01" + register "backlight_enable" = "true" end chip ec/lenovo/h8 diff --git a/src/mainboard/lenovo/x200/variants/x200/overridetree.cb b/src/mainboard/lenovo/x200/variants/x200/overridetree.cb index 51beecc897..cd69e2eba4 100644 --- a/src/mainboard/lenovo/x200/variants/x200/overridetree.cb +++ b/src/mainboard/lenovo/x200/variants/x200/overridetree.cb @@ -17,7 +17,7 @@ chip northbridge/intel/gm45 device pci 1f.0 on # LPC bridge chip ec/lenovo/pmh7 device pnp ff.1 on end # dummy - register "dock_event_enable" = "0x01" + register "dock_event_enable" = "true" end chip superio/nsc/pc87382 device pnp 164e.3 on # Digitizer diff --git a/src/mainboard/lenovo/x201/devicetree.cb b/src/mainboard/lenovo/x201/devicetree.cb index fc7c470091..6c27f53d77 100644 --- a/src/mainboard/lenovo/x201/devicetree.cb +++ b/src/mainboard/lenovo/x201/devicetree.cb @@ -106,8 +106,8 @@ chip northbridge/intel/ironlake chip ec/lenovo/pmh7 device pnp ff.1 on end # dummy - register "backlight_enable" = "0x01" - register "dock_event_enable" = "0x01" + register "backlight_enable" = "true" + register "dock_event_enable" = "true" end chip ec/lenovo/h8 diff --git a/src/mainboard/lenovo/x220/devicetree.cb b/src/mainboard/lenovo/x220/devicetree.cb index eb79baaed2..7a9959931e 100644 --- a/src/mainboard/lenovo/x220/devicetree.cb +++ b/src/mainboard/lenovo/x220/devicetree.cb @@ -78,8 +78,8 @@ chip northbridge/intel/sandybridge device ref lpc on #LPC bridge chip ec/lenovo/pmh7 device pnp ff.1 on end # dummy - register "backlight_enable" = "0x01" - register "dock_event_enable" = "0x01" + register "backlight_enable" = "true" + register "dock_event_enable" = "true" end chip drivers/pc80/tpm diff --git a/src/mainboard/lenovo/x230/devicetree.cb b/src/mainboard/lenovo/x230/devicetree.cb index 490f837197..fdd5059e6a 100644 --- a/src/mainboard/lenovo/x230/devicetree.cb +++ b/src/mainboard/lenovo/x230/devicetree.cb @@ -80,8 +80,8 @@ chip northbridge/intel/sandybridge device ref lpc on #LPC bridge chip ec/lenovo/pmh7 device pnp ff.1 on end # dummy - register "backlight_enable" = "0x01" - register "dock_event_enable" = "0x01" + register "backlight_enable" = "true" + register "dock_event_enable" = "true" end chip drivers/pc80/tpm diff --git a/src/mainboard/lenovo/x60/devicetree.cb b/src/mainboard/lenovo/x60/devicetree.cb index f63acf7325..0e1e5fced5 100644 --- a/src/mainboard/lenovo/x60/devicetree.cb +++ b/src/mainboard/lenovo/x60/devicetree.cb @@ -97,8 +97,8 @@ chip northbridge/intel/i945 subsystemid 0x17aa 0x2009 chip ec/lenovo/pmh7 device pnp ff.1 on end # dummy - register "backlight_enable" = "0x01" - register "dock_event_enable" = "0x01" + register "backlight_enable" = "true" + register "dock_event_enable" = "true" end chip ec/lenovo/h8 device pnp ff.2 on # dummy diff --git a/util/autoport/ec_lenovo.go b/util/autoport/ec_lenovo.go index 9a02ac3cbd..a34960ff68 100644 --- a/util/autoport/ec_lenovo.go +++ b/util/autoport/ec_lenovo.go @@ -155,8 +155,8 @@ void mainboard_smi_sleep(u8 slp_typ) pmh := DevTreeNode{ Chip: "ec/lenovo/pmh7", Registers: map[string]string{ - "backlight_enable": "0x01", - "dock_event_enable": "0x01", + "backlight_enable": "true", + "dock_event_enable": "true", }, Children: []DevTreeNode{ DevTreeNode{