summaryrefslogtreecommitdiff
path: root/src/mainboard/siemens
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/mainboard/siemens
parentb6730e03e203c320a11306e902d52e3fcad43fef (diff)
downloadcoreboot-79312afdde1df0f64f8e1349cee8fd1566a90415.tar.gz
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/mainboard/siemens')
-rw-r--r--src/mainboard/siemens/mc_apl1/variants/mc_apl1/lcd_panel.c12
-rw-r--r--src/mainboard/siemens/mc_apl1/variants/mc_apl4/lcd_panel.c12
-rw-r--r--src/mainboard/siemens/mc_apl1/variants/mc_apl5/lcd_panel.c12
-rw-r--r--src/mainboard/siemens/mc_apl1/variants/mc_apl7/lcd_panel.c12
-rw-r--r--src/mainboard/siemens/mc_ehl/variants/mc_ehl3/lcd_panel.c12
5 files changed, 30 insertions, 30 deletions
diff --git a/src/mainboard/siemens/mc_apl1/variants/mc_apl1/lcd_panel.c b/src/mainboard/siemens/mc_apl1/variants/mc_apl1/lcd_panel.c
index b6e3c27c75..0fce19c80b 100644
--- a/src/mainboard/siemens/mc_apl1/variants/mc_apl1/lcd_panel.c
+++ b/src/mainboard/siemens/mc_apl1/variants/mc_apl1/lcd_panel.c
@@ -39,9 +39,9 @@ uint8_t mb_select_edid_table(void)
/** \brief Function to enable mainboard to adjust the config data of PTN3460. For reference,
* see NXP document AN11128 - PTN3460 Programming guide.
* @param *cfg_ptr Pointer to the PTN config structure to modify
- * @return -1 on error; PTN_CFG_MODIFIED if data was modified and needs to be updated.
+ * @return CB_SUCCESS if data was modified and needs to be updated; CB_ERR on error
*/
-int mb_adjust_cfg(struct ptn_3460_config *cfg)
+enum cb_err mb_adjust_cfg(struct ptn_3460_config *cfg)
{
const char *hwi_block = "hwinfo.hex";
uint8_t disp_con = 0, color_depth = 0;
@@ -49,16 +49,16 @@ int mb_adjust_cfg(struct ptn_3460_config *cfg)
/* Get display-specific configuration from hwinfo. */
if (hwilib_find_blocks(hwi_block) != CB_SUCCESS) {
printk(BIOS_ERR, "LCD: Info block \"%s\" not found!\n", hwi_block);
- return -1;
+ return CB_ERR;
}
if (hwilib_get_field(PF_DisplCon, &disp_con, sizeof(disp_con)) != sizeof(disp_con)) {
printk(BIOS_ERR, "LCD: Missing panel features from %s\n", hwi_block);
- return -1;
+ return CB_ERR;
}
if (hwilib_get_field(PF_Color_Depth, &color_depth,
sizeof(color_depth)) != sizeof(color_depth)) {
printk(BIOS_ERR, "LCD: Missing panel features from %s\n", hwi_block);
- return -1;
+ return CB_ERR;
}
/* Set up PTN3460 registers based on hwinfo and fixed board-specific parameters: */
@@ -91,5 +91,5 @@ int mb_adjust_cfg(struct ptn_3460_config *cfg)
/* Enable backlight control. */
cfg->backlight_ctrl = 0x00;
- return PTN_CFG_MODIFIED;
+ return CB_SUCCESS;
}
diff --git a/src/mainboard/siemens/mc_apl1/variants/mc_apl4/lcd_panel.c b/src/mainboard/siemens/mc_apl1/variants/mc_apl4/lcd_panel.c
index 9fd2566456..d5de17dd52 100644
--- a/src/mainboard/siemens/mc_apl1/variants/mc_apl4/lcd_panel.c
+++ b/src/mainboard/siemens/mc_apl1/variants/mc_apl4/lcd_panel.c
@@ -39,9 +39,9 @@ uint8_t mb_select_edid_table(void)
/** \brief Function to enable mainboard to adjust the config data of PTN3460. For reference,
* see NXP document AN11128 - PTN3460 Programming guide.
* @param *cfg_ptr Pointer to the PTN config structure to modify
- * @return -1 on error; PTN_CFG_MODIFIED if data was modified and needs to be updated.
+ * @return CB_SUCCESS if data was modified and needs to be updated; CB_ERR on error
*/
-int mb_adjust_cfg(struct ptn_3460_config *cfg)
+enum cb_err mb_adjust_cfg(struct ptn_3460_config *cfg)
{
const char *hwi_block = "hwinfo.hex";
uint8_t disp_con = 0, color_depth = 0;
@@ -49,16 +49,16 @@ int mb_adjust_cfg(struct ptn_3460_config *cfg)
/* Get display-specific configuration from hwinfo. */
if (hwilib_find_blocks(hwi_block) != CB_SUCCESS) {
printk(BIOS_ERR, "LCD: Info block \"%s\" not found!\n", hwi_block);
- return -1;
+ return CB_ERR;
}
if (hwilib_get_field(PF_DisplCon, &disp_con, sizeof(disp_con)) != sizeof(disp_con)) {
printk(BIOS_ERR, "LCD: Missing panel features from %s\n", hwi_block);
- return -1;
+ return CB_ERR;
}
if (hwilib_get_field(PF_Color_Depth, &color_depth,
sizeof(color_depth)) != sizeof(color_depth)) {
printk(BIOS_ERR, "LCD: Missing panel features from %s\n", hwi_block);
- return -1;
+ return CB_ERR;
}
/* Set up PTN3460 registers based on hwinfo and fixed board-specific parameters: */
@@ -91,5 +91,5 @@ int mb_adjust_cfg(struct ptn_3460_config *cfg)
/* Enable backlight control. */
cfg->backlight_ctrl = 0x00;
- return PTN_CFG_MODIFIED;
+ return CB_SUCCESS;
}
diff --git a/src/mainboard/siemens/mc_apl1/variants/mc_apl5/lcd_panel.c b/src/mainboard/siemens/mc_apl1/variants/mc_apl5/lcd_panel.c
index c984f2fed4..348f7622ae 100644
--- a/src/mainboard/siemens/mc_apl1/variants/mc_apl5/lcd_panel.c
+++ b/src/mainboard/siemens/mc_apl1/variants/mc_apl5/lcd_panel.c
@@ -64,9 +64,9 @@ uint8_t mb_select_edid_table(void)
/** \brief Function to enable mainboard to adjust the config data of PTN3460. For reference,
* see NXP document AN11128 - PTN3460 Programming guide.
* @param *cfg_ptr Pointer to the PTN config structure to modify
- * @return -1 on error; PTN_CFG_MODIFIED if data was modified and needs to be updated.
+ * @return CB_SUCCESS if data was modified and needs to be updated; CB_ERR on error
*/
-int mb_adjust_cfg(struct ptn_3460_config *cfg)
+enum cb_err mb_adjust_cfg(struct ptn_3460_config *cfg)
{
const char *hwi_block = "hwinfo.hex";
uint8_t disp_con = 0, color_depth = 0;
@@ -74,16 +74,16 @@ int mb_adjust_cfg(struct ptn_3460_config *cfg)
/* Get display-specific configuration from hwinfo. */
if (hwilib_find_blocks(hwi_block) != CB_SUCCESS) {
printk(BIOS_ERR, "LCD: Info block \"%s\" not found!\n", hwi_block);
- return -1;
+ return CB_ERR;
}
if (hwilib_get_field(PF_DisplCon, &disp_con, sizeof(disp_con)) != sizeof(disp_con)) {
printk(BIOS_ERR, "LCD: Missing panel features from %s\n", hwi_block);
- return -1;
+ return CB_ERR;
}
if (hwilib_get_field(PF_Color_Depth, &color_depth,
sizeof(color_depth)) != sizeof(color_depth)) {
printk(BIOS_ERR, "LCD: Missing panel features from %s\n", hwi_block);
- return -1;
+ return CB_ERR;
}
/* Set up PTN3460 registers based on hwinfo and fixed board-specific parameters: */
@@ -116,5 +116,5 @@ int mb_adjust_cfg(struct ptn_3460_config *cfg)
/* Enable backlight control. */
cfg->backlight_ctrl = 0x00;
- return PTN_CFG_MODIFIED;
+ return CB_SUCCESS;
}
diff --git a/src/mainboard/siemens/mc_apl1/variants/mc_apl7/lcd_panel.c b/src/mainboard/siemens/mc_apl1/variants/mc_apl7/lcd_panel.c
index 9fd2566456..d5de17dd52 100644
--- a/src/mainboard/siemens/mc_apl1/variants/mc_apl7/lcd_panel.c
+++ b/src/mainboard/siemens/mc_apl1/variants/mc_apl7/lcd_panel.c
@@ -39,9 +39,9 @@ uint8_t mb_select_edid_table(void)
/** \brief Function to enable mainboard to adjust the config data of PTN3460. For reference,
* see NXP document AN11128 - PTN3460 Programming guide.
* @param *cfg_ptr Pointer to the PTN config structure to modify
- * @return -1 on error; PTN_CFG_MODIFIED if data was modified and needs to be updated.
+ * @return CB_SUCCESS if data was modified and needs to be updated; CB_ERR on error
*/
-int mb_adjust_cfg(struct ptn_3460_config *cfg)
+enum cb_err mb_adjust_cfg(struct ptn_3460_config *cfg)
{
const char *hwi_block = "hwinfo.hex";
uint8_t disp_con = 0, color_depth = 0;
@@ -49,16 +49,16 @@ int mb_adjust_cfg(struct ptn_3460_config *cfg)
/* Get display-specific configuration from hwinfo. */
if (hwilib_find_blocks(hwi_block) != CB_SUCCESS) {
printk(BIOS_ERR, "LCD: Info block \"%s\" not found!\n", hwi_block);
- return -1;
+ return CB_ERR;
}
if (hwilib_get_field(PF_DisplCon, &disp_con, sizeof(disp_con)) != sizeof(disp_con)) {
printk(BIOS_ERR, "LCD: Missing panel features from %s\n", hwi_block);
- return -1;
+ return CB_ERR;
}
if (hwilib_get_field(PF_Color_Depth, &color_depth,
sizeof(color_depth)) != sizeof(color_depth)) {
printk(BIOS_ERR, "LCD: Missing panel features from %s\n", hwi_block);
- return -1;
+ return CB_ERR;
}
/* Set up PTN3460 registers based on hwinfo and fixed board-specific parameters: */
@@ -91,5 +91,5 @@ int mb_adjust_cfg(struct ptn_3460_config *cfg)
/* Enable backlight control. */
cfg->backlight_ctrl = 0x00;
- return PTN_CFG_MODIFIED;
+ return CB_SUCCESS;
}
diff --git a/src/mainboard/siemens/mc_ehl/variants/mc_ehl3/lcd_panel.c b/src/mainboard/siemens/mc_ehl/variants/mc_ehl3/lcd_panel.c
index b1c4e0100c..7b162540aa 100644
--- a/src/mainboard/siemens/mc_ehl/variants/mc_ehl3/lcd_panel.c
+++ b/src/mainboard/siemens/mc_ehl/variants/mc_ehl3/lcd_panel.c
@@ -39,9 +39,9 @@ uint8_t mb_select_edid_table(void)
/** \brief Function to enable mainboard to adjust the config data of PTN3460. For reference,
* see NXP document AN11128 - PTN3460 Programming guide.
* @param *cfg_ptr Pointer to the PTN config structure to modify
- * @return -1 on error; PTN_CFG_MODIFIED if data was modified and needs to be updated.
+ * @return CB_SUCCESS if data was modified and needs to be updated; CB_ERR on error
*/
-int mb_adjust_cfg(struct ptn_3460_config *cfg)
+enum cb_err mb_adjust_cfg(struct ptn_3460_config *cfg)
{
const char *hwi_block = "hwinfo.hex";
uint8_t disp_con = 0, color_depth = 0;
@@ -49,16 +49,16 @@ int mb_adjust_cfg(struct ptn_3460_config *cfg)
/* Get display-specific configuration from hwinfo. */
if (hwilib_find_blocks(hwi_block) != CB_SUCCESS) {
printk(BIOS_ERR, "LCD: Info block \"%s\" not found!\n", hwi_block);
- return -1;
+ return CB_ERR;
}
if (hwilib_get_field(PF_DisplCon, &disp_con, sizeof(disp_con)) != sizeof(disp_con)) {
printk(BIOS_ERR, "LCD: Missing panel features from %s\n", hwi_block);
- return -1;
+ return CB_ERR;
}
if (hwilib_get_field(PF_Color_Depth, &color_depth,
sizeof(color_depth)) != sizeof(color_depth)) {
printk(BIOS_ERR, "LCD: Missing panel features from %s\n", hwi_block);
- return -1;
+ return CB_ERR;
}
/* Set up PTN3460 registers based on hwinfo and fixed board-specific parameters: */
@@ -91,5 +91,5 @@ int mb_adjust_cfg(struct ptn_3460_config *cfg)
/* Enable backlight control. */
cfg->backlight_ctrl = 0x00;
- return PTN_CFG_MODIFIED;
+ return CB_SUCCESS;
}