Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7145662ybi; Thu, 13 Jun 2019 10:19:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGfAvuN0kGHg/SpVLwvICig8eujpzvdwmFrFIy3PUZ6usf5kdHDEkVKHpzru3xpCtr5f9h X-Received: by 2002:a63:e603:: with SMTP id g3mr32465648pgh.167.1560446346882; Thu, 13 Jun 2019 10:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560446346; cv=none; d=google.com; s=arc-20160816; b=LBqxUAotxgi185iVv9liVpMRYrrasN7qm7kUa6VuQDbraY0kbp8Qs4xF1pVRb0JYRr pQQcv5qb98DuuprercWDr2WLqdQ9DwD5ChC5Llavod45dL78OvrUPW27EzgdM60c8qQ3 maXfy71Vi6I5vZKuSWS7h7Fg/wKrkMxY3SoAZrQM1fLOTrCJbkpArHRKarfJ5Z0pbdeM 1d8mCFj+WE7g2UG/DK4J7/DlfCNc65/46ZvC7MBVv3aTvnFxyIiHNvBi++FKIr7xjHyH ys8PWEIx9J6gSz9TFDIsoIbMa90GY2U2Hq1Lca7yIXxtTKnAaPi15/hU39K+8OL01Hb3 bNkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=yAT51bTEDtazhRskQUrS1svo/w6Zi/vh6DxLEVOro4o=; b=K7jhhmEI2Ke03yqjAU2rL0ik4e/Yn62WkdIiP30/nfZLGhupPm87F7LBvqHHhEeYB7 PFicW8VJGnkR77HtqZ8qpEGVElPX/mCoAVvnodhq8HOx12o1IEd7lWwe4i1aZDqOUP1w 0OLJRnu0pAkXJ9X7fg87pIIw1sY8w6fSV/EOUxSjar+iKAI8+b+nWOqdza6DvkjoHBYY 8Q3cRtNCzWyA4hpDs3DtxLGsdfCwK2eSq8DkF6LBkdbGpKPbG79s0etmRDOZyYuBqyBT Vm1iYVC3GrsngsMDidGDIBfHYZkK7o2xi2F9fLN0hCVWt4U2bMQKdHvrbnQU6ZXrHooT zU6Q== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s13si262201pgs.446.2019.06.13.10.18.50; Thu, 13 Jun 2019 10:19:06 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393427AbfFMRRb (ORCPT + 99 others); Thu, 13 Jun 2019 13:17:31 -0400 Received: from asavdk3.altibox.net ([109.247.116.14]:38811 "EHLO asavdk3.altibox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728432AbfFLVVA (ORCPT ); Wed, 12 Jun 2019 17:21:00 -0400 Received: from ravnborg.org (unknown [158.248.194.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by asavdk3.altibox.net (Postfix) with ESMTPS id 0A53D20021; Wed, 12 Jun 2019 23:20:56 +0200 (CEST) Date: Wed, 12 Jun 2019 23:20:54 +0200 From: Sam Ravnborg To: Derek Basehore Cc: linux-kernel@vger.kernel.org, Thierry Reding , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , Maarten Lankhorst , Maxime Ripard , Sean Paul , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , CK Hu , Philipp Zabel , Matthias Brugger , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH 1/5] drm/panel: Add helper for reading DT rotation Message-ID: <20190612212054.GB13155@ravnborg.org> References: <20190611040350.90064-1-dbasehore@chromium.org> <20190611040350.90064-2-dbasehore@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190611040350.90064-2-dbasehore@chromium.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=dqr19Wo4 c=1 sm=1 tr=0 a=UWs3HLbX/2nnQ3s7vZ42gw==:117 a=UWs3HLbX/2nnQ3s7vZ42gw==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=cm27Pg_UAAAA:8 a=PWvNCjwUpEQzod5d7NgA:9 a=CjuIK1q_8ugA:10 a=xmb-EsYY8bH0VWELuYED:22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Derek. On Mon, Jun 10, 2019 at 09:03:46PM -0700, Derek Basehore wrote: > This adds a helper function for reading the rotation (panel > orientation) from the device tree. > > Signed-off-by: Derek Basehore > --- > drivers/gpu/drm/drm_panel.c | 41 +++++++++++++++++++++++++++++++++++++ > include/drm/drm_panel.h | 7 +++++++ > 2 files changed, 48 insertions(+) > > diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c > index dbd5b873e8f2..3b689ce4a51a 100644 > --- a/drivers/gpu/drm/drm_panel.c > +++ b/drivers/gpu/drm/drm_panel.c > @@ -172,6 +172,47 @@ struct drm_panel *of_drm_find_panel(const struct device_node *np) > return ERR_PTR(-EPROBE_DEFER); > } > EXPORT_SYMBOL(of_drm_find_panel); > + > +/** > + * of_drm_get_panel_orientation - look up the rotation of the panel using a > + * device tree node > + * @np: device tree node of the panel > + * @orientation: orientation enum to be filled in > + * > + * Looks up the rotation of a panel in the device tree. The rotation in the > + * device tree is counter clockwise. > + * > + * Return: 0 when a valid rotation value (0, 90, 180, or 270) is read or the > + * rotation property doesn't exist. -EERROR otherwise. > + */ > +int of_drm_get_panel_orientation(const struct device_node *np, int *orientation) > +{ > + int rotation, ret; > + > + ret = of_property_read_u32(np, "rotation", &rotation); I just noticed that everywhere this code talks about orientation, but the property that it reads are rotation. To my best understanding these are not the same. Sam