From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752875AbcDOII7 (ORCPT ); Fri, 15 Apr 2016 04:08:59 -0400 Received: from mail-oi0-f45.google.com ([209.85.218.45]:33515 "EHLO mail-oi0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752348AbcDOIIy (ORCPT ); Fri, 15 Apr 2016 04:08:54 -0400 MIME-Version: 1.0 In-Reply-To: <1460473007-11535-8-git-send-email-ldewangan@nvidia.com> References: <1460473007-11535-1-git-send-email-ldewangan@nvidia.com> <1460473007-11535-8-git-send-email-ldewangan@nvidia.com> Date: Fri, 15 Apr 2016 10:08:53 +0200 Message-ID: Subject: Re: [PATCH 7/7] pinctrl: tegra: Add driver to configure voltage and power state of io pads From: Linus Walleij To: Laxman Dewangan Cc: Stephen Warren , Thierry Reding , Alexandre Courbot , Rob Herring , Mark Rutland , Jon Hunter , "linux-tegra@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-gpio@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 12, 2016 at 4:56 PM, Laxman Dewangan wrote: > NVIDIA Tegra210 supports the IO pads which can operate at 1.8V > or 3.3V I/O voltage levels. Also the IO pads can be configured > for power down state if it is not used. SW needs to configure the > voltage level of IO pads based on IO rail voltage and its power > state based on platform usage. > > The voltage and power state configurations of pads are provided > through pin control frameworks. Add pin control driver for Tegra's > IO pads' voltage and power state configurations. > > Signed-off-by: Laxman Dewangan (...) > +config PINCTRL_TEGRA210_IO_PAD Why does this need its own Kconfig option? Can't you just unconditionally compile it in if PINCTRL_TEGRA210 is selected, you seem to say it is there on all these platforms anyway. > +static const struct pinconf_generic_params tegra_io_pads_cfg_params[] = { > + { > + .property = "nvidia,io-rail-voltage", > + .param = TEGRA_IO_RAIL_VOLTAGE, > + }, { What's so nvidia-specific about this? We have power-source in Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt which takes a custom argument. This is obviously what you are doing (selecting one of two rails), so use that binding. > + .property = "nvidia,io-pad-deep-power-down", > + .param = TEGRA_IO_PAD_DEEP_POWER_DOWN, > + }, Likewise the generic bindings have low-power-enable and low-power-disable, this seems like a copy of low-power-enable; Even if it needs a new binding, it doesn't seem very nVidia-specific so then propose something to the generic bindings. Even if Tegra is not using the generic code for handling the standard bindings (GENERIC_PINCONF) it doesn't stop you from using the generic bindings and contributing to them. Historically you have a few custom bindings like these: nvidia,pins nvidia,function nvidia,pull nvidia,tristate etc etc, but that is just unfortunate and due to preceding the generic bindings. I would appreciate if you started to support the generic bindings in parallel, but I'm not gonna push that issue. However for *new* stuff, I don't want the custom bindings to proliferate. Use the generic stuff, I'm trying to keep the weirdness in one place, and the generic stuff is needed for standardization across platforms going forward. Yours, Linus Walleij