From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756497AbbE2O5G (ORCPT ); Fri, 29 May 2015 10:57:06 -0400 Received: from ns.mm-sol.com ([37.157.136.199]:49267 "EHLO extserv.mm-sol.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756398AbbE2O4y (ORCPT ); Fri, 29 May 2015 10:56:54 -0400 Message-ID: <1432911410.6844.9.camel@mm-sol.com> Subject: Re: [PATCH] drm/msm/hdmi: Use pinctrl in HDMI driver From: "Ivan T. Ivanov" To: Stephane Viau Cc: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, robdclark@gmail.com Date: Fri, 29 May 2015 17:56:50 +0300 In-Reply-To: <1432907385-19772-1-git-send-email-sviau@codeaurora.org> References: <1432907385-19772-1-git-send-email-sviau@codeaurora.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.13.7-fta1.2~trusty Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Stephane, On Fri, 2015-05-29 at 09:49 -0400, Stephane Viau wrote: > Some targets (eg: msm8994) use the pinctrl framework to configure > interface pins. This change adds support for initialization and > pinctrl active/sleep state control for the HDMI driver. > > Signed-off-by: Stephane Viau > --- > drivers/gpu/drm/msm/hdmi/hdmi.c | 25 +++++++++++++++++++++++++ > drivers/gpu/drm/msm/hdmi/hdmi.h | 5 +++++ > drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 31 +++++++++++++++++++++++++++++++ > 3 files changed, 61 insertions(+) > No devicetree binding documentation? > static int hdmi_bind(struct device *dev, struct device *master, void *data) > @@ -365,6 +379,7 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data) > #ifdef CONFIG_OF > struct device_node *of_node = dev->of_node; > const struct of_device_id *match; > + struct pinctrl *pinctrl; > > match = of_match_node(dt_match, of_node); > if (match && match->data) { > @@ -383,6 +398,16 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data) > hdmi_cfg->mux_sel_gpio = get_gpio(dev, of_node, "qcom,hdmi-tx-mux-sel"); > hdmi_cfg->mux_lpm_gpio = get_gpio(dev, of_node, "qcom,hdmi-tx-mux-lpm"); > > + /* not all targets have pinctrl, do not fail in case of error: */ > + pinctrl = devm_pinctrl_get(dev); > + if (IS_ERR_OR_NULL(pinctrl)) { > + dev_warn(dev, "cannot get pinctrl: %s\n", of_node->name); > + } else { > + hdmi_cfg->active = get_pinctrl_state(dev, pinctrl, "hdmi_active"); > + hdmi_cfg->sleep = get_pinctrl_state(dev, pinctrl, "hdmi_sleep"); How this differs from PINCTRL_STATE_DEFAULT and PINCTRL_STATE_SLEEP? Regards, Ivan