blob: afff4bf30fbdcb924e61ca71493e2fd7638acd0d [file] [log] [blame]
Rex-BC Chend05f2312021-12-17 14:39:30 +08001/* 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 Chen291ba822021-12-17 15:10:45 +08006#include <edid.h>
Ruihai Zhoud5c1e132023-03-28 16:49:01 +08007#include <mipi/panel.h>
8#include <soc/i2c.h>
Rex-BC Chen291ba822021-12-17 15:10:45 +08009
Ruihai Zhoud5c1e132023-03-28 16:49:01 +080010#define BRIDGE_I2C I2C0
11#define PMIC_TPS65132_I2C I2C6
12#define PMIC_TPS65132_SLAVE 0x3E
13
14struct panel_description {
15 void (*power_on)(void); /* Callback to turn on panel */
Rex-BC Chen291ba822021-12-17 15:10:45 +080016 int (*post_power_on)(u8 i2c_bus, struct edid *edid);
Ruihai Zhoud5c1e132023-03-28 16:49:01 +080017 const char *name; /* Panel name in CBFS */
18 struct panel_serializable_data *s;
19 enum lb_fb_orientation orientation;
Rex-BC Chen291ba822021-12-17 15:10:45 +080020};
21
Rex-BC Chend05f2312021-12-17 14:39:30 +080022int configure_display(void);
Ruihai Zhoud0b13a42023-03-30 17:54:12 +080023uint32_t panel_id(void);
Rex-BC Chend05f2312021-12-17 14:39:30 +080024
Ruihai Zhoud5c1e132023-03-28 16:49:01 +080025/* Return the mipi panel description from given panel id */
26struct panel_description *get_panel_description(void);
27
28/* Return the ANX7625 bridge description */
29struct panel_description *get_anx7625_description(void);
30
31/* Return the PS8640 bridge description */
32struct panel_description *get_ps8640_description(void);
33
34/* Load panel serializable data from CBFS */
35struct panel_description *get_panel_from_cbfs(struct panel_description *desc);
36
37void tps65132s_program_eeprom(void);
38int panel_pmic_reg_mask(u32 bus, u8 chip, u8 addr, u8 val, u8 mask);
39
Rex-BC Chend05f2312021-12-17 14:39:30 +080040#endif