Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752813AbdFTWRD (ORCPT ); Tue, 20 Jun 2017 18:17:03 -0400 Received: from mga11.intel.com ([192.55.52.93]:11390 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752698AbdFTWRB (ORCPT ); Tue, 20 Jun 2017 18:17:01 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,366,1493708400"; d="scan'208";a="1162781549" From: "Mani, Rajmohan" To: Linus Walleij CC: "linux-kernel@vger.kernel.org" , "linux-gpio@vger.kernel.org" , "ACPI Devel Maling List" , Lee Jones , Alexandre Courbot , "Rafael J. Wysocki" , Len Brown , Andy Shevchenko Subject: RE: [PATCH v3 2/3] gpio: Add support for TPS68470 GPIOs Thread-Topic: [PATCH v3 2/3] gpio: Add support for TPS68470 GPIOs Thread-Index: AQHS418QSr4APT1AXEyLHGQDvPQhoKIt89IAgABpW+A= Date: Tue, 20 Jun 2017 22:16:59 +0000 Message-ID: <6F87890CF0F5204F892DEA1EF0D77A59725C3299@FMSMSX114.amr.corp.intel.com> References: <1497259612-38401-1-git-send-email-rajmohan.mani@intel.com> <1497259612-38401-3-git-send-email-rajmohan.mani@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.1.200.106] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v5KMH8rL020939 Content-Length: 2044 Lines: 70 Hi Linus, Thanks for your comments. > On Mon, Jun 12, 2017 at 11:26 AM, Rajmohan Mani > wrote: > > > This patch adds support for TPS68470 GPIOs. > > There are 7 GPIOs and a few sensor related GPIOs. > > These GPIOs can be requested and configured as appropriate. > > > > Signed-off-by: Rajmohan Mani > > This is some fine code. > Reviewed-by: Linus Walleij > > Feel free to merge this through MFD or tell me if I should merge it if there are > no compile-time dependencies. I still have the following 3 outstanding comments from Andy (that includes one from Lee) on this patch series. Main points (some I already told in an answer to Sakari's mail): 1. Consider 2 GPIO chips over 1.(Andy on GPIO driver) I will look into this week and get back on the issue that I find with using 2 GPIO chips. 2. Fix FIXME(s) (Andy and Lee on MFD driver) I will work on this once I am done with 1. + /* FIXME: configure these dynamically */ + /* Enable Daisy Chain LDO and configure relevant GPIOs as output */ + ret = regmap_write(regmap, TPS68470_REG_S_I2C_CTL, 2); + if (ret < 0) + return ret; + + ret = regmap_write(regmap, TPS68470_REG_GPCTL4A, 2); + if (ret < 0) + return ret; + + ret = regmap_write(regmap, TPS68470_REG_GPCTL5A, 2); + if (ret < 0) + return ret; + + ret = regmap_write(regmap, TPS68470_REG_GPCTL6A, 2); + if (ret < 0) + return ret; + + /* + * When SDA and SCL are routed to GPIO1 and GPIO2, the mode + * for these GPIOs must be configured using their respective + * GPCTLxA registers as inputs with no pull-ups. + */ + ret = regmap_write(regmap, TPS68470_REG_GPCTL1A, 0); + if (ret < 0) + return ret; + + ret = regmap_write(regmap, TPS68470_REG_GPCTL2A, 0); + if (ret < 0) + return ret; + + /* Enable daisy chain */ + ret = regmap_update_bits(regmap, TPS68470_REG_S_I2C_CTL, 1, 1); + if (ret < 0) + return ret; 3. Move from tps68470.h to tps68470.c (Andy on MFD driver) This is done, but waiting on 1 and 2 Thanks Raj