From patchwork Tue Sep 22 22:23:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 54008 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id 0A15E22D91 for ; Tue, 22 Sep 2015 22:23:54 +0000 (UTC) Received: by wicgb1 with SMTP id gb1sf14914599wic.3 for ; Tue, 22 Sep 2015 15:23:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=cbHthd17WqEuMllnFqbdPiDDdsDdF2+tAWZSFBt/nhU=; b=CEeUEQQDUyOW9BP+J0k6zF7mOQn30kSin8JNL0FxxM+nzmWmTJFFv8DvsX8BAUaOsO ZFU8+KNgaCetwBKYiqoc40he5+QWcUMzrJJmyLYn5ClDBDZhO8i2XT1G1n/C15Ao3BIp +V79/j9r9SzBAofdEq0HifD8cpT/UfqoVIrN/6Adxa7aTR+TrrmcSoiLjBjEDxnrhylW AXOIKt6DZl2r/POv8oz9sKzmWNPna0X5k0BOkrF/dIWolxi3E4XjifItyix36QVQSyVR Gl1bLxWWkCF77YMeV8dHaIkVB5yC+LMXwlRa76Ri+1VPWrbV+e6cqTZfreMj+OkX6CCL MxYA== X-Gm-Message-State: ALoCoQnEqKvdwavPm8fpxt8DWpPFzAt/jW2qux6y08Ba0gTLfWqRxsfghpXZud65lKOnOjnQ70LO X-Received: by 10.112.151.9 with SMTP id um9mr4688862lbb.19.1442960633295; Tue, 22 Sep 2015 15:23:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.38.206 with SMTP id m197ls82114lfm.55.gmail; Tue, 22 Sep 2015 15:23:52 -0700 (PDT) X-Received: by 10.25.150.83 with SMTP id y80mr3168814lfd.119.1442960632901; Tue, 22 Sep 2015 15:23:52 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id jf12si2292116lac.98.2015.09.22.15.23.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Sep 2015 15:23:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lahg1 with SMTP id g1so30465157lah.1 for ; Tue, 22 Sep 2015 15:23:52 -0700 (PDT) X-Received: by 10.25.207.82 with SMTP id f79mr3233175lfg.73.1442960632428; Tue, 22 Sep 2015 15:23:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp744529lbq; Tue, 22 Sep 2015 15:23:51 -0700 (PDT) X-Received: by 10.67.8.106 with SMTP id dj10mr33977952pad.123.1442960631287; Tue, 22 Sep 2015 15:23:51 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xc2si5614458pbc.187.2015.09.22.15.23.51; Tue, 22 Sep 2015 15:23:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934948AbbIVWXu (ORCPT + 2 others); Tue, 22 Sep 2015 18:23:50 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:34228 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759620AbbIVWXt (ORCPT ); Tue, 22 Sep 2015 18:23:49 -0400 Received: by padhy16 with SMTP id hy16so21127549pad.1 for ; Tue, 22 Sep 2015 15:23:48 -0700 (PDT) X-Received: by 10.68.176.227 with SMTP id cl3mr33800928pbc.8.1442960628533; Tue, 22 Sep 2015 15:23:48 -0700 (PDT) Received: from x1 ([70.35.39.2]) by smtp.gmail.com with ESMTPSA id la4sm4106269pbc.76.2015.09.22.15.23.44 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 22 Sep 2015 15:23:47 -0700 (PDT) Date: Tue, 22 Sep 2015 23:23:40 +0100 From: Lee Jones To: Andy Shevchenko Cc: linux-acpi@vger.kernel.org, linux-i2c@vger.kernel.org, linux-gpio@vger.kernel.org, Wolfram Sang , Linus Walleij , "Rafael J. Wysocki" , Mika Westerberg , "Puustinen, Ismo" , "Pandruvada, Srinivas" , linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 3/8] mfd: intel_quark_i2c_gpio: load gpio driver first Message-ID: <20150922222340.GC9317@x1> References: <1442916619-140607-1-git-send-email-andriy.shevchenko@linux.intel.com> <1442916619-140607-4-git-send-email-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1442916619-140607-4-git-send-email-andriy.shevchenko@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-gpio-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-gpio@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On Tue, 22 Sep 2015, Andy Shevchenko wrote: > On Intel Galileo boards the GPIO expander is connected to i2c bus. Moreover it > is able to generate interrupt, but interrupt line is connected to GPIO. That's > why we have to have GPIO driver in place when we will probe i2c host with > device connected to it. > > Signed-off-by: Andy Shevchenko > --- > drivers/mfd/intel_quark_i2c_gpio.c | 48 +++++++++++++++++++++----------------- > 1 file changed, 27 insertions(+), 21 deletions(-) ? > diff --git a/drivers/mfd/intel_quark_i2c_gpio.c b/drivers/mfd/intel_quark_i2c_gpio.c > index 1ce1603..89bd4bf 100644 > --- a/drivers/mfd/intel_quark_i2c_gpio.c > +++ b/drivers/mfd/intel_quark_i2c_gpio.c > @@ -82,27 +82,26 @@ static struct resource intel_quark_i2c_res[] = { > }, > }; > > +static struct mfd_cell intel_quark_mfd_i2c_cell = { > + .id = MFD_I2C_BAR, > + .name = "i2c_designware", > + .num_resources = ARRAY_SIZE(intel_quark_i2c_res), > + .resources = intel_quark_i2c_res, > + .ignore_resource_conflicts = true, > +}; > + > static struct resource intel_quark_gpio_res[] = { > [INTEL_QUARK_IORES_MEM] = { > .flags = IORESOURCE_MEM, > }, > }; > > -static struct mfd_cell intel_quark_mfd_cells[] = { > - { > - .id = MFD_I2C_BAR, > - .name = "i2c_designware", > - .num_resources = ARRAY_SIZE(intel_quark_i2c_res), > - .resources = intel_quark_i2c_res, > - .ignore_resource_conflicts = true, > - }, > - { > - .id = MFD_GPIO_BAR, > - .name = "gpio-dwapb", > - .num_resources = ARRAY_SIZE(intel_quark_gpio_res), > - .resources = intel_quark_gpio_res, > - .ignore_resource_conflicts = true, > - }, > +static struct mfd_cell intel_quark_mfd_gpio_cell = { > + .id = MFD_GPIO_BAR, > + .name = "gpio-dwapb", > + .num_resources = ARRAY_SIZE(intel_quark_gpio_res), > + .resources = intel_quark_gpio_res, > + .ignore_resource_conflicts = true, > }; > > static const struct pci_device_id intel_quark_mfd_ids[] = { > @@ -248,18 +247,25 @@ static int intel_quark_mfd_probe(struct pci_dev *pdev, > > dev_set_drvdata(&pdev->dev, quark_mfd); > > - ret = intel_quark_i2c_setup(pdev, &intel_quark_mfd_cells[MFD_I2C_BAR]); > + ret = intel_quark_i2c_setup(pdev, &intel_quark_mfd_i2c_cell); > if (ret) > return ret; > > - ret = intel_quark_gpio_setup(pdev, > - &intel_quark_mfd_cells[MFD_GPIO_BAR]); > + ret = intel_quark_gpio_setup(pdev, &intel_quark_mfd_gpio_cell); > if (ret) > return ret; > > - return mfd_add_devices(&pdev->dev, 0, intel_quark_mfd_cells, > - ARRAY_SIZE(intel_quark_mfd_cells), NULL, 0, > - NULL); > + ret = mfd_add_devices(&pdev->dev, 0, &intel_quark_mfd_gpio_cell, 1, > + NULL, 0, NULL); > + if (ret) > + return ret; > + > + ret = mfd_add_devices(&pdev->dev, 0, &intel_quark_mfd_i2c_cell, 1, > + NULL, 0, NULL); > + if (ret) > + mfd_remove_devices(&pdev->dev); > + > + return ret; > } > > static void intel_quark_mfd_remove(struct pci_dev *pdev) --- a/drivers/mfd/intel_quark_i2c_gpio.c +++ b/drivers/mfd/intel_quark_i2c_gpio.c @@ -28,8 +28,8 @@ #include /* PCI BAR for register base address */ -#define MFD_I2C_BAR 0 -#define MFD_GPIO_BAR 1 +#define MFD_GPIO_BAR 0 +#define MFD_I2C_BAR 1 /* The base GPIO number under GPIOLIB framework */ #define INTEL_QUARK_MFD_GPIO_BASE 8