Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752661AbdGCUWu (ORCPT ); Mon, 3 Jul 2017 16:22:50 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:36801 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750835AbdGCUWr (ORCPT ); Mon, 3 Jul 2017 16:22:47 -0400 MIME-Version: 1.0 In-Reply-To: References: <20170613151013.GT3187@lahna.fi.intel.com> <20170613200339.GX3187@lahna.fi.intel.com> <20170616083313.GY3187@lahna.fi.intel.com> <20170616120048.GC629@lahna.fi.intel.com> <20170619100209.GC629@lahna.fi.intel.com> From: Andy Shevchenko Date: Mon, 3 Jul 2017 23:22:45 +0300 Message-ID: Subject: Re: [PATCH v9 5/7] ACPI: Translate the I/O range of non-MMIO devices before scanning To: Gabriele Paoloni Cc: Mika Westerberg , "Rafael J. Wysocki" , Lorenzo Pieralisi , "Rafael J. Wysocki" , "catalin.marinas@arm.com" , "will.deacon@arm.com" , "robh+dt@kernel.org" , "frowand.list@gmail.com" , "bhelgaas@google.com" , "arnd@arndb.de" , "linux-arm-kernel@lists.infradead.org" , "mark.rutland@arm.com" , "brian.starkey@arm.com" , "olof@lixom.net" , "benh@kernel.crashing.org" , "linux-kernel@vger.kernel.org" , "linux-acpi@vger.kernel.org" , Linuxarm , "linux-pci@vger.kernel.org" , "minyard@acm.org" , John Garry , "xuwei (O)" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1441 Lines: 39 On Mon, Jul 3, 2017 at 7:08 PM, Gabriele Paoloni wrote: JFYI: Mika on vacation. > I had a look into the MFD framework. If my understanding is correct the mfd > framework create a platform device for each declared mfd_cell that is passed > to mfd_add_devices(). Right. > However there is something that I do not quite understand: > from > http://elixir.free-electrons.com/linux/latest/source/drivers/mfd/mfd-core.c#L207 > it seems that mfd_add_device() will create the platform device using the > resources that are statically declared in the respective mfd_cell. It's one possibility. > In my case I'd like to have a platform device using the resources that are > parsed from the ACPI table (i.e. as it is done now by > acpi_create_platform_device()). So far so good. Nothing prevents you to do that. > If my understanding is correct, if I declared an mfd_cell for my IPMI child > the mfd subsystem would create a platform device for such child and > therefore acpi_create_platform_device() would fail to create a new platform > device as adev->physical_node_count will be non zero. > However as things stand now mfd_cell devices can only use the resources > that are statically defined in the code (and therefore not the ones in the > ACPI nodes)...am I right? You may file resources first and then register MFD cells. See many existing examples in the kernel. -- With Best Regards, Andy Shevchenko