From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751956AbcDZCZD (ORCPT ); Mon, 25 Apr 2016 22:25:03 -0400 Received: from mga01.intel.com ([192.55.52.88]:5932 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750821AbcDZCZB (ORCPT ); Mon, 25 Apr 2016 22:25:01 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,535,1455004800"; d="scan'208";a="91865808" 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> 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: <571ED178.4090700@linux.intel.com> Date: Tue, 26 Apr 2016 10:24:56 +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: <20160425173024.GO3217@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 Mark, On 04/26/2016 01:30 AM, Mark Brown wrote: > On Mon, Apr 25, 2016 at 04:04:50PM +0800, Lu Baolu wrote: > >> + ret = device_property_read_string(dev, "gpio-name", &gpio_name); >> + if (!ret) { >> + gpiod = gpiod_get(dev, gpio_name, GPIOD_ASIS); >> + if (!IS_ERR(gpiod)) { > This doesn't look like it's a standard ACPI binding for GPIOs, why are > we using a property to get the GPIO noame? 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". Best regards, Lu Baolu