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: 7258571 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7D313BEEC1 for ; Thu, 24 Sep 2015 17:30:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8FC1020983 for ; Thu, 24 Sep 2015 17:30:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7A890208E8 for ; Thu, 24 Sep 2015 17:30:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756392AbbIXRaE (ORCPT ); Thu, 24 Sep 2015 13:30:04 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:35078 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756137AbbIXRaD (ORCPT ); Thu, 24 Sep 2015 13:30:03 -0400 Received: by pacfv12 with SMTP id fv12so80023291pac.2 for ; Thu, 24 Sep 2015 10:30:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=iSLRzvxejY8OM4N/bK5p4XDeSOwDKmqJdGugxTOYvjI=; b=YI2Z2qvrmYdY774diWsMQvxfwT91Xhks63exAP5lBDAnAS71zaF8i5Ausn9EWkE0bH n9OGvNYXF6EkxE5Mx84G7YQ8echHK1saCapeunfimfdY89JUmughwmaKIe42WkozQhSk 4ZhLDCnEbvu15kSv5ALI4QoNhHnMKSpL7NqRuUBmzGwOlWHHj4mXkd+i88HZMOz0s2w7 6rYOfAjz13jmPZGXo71xyebIzGrLiDXYn3cKwo5yz+YfoCF0MM98KC8Ck2lChiQh2+pU 8INnDZAph3PN7Oo+aCbK6WWASUdXzRrxZwN636w1UAhoVfjt6VZFsEXhw0YG3UA2dcVf GeTg== X-Gm-Message-State: ALoCoQnmIxB47q5KxF+dUTNDWsmcTgGd5ik99AfSXfZiRB7acsdbKPtvST7fvaZkmDviE3m5WFy1 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-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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[] = {