drm/i915/bios: interpret the i2c element
authorJani Nikula <jani.nikula@intel.com>
Mon, 21 Dec 2015 13:11:00 +0000 (15:11 +0200)
committerJani Nikula <jani.nikula@intel.com>
Mon, 11 Jan 2016 17:08:10 +0000 (19:08 +0200)
Add parsing of the i2c element, defined in MIPI sequence block v2. Drop
the status operation byte while at it, that does not exist.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/d8a2998977feee2f5b5ad609aaca787adfb41479.1450702954.git.jani.nikula@intel.com
drivers/gpu/drm/i915/intel_bios.c
drivers/gpu/drm/i915/intel_bios.h

index 71c739e33101a9f088e1d9d3aac2e76782213f30..69040a73c09a4a3770aaabbc331fa58092f1e152 100644 (file)
@@ -812,6 +812,11 @@ static int goto_next_sequence(const u8 *data, int index, int total)
                case MIPI_SEQ_ELEM_GPIO:
                        len = 2;
                        break;
+               case MIPI_SEQ_ELEM_I2C:
+                       if (index + 7 > total)
+                               return 0;
+                       len = *(data + index + 6) + 7;
+                       break;
                default:
                        DRM_ERROR("Unknown operation byte\n");
                        return 0;
index 4e87df16e7b3c1bc5fd4935dc42e2cad24b0c621..411b33794536bf9951aa8198c790b58797a03022 100644 (file)
@@ -968,7 +968,7 @@ enum mipi_seq_element {
        MIPI_SEQ_ELEM_SEND_PKT,
        MIPI_SEQ_ELEM_DELAY,
        MIPI_SEQ_ELEM_GPIO,
-       MIPI_SEQ_ELEM_STATUS,
+       MIPI_SEQ_ELEM_I2C,              /* sequence block v2+ */
        MIPI_SEQ_ELEM_MAX
 };