summaryrefslogtreecommitdiff
path: root/src/mainboard/google/geralt/panel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google/geralt/panel.c')
-rw-r--r--src/mainboard/google/geralt/panel.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mainboard/google/geralt/panel.c b/src/mainboard/google/geralt/panel.c
index 3174870050..78d4f84bbd 100644
--- a/src/mainboard/google/geralt/panel.c
+++ b/src/mainboard/google/geralt/panel.c
@@ -3,6 +3,7 @@
#include <boardid.h>
#include <cbfs.h>
#include <console/console.h>
+#include <device/i2c_simple.h>
#include <edid.h>
#include <gpio.h>
#include <soc/gpio_common.h>
@@ -11,6 +12,21 @@
#include "gpio.h"
#include "panel.h"
+int panel_pmic_reg_mask(u32 bus, u8 chip, u8 addr, u8 val, u8 mask)
+{
+ u8 msg = 0;
+
+ if (i2c_read_field(bus, chip, addr, &msg, 0xFF, 0) < 0) {
+ printk(BIOS_ERR, "Failed to read i2c: addr(%u)\n", addr);
+ return -1;
+ }
+
+ msg &= ~mask;
+ msg |= val;
+
+ return i2c_write_field(bus, chip, addr, msg, 0xFF, 0);
+}
+
static void get_mipi_cmd_from_cbfs(struct panel_description *desc)
{
/*