gfx dp_aux: Add I2C_{Read,Write}_Byte procedures

These will be used to switch LSPCON modes in subsequent commits.

Change-Id: Ib66b073691282d0c89710b0591484d4123e039b7
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/51122
Reviewed-by: Nico Huber <nico.h@gmx.de>
diff --git a/common/hw-gfx-dp_aux_ch.adb b/common/hw-gfx-dp_aux_ch.adb
index b8eb510..8bc0c58 100644
--- a/common/hw-gfx-dp_aux_ch.adb
+++ b/common/hw-gfx-dp_aux_ch.adb
@@ -371,6 +371,41 @@
 
    ----------------------------------------------------------------------------
 
+   procedure I2C_Write_Byte
+     (Port     : in     T;
+      Address  : in     I2C.Transfer_Address;
+      Offset   : in     Word8;
+      Value    : in     Word8;
+      Success  :    out Boolean)
+   is
+      Payload : constant DP_Defs.Aux_Payload := (Offset, Value, others => 16#00#);
+
+      Length : constant I2C.Transfer_Length  := 1;
+   begin
+      Do_I2C_Write (Port, Address, 1 + Length, Payload, Success);
+   end I2C_Write_Byte;
+
+   procedure I2C_Read_Byte
+     (Port     : in     T;
+      Address  : in     I2C.Transfer_Address;
+      Offset   : in     Word8;
+      Value    :    out Word8;
+      Success  :    out Boolean)
+   is
+      Index_Payload : constant DP_Defs.Aux_Payload := (Offset, others => 16#00#);
+
+      Length : I2C.Transfer_Length  := 1;
+      Data   : I2C.Transfer_Data    := (others => 16#00#);
+   begin
+      Do_I2C_Write (Port, Address, 1, Index_Payload, Success);
+
+      if Success then
+         Do_I2C_Read (Port, Address, Length, Data, Success);
+         Success := Success and Length = 1;
+      end if;
+      Value := Data (0);
+   end I2C_Read_Byte;
+
    procedure I2C_Read
      (Port     : in     T;
       Address  : in     I2C.Transfer_Address;