From patchwork Fri Mar 30 17:18:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 10318153 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 78E0860383 for ; Fri, 30 Mar 2018 17:19:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65B8D29053 for ; Fri, 30 Mar 2018 17:19:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A0682A5B8; Fri, 30 Mar 2018 17:19:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C17A029053 for ; Fri, 30 Mar 2018 17:19:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752487AbeC3RSs (ORCPT ); Fri, 30 Mar 2018 13:18:48 -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-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);