summaryrefslogtreecommitdiff
path: root/src/drivers/i2c
diff options
context:
space:
mode:
authorJan Samek <jan.samek@siemens.com>2023-01-18 13:28:50 +0100
committerFelix Held <felix-coreboot@felixheld.de>2023-01-27 14:56:54 +0000
commit79312afdde1df0f64f8e1349cee8fd1566a90415 (patch)
tree190fe26e6fa1609ec80592bd356c7f87d2f0539f /src/drivers/i2c
parentb6730e03e203c320a11306e902d52e3fcad43fef (diff)
drivers/i2c/ptn3460: Use cb_err in mb_adjust_cfg
Return generic coreboot error codes from the mb_adjust_cfg callback used in mainboards instead of '-1' constant and a driver-specific success-indicating define. BUG=none TEST=Boards siemens/mc_apl{1,4,5,7} and siemens/mc_ehl3 build correctly. Change-Id: I5e0d4e67703db518ed239a845f43047f569b94ec Signed-off-by: Jan Samek <jan.samek@siemens.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/72071 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Diffstat (limited to 'src/drivers/i2c')
-rw-r--r--src/drivers/i2c/ptn3460/ptn3460.c6
-rw-r--r--src/drivers/i2c/ptn3460/ptn3460.h3
2 files changed, 4 insertions, 5 deletions
diff --git a/src/drivers/i2c/ptn3460/ptn3460.c b/src/drivers/i2c/ptn3460/ptn3460.c
index 3ea41ba22c..31db8ad7fe 100644
--- a/src/drivers/i2c/ptn3460/ptn3460.c
+++ b/src/drivers/i2c/ptn3460/ptn3460.c
@@ -108,7 +108,7 @@ static void ptn3460_init(struct device *dev)
}
/* Mainboard can modify the configuration data.
Write back configuration data to PTN3460 if modified by mainboard */
- if (mb_adjust_cfg(&cfg) == PTN_CFG_MODIFIED) {
+ if (mb_adjust_cfg(&cfg) == CB_SUCCESS) {
ptr = (uint8_t *)&cfg;
for (i = 0; i < sizeof(struct ptn_3460_config); i++) {
val = i2c_dev_writeb_at(dev, PTN_CONFIG_OFF + i, *ptr++);
@@ -131,9 +131,9 @@ __weak uint8_t mb_select_edid_table(void)
{
return 0;
}
-__weak int mb_adjust_cfg(struct ptn_3460_config *cfg_ptr)
+__weak enum cb_err mb_adjust_cfg(struct ptn_3460_config *cfg_ptr)
{
- return 0;
+ return CB_ERR;
}
static struct device_operations ptn3460_ops = {
diff --git a/src/drivers/i2c/ptn3460/ptn3460.h b/src/drivers/i2c/ptn3460/ptn3460.h
index 718f92fea7..5d867cdd46 100644
--- a/src/drivers/i2c/ptn3460/ptn3460.h
+++ b/src/drivers/i2c/ptn3460/ptn3460.h
@@ -16,7 +16,6 @@
/* Define some error codes that can be used */
#define PTN_SUCCESS 0x00000000
-#define PTN_CFG_MODIFIED 0x00000001
#define PTN_BUS_ERROR 0x10000000
#define PTN_INVALID_EDID 0x20000000
#define PTN_INVALID_EDID_BLOCK 0x30000000
@@ -55,6 +54,6 @@ struct ptn_3460_flash {
/* These functions can be implemented somewhere else but must exist. */
extern enum cb_err mb_get_edid(uint8_t edid_data[0x80]);
extern uint8_t mb_select_edid_table(void);
-extern int mb_adjust_cfg(struct ptn_3460_config *cfg_ptr);
+extern enum cb_err mb_adjust_cfg(struct ptn_3460_config *cfg_ptr);
#endif /* _I2C_PTN3460_H_ */