Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935310AbcJZWOR (ORCPT ); Wed, 26 Oct 2016 18:14:17 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:36477 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935220AbcJZWNs (ORCPT ); Wed, 26 Oct 2016 18:13:48 -0400 Date: Wed, 26 Oct 2016 17:13:46 -0500 From: Rob Herring To: Chen-Yu Tsai Cc: Maxime Ripard , David Airlie , Mark Rutland , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-sunxi@googlegroups.com Subject: Re: [PATCH v2 1/8] drm/bridge: rgb-to-vga: Support an enable GPIO Message-ID: <20161026221346.tdpmbrwca4jehch2@rob-hp-laptop> References: <20161020034344.14154-1-wens@csie.org> <20161020034344.14154-2-wens@csie.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161020034344.14154-2-wens@csie.org> User-Agent: Mutt/1.6.2-neo (2016-08-21) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1587 Lines: 45 On Thu, Oct 20, 2016 at 11:43:37AM +0800, Chen-Yu Tsai wrote: > Some rgb-to-vga bridges have an enable GPIO, either directly tied to > an enable pin on the bridge IC, or indirectly controlling a power > switch. > > Add support for it. > > Signed-off-by: Chen-Yu Tsai > --- > .../bindings/display/bridge/dumb-vga-dac.txt | 2 ++ > drivers/gpu/drm/bridge/dumb-vga-dac.c | 28 ++++++++++++++++++++++ > 2 files changed, 30 insertions(+) > > diff --git a/Documentation/devicetree/bindings/display/bridge/dumb-vga-dac.txt b/Documentation/devicetree/bindings/display/bridge/dumb-vga-dac.txt > index 003bc246a270..d3484822bf77 100644 > --- a/Documentation/devicetree/bindings/display/bridge/dumb-vga-dac.txt > +++ b/Documentation/devicetree/bindings/display/bridge/dumb-vga-dac.txt > @@ -16,6 +16,8 @@ graph bindings specified in Documentation/devicetree/bindings/graph.txt. > - Video port 0 for RGB input > - Video port 1 for VGA output > > +Optional properties: > +- enable-gpios: GPIO pin to enable or disable the bridge This should also define the active state. > +static void dumb_vga_enable(struct drm_bridge *bridge) > +{ > + struct dumb_vga *vga = drm_bridge_to_dumb_vga(bridge); > + > + if (vga->enable_gpio) > + gpiod_set_value_cansleep(vga->enable_gpio, 1); So the driver should allow either active high or low. > +} > + > +static void dumb_vga_disable(struct drm_bridge *bridge) > +{ > + struct dumb_vga *vga = drm_bridge_to_dumb_vga(bridge); > + > + if (vga->enable_gpio) > + gpiod_set_value_cansleep(vga->enable_gpio, 0); > +} > +