Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753365Ab3F0JOg (ORCPT ); Thu, 27 Jun 2013 05:14:36 -0400 Received: from mail-oa0-f48.google.com ([209.85.219.48]:55641 "EHLO mail-oa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752882Ab3F0JOb (ORCPT ); Thu, 27 Jun 2013 05:14:31 -0400 MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 27 Jun 2013 11:14:30 +0200 Message-ID: Subject: Re: [PATCH 4/8] minnowboard: Add base platform driver for the MinnowBoard From: Linus Walleij To: Darren Hart Cc: Linux Kernel Mailing List , "H. Peter Anvin" , "peter.p.waskiewicz.jr" , Andy Shevchenko , danders , "vishal.l.verma" , Matthew Garrett , Grant Likely , Richard Purdie , platform-driver-x86 Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1129 Lines: 29 On Wed, Jun 26, 2013 at 3:53 AM, Darren Hart wrote: > Provide a minimal public interface: > minnow_detect() > minnow_lvds_detect() > minnow_hwid() > minnow_phy_reset() So instead of these calling drivers issueing gpio_request() themselves to obtain a resource, they make a function call to this proxy that issue gpio_request() for them. This is generally not how we do things. A driver should request its GPIO just as it requests its regulator or clock or IRQ line or anything else. Centralizing resource handling is not a good idea IMO, it's better that each driver request it's GPIO pin(s) and do the stuff it needs with them. This of course creates the problem of associating the GPIOs to a driver and how it should look that up, which I guess ACPI can do, isn't that what acpi_find_gpio() is for? Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/