Rex-BC Chen | d05f231 | 2021-12-17 14:39:30 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #ifndef __MAINBOARD_GOOGLE_CORSOLA_DISPLAY_H__ |
| 4 | #define __MAINBOARD_GOOGLE_CORSOLA_DISPLAY_H__ |
| 5 | |
Rex-BC Chen | 291ba82 | 2021-12-17 15:10:45 +0800 | [diff] [blame] | 6 | #include <edid.h> |
Ruihai Zhou | d5c1e13 | 2023-03-28 16:49:01 +0800 | [diff] [blame^] | 7 | #include <mipi/panel.h> |
| 8 | #include <soc/i2c.h> |
Rex-BC Chen | 291ba82 | 2021-12-17 15:10:45 +0800 | [diff] [blame] | 9 | |
Ruihai Zhou | d5c1e13 | 2023-03-28 16:49:01 +0800 | [diff] [blame^] | 10 | #define BRIDGE_I2C I2C0 |
| 11 | #define PMIC_TPS65132_I2C I2C6 |
| 12 | #define PMIC_TPS65132_SLAVE 0x3E |
| 13 | |
| 14 | struct panel_description { |
| 15 | void (*power_on)(void); /* Callback to turn on panel */ |
Rex-BC Chen | 291ba82 | 2021-12-17 15:10:45 +0800 | [diff] [blame] | 16 | int (*post_power_on)(u8 i2c_bus, struct edid *edid); |
Ruihai Zhou | d5c1e13 | 2023-03-28 16:49:01 +0800 | [diff] [blame^] | 17 | const char *name; /* Panel name in CBFS */ |
| 18 | struct panel_serializable_data *s; |
| 19 | enum lb_fb_orientation orientation; |
Rex-BC Chen | 291ba82 | 2021-12-17 15:10:45 +0800 | [diff] [blame] | 20 | }; |
| 21 | |
Rex-BC Chen | d05f231 | 2021-12-17 14:39:30 +0800 | [diff] [blame] | 22 | int configure_display(void); |
Ruihai Zhou | d0b13a4 | 2023-03-30 17:54:12 +0800 | [diff] [blame] | 23 | uint32_t panel_id(void); |
Rex-BC Chen | d05f231 | 2021-12-17 14:39:30 +0800 | [diff] [blame] | 24 | |
Ruihai Zhou | d5c1e13 | 2023-03-28 16:49:01 +0800 | [diff] [blame^] | 25 | /* Return the mipi panel description from given panel id */ |
| 26 | struct panel_description *get_panel_description(void); |
| 27 | |
| 28 | /* Return the ANX7625 bridge description */ |
| 29 | struct panel_description *get_anx7625_description(void); |
| 30 | |
| 31 | /* Return the PS8640 bridge description */ |
| 32 | struct panel_description *get_ps8640_description(void); |
| 33 | |
| 34 | /* Load panel serializable data from CBFS */ |
| 35 | struct panel_description *get_panel_from_cbfs(struct panel_description *desc); |
| 36 | |
| 37 | void tps65132s_program_eeprom(void); |
| 38 | int panel_pmic_reg_mask(u32 bus, u8 chip, u8 addr, u8 val, u8 mask); |
| 39 | |
Rex-BC Chen | d05f231 | 2021-12-17 14:39:30 +0800 | [diff] [blame] | 40 | #endif |