soc/amd/common/psp/psp_def.h: increase P2C_BUFFER_MAXSIZE
[coreboot2.git] / src / mainboard / google / corsola / panel.c
blobe77cb979899bcf8469def511634eadabd88ef95e
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <boardid.h>
4 #include <cbfs.h>
5 #include <device/i2c_simple.h>
6 #include <gpio.h>
7 #include <soc/ddp.h>
8 #include <soc/dsi.h>
9 #include <soc/gpio_common.h>
10 #include <soc/mtcmos.h>
12 #include "gpio.h"
13 #include "panel.h"
15 void aw37503_init(unsigned int bus)
17 i2c_write_field(bus, PMIC_AW37503_SLAVE, 0x00, 0x14, 0x1F, 0);
18 i2c_write_field(bus, PMIC_AW37503_SLAVE, 0x01, 0x14, 0x1F, 0);
19 i2c_write_field(bus, PMIC_AW37503_SLAVE, 0x21, 0x4C, 0xFF, 0);
20 i2c_write_field(bus, PMIC_AW37503_SLAVE, 0x03, 0x43, 0xFF, 0);
21 i2c_write_field(bus, PMIC_AW37503_SLAVE, 0x21, 0x00, 0xFF, 0);
24 bool is_pmic_aw37503(unsigned int bus)
26 u8 vendor_id;
27 return (!i2c_read_field(bus, PMIC_AW37503_SLAVE,
28 0x04, &vendor_id, 0x0F, 0) && vendor_id == 0x01);
31 void backlight_control(void)
33 /* Set up backlight control pins as output pin and power-off by default */
34 gpio_output(GPIO_AP_EDP_BKLTEN, 0);
35 gpio_output(GPIO_BL_PWM_1V8, 0);
38 struct panel_description *get_active_panel(void)
40 /* Board-specific exceptions */
41 if (CONFIG(BOARD_GOOGLE_STEELIX) && board_id() < 2) /* Early builds use PS8640 */
42 return get_ps8640_description();
44 if (CONFIG(DRIVER_ANALOGIX_ANX7625))
45 return get_anx7625_description();
47 if (CONFIG(DRIVER_PARADE_PS8640))
48 return get_ps8640_description();
50 /* MIPI panels */
51 return get_panel_description();