Received: by 10.213.65.68 with SMTP id h4csp541449imn; Fri, 30 Mar 2018 10:20:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+XQy4H+NvqBCTTymppJs47/u76spivx0Wi8xpk1Z5R7g0LT7cdITkrUsypvxgK+OFKl+rY X-Received: by 10.98.237.5 with SMTP id u5mr7488709pfh.236.1522430413929; Fri, 30 Mar 2018 10:20:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522430413; cv=none; d=google.com; s=arc-20160816; b=Vxom/mMp2WcanlSNXkl8I2HP894sXPfVz3+K1ZiRPNSwWvPyVrx1f8UT5ZCpbAbe0x j3PZNylbhBBQ7Qi/RvqysyrW2jVWFfSx8MmETUa3N9fAPlQQqC7t3y9Aaz+Uuy6Vhb44 7V4WSEAtAoh//fRYddfqO4y0/N/mr9x//hQ0TD/XXUYWLd59Ros09iP3QMFQuHlqXTUf dNkgTe5hiFIX51nLKPqyMgppbbgkfAo0RgDjezkDgAGw/XfS1kFBRXE1mGaX8QtUzkHF S8vh7aSKT1CUhjIicHx3PC0hpwpBBKWS8RHk0idQjr6h2sBiuAojNRtXuvkE3MoXG804 W5mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=XSPgCaetVu1GPAt4fVlMM124qhC4+tuxx7JaAQauCts=; b=ZUX85G5fr9hwOmu2KIZpW/soKtkfeHvXWBK6mxRgbT3MaoK26mj6SUfgcefwad9voo TTHCkE7O+HsgVzixpg5lhulVtugpQXwx2emXscfwqzCyEPPGRr7NhW8mRGUpF6Vot97h z4PfraWaxW7WVpC4CbPrPC5+IoOFIeT5kXhUaHOsU2FpI3V+gpl7g7Td1NDdRs6PHb0P kICKzpcd3WUoRCMjCNYH9per+MJwGQlkz73a29anSCkzTsuOPL3tOlxX4aok1rDBi7Gj rZYt1IbIqiE2gOfO80UDk96ZvCFcPyAqYpaCbuyIBWvB8+AZ1z26nt4GFXXrmB2D1jlO wcFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a18si3766511pff.107.2018.03.30.10.19.59; Fri, 30 Mar 2018 10:20:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752538AbeC3RSt (ORCPT + 99 others); Fri, 30 Mar 2018 13:18:49 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:58804 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752414AbeC3RSq (ORCPT ); Fri, 30 Mar 2018 13:18:46 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 123782601D5 From: Sebastian Reichel To: Sebastian Reichel , Tomi Valkeinen , Tony Lindgren , Pavel Machek Cc: Laurent Pinchart , Rob Herring , Mark Rutland , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com, Sebastian Reichel Subject: [PATCHv3 7/8] drm/omap: panel-dsi-cm: add rotation support Date: Fri, 30 Mar 2018 19:18:21 +0200 Message-Id: <20180330171822.25896-8-sebastian.reichel@collabora.co.uk> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180330171822.25896-1-sebastian.reichel@collabora.co.uk> References: <20180330171822.25896-1-sebastian.reichel@collabora.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sebastian Reichel Add support to inform the DRM subsystem about the orientation the display has been mounted to the casing. Signed-off-by: Sebastian Reichel --- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 428de90fced1..21a828f88d30 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -68,6 +68,7 @@ struct panel_drv_data { int width_mm; int height_mm; + int rotation; struct omap_dsi_pin_config pin_config; @@ -1210,6 +1211,14 @@ static void dsicm_get_size(struct omap_dss_device *dssdev, *height = ddata->height_mm; } +static void dsicm_get_rotation(struct omap_dss_device *dssdev, + int *rotation) +{ + struct panel_drv_data *ddata = to_panel_data(dssdev); + + *rotation = ddata->rotation; +} + static struct omap_dss_driver dsicm_ops = { .connect = dsicm_connect, .disconnect = dsicm_disconnect, @@ -1223,6 +1232,7 @@ static struct omap_dss_driver dsicm_ops = { .get_timings = dsicm_get_timings, .check_timings = dsicm_check_timings, .get_size = dsicm_get_size, + .get_rotation = dsicm_get_rotation, .enable_te = dsicm_enable_te, .get_te = dsicm_get_te, @@ -1270,6 +1280,9 @@ static int dsicm_probe_of(struct platform_device *pdev) ddata->height_mm = 0; of_property_read_u32(node, "height-mm", &ddata->height_mm); + ddata->rotation = -1; + of_property_read_u32(node, "rotation", &ddata->rotation); + ddata->vpnl = devm_regulator_get_optional(&pdev->dev, "vpnl"); if (IS_ERR(ddata->vpnl)) { err = PTR_ERR(ddata->vpnl); -- 2.16.2