summaryrefslogtreecommitdiff
path: root/src/include/dp_aux.h
diff options
context:
space:
mode:
authorxuxinxiong <xuxinxiong@huaqin.corp-partner.google.com>2021-10-26 20:16:21 +0800
committerPatrick Georgi <pgeorgi@google.com>2021-11-02 08:17:21 +0000
commitcb3745c407f0c19bfcab06b05549ad20948efff9 (patch)
tree7894248656ee79559c49bc9cdad7b27a99d9a2ec /src/include/dp_aux.h
parent73161c644e61e7a6e18ebe0cbb04c573545d1e64 (diff)
google/trogdor: Add backlight support for Parade ps8640
Add backlight support in ps8640 through the AUX channel using eDP DPCD registers. BUG=b:202966352 BRANCH=trogdor TEST=verified firmware screen works on homestar rev4 Change-Id: Ief1bf56c89c8215427dcbddfc67e8bcd4c3607d2 Signed-off-by: xuxinxiong <xuxinxiong@huaqin.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/58624 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/include/dp_aux.h')
-rw-r--r--src/include/dp_aux.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/include/dp_aux.h b/src/include/dp_aux.h
new file mode 100644
index 0000000000..ce93383a63
--- /dev/null
+++ b/src/include/dp_aux.h
@@ -0,0 +1,48 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef _DP_AUX_H_
+#define _DP_AUX_H_
+
+#include <types.h>
+
+enum {
+ EDID_LENGTH = 128,
+ EDID_I2C_ADDR = 0x50,
+ EDID_EXTENSION_FLAG = 0x7e,
+};
+
+enum i2c_over_aux {
+ I2C_OVER_AUX_WRITE_MOT_0 = 0x0,
+ I2C_OVER_AUX_READ_MOT_0 = 0x1,
+ I2C_OVER_AUX_WRITE_STATUS_UPDATE_0 = 0x2,
+ I2C_OVER_AUX_WRITE_MOT_1 = 0x4,
+ I2C_OVER_AUX_READ_MOT_1 = 0x5,
+ I2C_OVER_AUX_WRITE_STATUS_UPDATE_1 = 0x6,
+ NATIVE_AUX_WRITE = 0x8,
+ NATIVE_AUX_READ = 0x9,
+};
+
+enum aux_request {
+ DPCD_READ,
+ DPCD_WRITE,
+ I2C_RAW_READ,
+ I2C_RAW_WRITE,
+ I2C_RAW_READ_AND_STOP,
+ I2C_RAW_WRITE_AND_STOP,
+};
+
+/* Backlight configuration */
+#define DP_BACKLIGHT_MODE_SET 0x721
+#define DP_BACKLIGHT_CONTROL_MODE_MASK 0x3
+#define DP_BACKLIGHT_CONTROL_MODE_DPCD 0x2
+#define DP_DISPLAY_CONTROL_REGISTER 0x720
+#define DP_BACKLIGHT_ENABLE 0x1
+#define DP_BACKLIGHT_BRIGHTNESS_MSB 0x722
+
+#define DP_AUX_MAX_PAYLOAD_BYTES 16
+
+
+bool dp_aux_request_is_write(enum aux_request request);
+enum i2c_over_aux dp_get_aux_cmd(enum aux_request request, uint32_t remaining_after_this);
+
+#endif