mutex_unlock(&dsi->lock);
 }
 
-static int dsi_enable_te(struct omap_dss_device *dssdev, bool enable)
+static int dsi_enable_te(struct dsi_data *dsi, bool enable)
 {
-       struct dsi_data *dsi = to_dsi_data(dssdev);
-
        dsi->te_enabled = enable;
 
        if (dsi->te_gpio) {
 {
        struct dsi_data *dsi = host_to_omap(host);
        struct omap_dss_device *dssdev = &dsi->output;
+       int r;
 
        if (!!(msg->flags & MIPI_DSI_MSG_USE_LPM) != dsi->in_lp_mode)
                dsi_vc_enable_hs(dssdev, msg->channel,
        case MIPI_DSI_DCS_LONG_WRITE:
        case MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE:
        case MIPI_DSI_NULL_PACKET:
-               return dsi_vc_write_common(dssdev, msg);
+               r = dsi_vc_write_common(dssdev, msg);
+               break;
        case MIPI_DSI_GENERIC_READ_REQUEST_0_PARAM:
        case MIPI_DSI_GENERIC_READ_REQUEST_1_PARAM:
        case MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM:
-               return dsi_vc_generic_read(dssdev, msg);
+               r = dsi_vc_generic_read(dssdev, msg);
+               break;
        case MIPI_DSI_DCS_READ:
-               return dsi_vc_dcs_read(dssdev, msg);
+               r = dsi_vc_dcs_read(dssdev, msg);
+               break;
+       default:
+               r = -EINVAL;
+               break;
        }
 
-       return -EINVAL;
+       if (r < 0)
+               return r;
+
+       if (msg->type == MIPI_DSI_DCS_SHORT_WRITE ||
+           msg->type == MIPI_DSI_DCS_SHORT_WRITE_PARAM) {
+               u8 cmd = ((u8 *)msg->tx_buf)[0];
+
+               if (cmd == MIPI_DCS_SET_TEAR_OFF)
+                       dsi_enable_te(dsi, false);
+               else if (cmd == MIPI_DCS_SET_TEAR_ON)
+                       dsi_enable_te(dsi, true);
+       }
+
+       return 0;
 }
 
 static int dsi_get_clocks(struct dsi_data *dsi)
                .disable_video_output = dsi_disable_video_output,
 
                .update = dsi_update,
-
-               .enable_te = dsi_enable_te,
        },
 };
 
 
        int (*set_config)(struct omap_dss_device *dssdev,
                        const struct omap_dss_dsi_config *cfg);
 
-       int (*enable_te)(struct omap_dss_device *dssdev, bool enable);
-
        int (*update)(struct omap_dss_device *dssdev, int channel,
                        void (*callback)(int, void *), void *data);