From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752510AbcD0ByR (ORCPT ); Tue, 26 Apr 2016 21:54:17 -0400 Received: from mga02.intel.com ([134.134.136.20]:23579 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752074AbcD0ByQ (ORCPT ); Tue, 26 Apr 2016 21:54:16 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,539,1455004800"; d="scan'208";a="793122532" Subject: Re: [PATCH v6 04/10] regulator: fixed: add support for ACPI interface To: Mark Brown References: <1461571496-9600-1-git-send-email-baolu.lu@linux.intel.com> <1461571496-9600-5-git-send-email-baolu.lu@linux.intel.com> <20160425173024.GO3217@sirena.org.uk> <571ED178.4090700@linux.intel.com> <20160426102314.GS3217@sirena.org.uk> Cc: felipe.balbi@linux.intel.com, Mathias Nyman , Greg Kroah-Hartman , Lee Jones , Heikki Krogerus , MyungJoo Ham , Chanwoo Choi , Liam Girdwood , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org From: Lu Baolu Message-ID: <57201BC2.5040409@linux.intel.com> Date: Wed, 27 Apr 2016 09:54:10 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160426102314.GS3217@sirena.org.uk> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 04/26/2016 06:23 PM, Mark Brown wrote: > On Tue, Apr 26, 2016 at 10:24:56AM +0800, Lu Baolu wrote: > >> The GPIO name might be different in different use cases. For my case, >> it is "vbus_en", but other cases should use the different name. >> On ACPI compatible platforms, GPIO resources are reported via ACPI >> tables and (devm_)gpiod_get() hides the APCI complexity and returns >> the gpiod according to "gpio_name". > That's labelling that you might want to do on the supplier side or at > system level. The labeling is done at firmware level (ACPI 5.1). It uses _DSD configuration object to give names to GPIOs. There are systems which don't contain _DSD. On those platforms, Linux kernel could do this instead. Please refer to Documentation/acpi/gpio-properties.txt. > Why does the device care?It's requesting the GPIO in > its own context and it's only requesting one GPIO, with DT we're just > always calling the GPIO "gpio" which works fine. This driver is not bound to an ACPI device node directly. It's a child of a mfd device, which is corresponding to a real ACPI device node. I agree with you that we should not retrieve gpio name from the device provider. Driver should have the knowledge of the gpio name. (Please correct me if I didn't understand your point right. :-) ) Best regards, Lu Baolu