starlabs/starlite_adl: hide touchscreen CFR when accel off
The touchscreen device is dependent on the accelerometer on starlite_adl, so offer the touchscreen CFR option only when the accelerometer option is enabled. Implement a new weak cfr_touchscreen_update() callback in the starlabs common CFR code and override it in starlite_adl to suppress the touchscreen option when accelerometer is disabled Change-Id: I4bab6ccb92c40190014ab55200ff214064d5d2ae Signed-off-by: Sean Rhodes <sean@starlabs.systems> Reviewed-on: https://review.coreboot.org/c/coreboot/+/91024 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
This commit is contained in:
parent
9263722f41
commit
781a8a98f1
3 changed files with 14 additions and 1 deletions
|
|
@ -9,6 +9,11 @@ void __weak cfr_card_reader_update(struct sm_object *new_obj)
|
|||
(void)new_obj;
|
||||
}
|
||||
|
||||
void __weak cfr_touchscreen_update(struct sm_object *new_obj)
|
||||
{
|
||||
(void)new_obj;
|
||||
}
|
||||
|
||||
static const struct cfr_default_override starlabs_cfr_overrides[] = {
|
||||
CFR_OVERRIDE_ENUM("pciexp_aspm", ASPM_L0S_L1),
|
||||
CFR_OVERRIDE_END
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#include <common/powercap.h>
|
||||
|
||||
void cfr_card_reader_update(struct sm_object *new_obj);
|
||||
void cfr_touchscreen_update(struct sm_object *new_obj);
|
||||
void starlabs_cfr_register_overrides(void);
|
||||
|
||||
static const struct sm_object accelerometer = SM_DECLARE_BOOL({
|
||||
|
|
@ -131,7 +132,7 @@ static const struct sm_object touchscreen = SM_DECLARE_BOOL({
|
|||
.ui_name = "Touchscreen",
|
||||
.ui_helptext = "Enable or disable the built-in touch-screen",
|
||||
.default_value = true,
|
||||
});
|
||||
}, WITH_CALLBACK(cfr_touchscreen_update));
|
||||
|
||||
static const struct sm_object vpu = SM_DECLARE_BOOL({
|
||||
.opt_name = "vpu",
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include <intelblocks/cfr.h>
|
||||
#include <device/i2c_bus.h>
|
||||
#include <device/i2c_simple.h>
|
||||
#include <option.h>
|
||||
#include <static.h>
|
||||
#include <variants.h>
|
||||
#include <common/cfr.h>
|
||||
|
|
@ -19,6 +20,12 @@ void cfr_card_reader_update(struct sm_object *new_obj)
|
|||
new_obj->sm_bool.flags = CFR_OPTFLAG_SUPPRESS;
|
||||
}
|
||||
|
||||
void cfr_touchscreen_update(struct sm_object *new_obj)
|
||||
{
|
||||
if (get_uint_option("accelerometer", 1) == 0)
|
||||
new_obj->sm_bool.flags = CFR_OPTFLAG_SUPPRESS;
|
||||
}
|
||||
|
||||
static struct sm_obj_form performance_group = {
|
||||
.ui_name = "Performance",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue