From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93E49C4727C for ; Wed, 30 Sep 2020 15:39:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4ED2E20789 for ; Wed, 30 Sep 2020 15:39:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725372AbgI3PjS convert rfc822-to-8bit (ORCPT ); Wed, 30 Sep 2020 11:39:18 -0400 Received: from smtp.asem.it ([151.1.184.197]:50479 "EHLO smtp.asem.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726540AbgI3PjS (ORCPT ); Wed, 30 Sep 2020 11:39:18 -0400 Received: from webmail.asem.it by asem.it (smtp.asem.it) (SecurityGateway 6.5.2) with ESMTP id SG000515311.MSG for ; Wed, 30 Sep 2020 17:39:15 +0200S Received: from ASAS044.asem.intra (172.16.16.44) by ASAS044.asem.intra (172.16.16.44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Wed, 30 Sep 2020 17:39:13 +0200 Received: from ASAS044.asem.intra ([::1]) by ASAS044.asem.intra ([::1]) with mapi id 15.01.1979.003; Wed, 30 Sep 2020 17:39:13 +0200 From: Flavio Suligoi To: Andy Shevchenko CC: Bartosz Golaszewski , "linux-gpio@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: How to use an ACPI declared GPIO in a userspace ... Thread-Topic: How to use an ACPI declared GPIO in a userspace ... Thread-Index: AdaWdniTedAZ6+9wQdyYYgE5sQ27yP//4UoAgAAGTYD//91o0IAAJ14A//6Yg1CAAsA0gP//s0vA Date: Wed, 30 Sep 2020 15:39:13 +0000 Message-ID: <2c26adae711145639d0b982a354aff3c@asem.it> References: <9152bb8be33e4192a7766eb53c6ca9af@asem.it> <22753b53cd7d4dfba4ef3610f71cc462@asem.it> <20200930130113.GQ3956970@smile.fi.intel.com> In-Reply-To: <20200930130113.GQ3956970@smile.fi.intel.com> Accept-Language: it-IT, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.17.208] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-SGHeloLookup-Result: pass smtp.helo=webmail.asem.it (ip=172.16.16.44) X-SGSPF-Result: none (smtp.asem.it) X-SGOP-RefID: str=0001.0A090210.5F74A6A2.001C,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 (_st=1 _vt=0 _iwf=0) Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Hi Andy, > I guess you simply didn't get. The "gpio-line-names" property of GPIO > *controller* (provider!) and you are trying to do something with the > *consumer* > if I got it right. > > And of course GPIO line, which has name, has no difference in use from > another > w/o name assigned. You will need to request it by *consumer* either in > kernel > or in user space. > > To be more precise we have to look at your DSDT. > > -- > With Best Regards, > Andy Shevchenko > My SSDT table is: DefinitionBlock ("gpio_button.aml", "SSDT", 5, "ASEMsp", "GPIO_BTN", 1) { External (_SB_.GPO1, DeviceObj) Scope (\_SB.GPO1) { Device (BTNS) { Name (_HID, "PRP0001") Name (_DDN, "GPIO buttons device") Name (_CRS, ResourceTemplate () { GpioIo ( Exclusive, // Not shared PullNone, // No need for pulls 0, // Debounce timeout 0, // Drive strength IoRestrictionInputOnly, // Only used as input "\\_SB.GPO1", // GPIO controller 0, ResourceConsumer, , ) // Must be 0 { 1, // GPIO number } }) Name (_DSD, Package () { ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), Package () { Package () { "gpio-line-names", Package () { "USER_PUSH_BUTTON", } }, } }) } } } And the kernel messages, after loading the table, are: ACPI: Host-directed Dynamic ACPI Table Load: ACPI: SSDT 0xFFFF908274285200 0000E8 (v05 ASEMsp GPIO_BTN 00000001 INTL 20200717) ACPI: \_SB_.GPO1.BTNS: PRP0001 requires 'compatible' property So I need a "consumer", but I don't want to export the GPIO using its number... If you have any suggestion ... Thanks! Flavi