From patchwork Thu Sep 24 17:29:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 54121 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 D125622DC2 for ; Thu, 24 Sep 2015 17:30:07 +0000 (UTC) Received: by wicgb1 with SMTP id gb1sf44787945wic.3 for ; Thu, 24 Sep 2015 10:30:07 -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=iURF9AGbnMJSetVR4rbeu0FPIXj4TI4dCb7hLtAi0tI=; b=MVE2uS/1EAG3SEnJgxiFpMTcjI5LlYpR4sMItOos7XW6AyiWcfSXEwC9eYW4MNmrmY EwrUZIwHD426LHquoAAAELqZfvgX2Y+Y8GTN3JCM6AihB3N+Ss0FSIssiWsq6oLQ6rpQ x6zT7gjyyo8sCJljXW6BbC7t4b+jlaat6uOYG0yfCo3m1Oy1QNVEC12QV841lWrEKC35 X68kcXIO/y7xAgbDdu4uu3j7BmHA8ctQYVF+oYGRwvhXgieu6RhmF7QE5WS9nnTC1LWv 2Bubf4Bs+bstHmYLyY9pZWpxtHGuwlP32hVPKYM/sDfKfYVGQLDyMn5BWL/+jej2Q7Kh OcHA== X-Gm-Message-State: ALoCoQnxx7vizTTym4CBjCR1rlEApINHSm7TNjbNEQpPWvhACu0UmG889uxyx3xgdHJRTgjET759 X-Received: by 10.194.93.198 with SMTP id cw6mr148019wjb.3.1443115807157; Thu, 24 Sep 2015 10:30:07 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.170.163 with SMTP id an3ls129940lac.52.gmail; Thu, 24 Sep 2015 10:30:06 -0700 (PDT) X-Received: by 10.25.169.68 with SMTP id s65mr172815lfe.78.1443115806874; Thu, 24 Sep 2015 10:30:06 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id y5si7041581laj.5.2015.09.24.10.30.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Sep 2015 10:30:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lacao8 with SMTP id ao8so71708419lac.3 for ; Thu, 24 Sep 2015 10:30:06 -0700 (PDT) X-Received: by 10.152.21.196 with SMTP id x4mr263107lae.86.1443115806692; Thu, 24 Sep 2015 10:30:06 -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 w3csp467211lbq; Thu, 24 Sep 2015 10:30:05 -0700 (PDT) X-Received: by 10.50.143.2 with SMTP id sa2mr1169599igb.14.1443115805337; Thu, 24 Sep 2015 10:30:05 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qm7si1813027igb.1.2015.09.24.10.30.05; Thu, 24 Sep 2015 10:30:05 -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 S1756360AbbIXRaE (ORCPT + 3 others); Thu, 24 Sep 2015 13:30:04 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:33625 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755436AbbIXRaC (ORCPT ); Thu, 24 Sep 2015 13:30:02 -0400 Received: by pacex6 with SMTP id ex6so78715334pac.0 for ; Thu, 24 Sep 2015 10:30:02 -0700 (PDT) X-Received: by 10.69.26.38 with SMTP id iv6mr966339pbd.151.1443115802051; Thu, 24 Sep 2015 10:30:02 -0700 (PDT) Received: from x1 ([70.35.39.2]) by smtp.gmail.com with ESMTPSA id zc4sm14714584pbb.24.2015.09.24.10.29.57 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 24 Sep 2015 10:30:01 -0700 (PDT) Date: Thu, 24 Sep 2015 18:29:53 +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: <20150924172953.GD27197@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.50 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 @@ -90,19 +90,19 @@ static struct resource intel_quark_gpio_res[] = { 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, }, + { + .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 const struct pci_device_id intel_quark_mfd_ids[] = {