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: 7246161 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 548DB9F32B for ; Tue, 22 Sep 2015 22:23:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50DE220A04 for ; Tue, 22 Sep 2015 22:23:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 48A9E20A13 for ; Tue, 22 Sep 2015 22:23:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759629AbbIVWXt (ORCPT ); Tue, 22 Sep 2015 18:23:49 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:35974 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759478AbbIVWXt (ORCPT ); Tue, 22 Sep 2015 18:23:49 -0400 Received: by pacbt3 with SMTP id bt3so2763304pac.3 for ; Tue, 22 Sep 2015 15:23:48 -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=2+0FS/VTRlIkxNgYQXcD5edYqOYiSLSmhLw7nINQafc=; b=NOTv8xtEOzkLF/syIsGGKODv/kMckWcAmqU2TR4DH48GtnmFxHo0jLaRn1AAewtokd 67VHm74EydIJYojNuGlKi3AeOu38+CpCFjwHfg8VBI3R8V8tVhBJUUkKXW19ZcK6cWpG zibg13whx0azY2HEIaKfh1fQ/DFHN7Xr0wzxMBiDIv5KK2nhBwHP8h+YLFMnjKaKmb7i AM8sMJCpveMh1J7Xlp/rSVWNa2Dj6lBvOeSNF6/TsMTTme1RGa5whvqF1vA64AG93WyK g+hQ421cS0GgwdLWsIvYkwF8N+1CEPBkoyHLiNmaeBC7lRDE6CvkkS+abxP2RsKvweVJ cBtA== X-Gm-Message-State: ALoCoQlPhcR4fTua1aJFXiMv96K1iit1EBR7J61zGM4tLpanUOnsccmXuYOQdLH8MS1vEKBjrgb1 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-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=ham 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 @@ -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