mainboard/starlabs/adl: move CFR callbacks to variant
Move the i5 variant-specific CFR callbacks out of the baseboard CFR menu and compile them from the variant directory. This reduces preprocessor usage in the common file. Change-Id: Ic03ec18aed100a95d347c49c2b1deecf1c3fd961 Signed-off-by: Sean Rhodes <sean@starlabs.systems> Reviewed-on: https://review.coreboot.org/c/coreboot/+/91458 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
This commit is contained in:
parent
7f02993393
commit
14fcb3baf8
3 changed files with 22 additions and 23 deletions
|
|
@ -7,4 +7,5 @@ subdirs-y += variants/$(VARIANT_DIR)
|
|||
bootblock-y += bootblock.c
|
||||
|
||||
ramstage-$(CONFIG_DRIVERS_OPTION_CFR) += cfr.c
|
||||
ramstage-$(CONFIG_DRIVERS_OPTION_CFR) += $(wildcard variants/$(VARIANT_DIR)/cfr.c)
|
||||
ramstage-y += mainboard.c
|
||||
|
|
|
|||
|
|
@ -5,31 +5,8 @@
|
|||
#include <drivers/option/cfr_frontend.h>
|
||||
#include <ec/starlabs/merlin/cfr.h>
|
||||
#include <intelblocks/cfr.h>
|
||||
#if CONFIG(BOARD_STARLABS_LITE_ADL)
|
||||
#include <device/i2c_bus.h>
|
||||
#include <device/i2c_simple.h>
|
||||
#include <option.h>
|
||||
#include <static.h>
|
||||
#include <variants.h>
|
||||
#endif
|
||||
#include <common/cfr.h>
|
||||
|
||||
#if CONFIG(BOARD_STARLABS_LITE_ADL)
|
||||
void cfr_card_reader_update(struct sm_object *new_obj)
|
||||
{
|
||||
struct device *mxc_accel = DEV_PTR(mxc6655);
|
||||
|
||||
if (!i2c_dev_detect(i2c_busdev(mxc_accel), mxc_accel->path.i2c.device))
|
||||
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;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CONFIG(SYSTEM_TYPE_LAPTOP) || CONFIG(SYSTEM_TYPE_DETACHABLE)
|
||||
static struct sm_obj_form audio_video_group = {
|
||||
.ui_name = "Audio/Video",
|
||||
|
|
|
|||
21
src/mainboard/starlabs/adl/variants/i5/cfr.c
Normal file
21
src/mainboard/starlabs/adl/variants/i5/cfr.c
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <device/i2c_bus.h>
|
||||
#include <device/i2c_simple.h>
|
||||
#include <drivers/option/cfr_frontend.h>
|
||||
#include <option.h>
|
||||
#include <static.h>
|
||||
|
||||
void cfr_card_reader_update(struct sm_object *new_obj)
|
||||
{
|
||||
struct device *mxc_accel = DEV_PTR(mxc6655);
|
||||
|
||||
if (!i2c_dev_detect(i2c_busdev(mxc_accel), mxc_accel->path.i2c.device))
|
||||
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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue