Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4677590pxk; Wed, 30 Sep 2020 08:56:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxGCMdb+gdqTDaIbNkptQ9xiloortmdbOFdxs9ljEdul5m+WiYZ8UdJUO8gCWGFcGPCpRx X-Received: by 2002:a17:906:fca7:: with SMTP id qw7mr3430032ejb.522.1601481409929; Wed, 30 Sep 2020 08:56:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601481409; cv=none; d=google.com; s=arc-20160816; b=u4+1xDcqME2Efzo0oVt1A+hihOHCqzdsjUE5KihI9br5c7sBt27WjSgzHFaQN9oaDY wN7vvx/2jF7eVzAS4xeIyDwkeuqc/i95QkOCYsXDa9WYixXKf6k5m+IE69J+X7xwPyml QLs2y7A+0+gNL6DiQS0pGFVhtIB9HtdAiP4jPEhTgk6TLr/flNUtyXPAlXKiQ38jgbqL qqIR/8pFZaW8lwC5LISjEDTytlFWwurBLvOgy4c4yhLw1nssrCViMJ0UZEozZ4KorpbK WYc5ZQYldEhgtuXgS1IU3EE8V3+b6jKpBy07qN4/J3oPhLASWM7gvQicZbrdJjUy3wij +ULw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ws3BUjIflBOEGN9PJVX1rB9emMu/Hx6C/guR3YZ88CY=; b=VbZ3A6GXzTeeWOBAK1ZyMLuYZqf/9vjGlcInv5xhZpFYP//ApzcUTRhA21XQZx3Zs4 jJOfbF/eJltvlkZ2Rz2cXB6GyFGVLhav1rewM8w2I86WejUO+Bp8oswf1rY0nzRvbZkf fO2HvOkxJ2KnrToInPZnJ38jxdGwclGuClHr4fk0nsQCozlMUs3sRd5QFkM7WexSKxaK xBC88BmEe32J+mr1sncVur1rEttPMiNMd7UMuWF+KF/rbRx6WorBNcjrHB2uv3WHY1ug 73PyOnS8cBAfOeFAdvvE5JgFqv6m/xbXCYbiAqdyHY10xagSmKghgmjZjgNI6cHzEMlM V3wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Zks96xaP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi26si1463658ejb.361.2020.09.30.08.56.26; Wed, 30 Sep 2020 08:56:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Zks96xaP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728149AbgI3PzZ (ORCPT + 99 others); Wed, 30 Sep 2020 11:55:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725355AbgI3PzM (ORCPT ); Wed, 30 Sep 2020 11:55:12 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFB01C061755; Wed, 30 Sep 2020 08:55:12 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id jw11so23046pjb.0; Wed, 30 Sep 2020 08:55:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ws3BUjIflBOEGN9PJVX1rB9emMu/Hx6C/guR3YZ88CY=; b=Zks96xaPFZmHbqmxTF0GDKFvkfBtvLHdI5FABA79eTZbxdNO4F1ht1tNahih6FMrXs +pyHjGypPZoKKQcvjTOLn95w+Xf+Q2JcFQEIrRUAmAtqbyI2w4ZbEI0Gq6W4vpxv4YDe Ncg/kowU8axpbXaNlDSJ3kx/dmMLy2YSRpw572nb1ohrdXFgK7CGAWOKXBEMrfTgXxAH teQy5uOUXiFBzD/MslU4OklmjOx9rO9r1HUtIl0kLc5e/eKfdsp0pmojKV5GQkd5X0ol nY7hZKjQu2IDxXsK3WSiTlOESqGvbto002soYKJWM3rUqqK9AZpjMLF4YFxZf6T7Oeue b1XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ws3BUjIflBOEGN9PJVX1rB9emMu/Hx6C/guR3YZ88CY=; b=MwpOpDfV/4hQeBsJKCZbwqyOVq8ymUMpPkdShsuoAun6aFAnV16QhBRIpopbvq+ubx APFua86JOm9nkaW+0C3FoqFBpwnLGcHmcj27TCWHmKQwZDP7DGawxXaR/usqUtZjDKDg gT5hJqxn0TZSOTuhlG0ucIQk8VWqworKsv0kc3HOA2mda9dNC14jd4qIZQwqiMY6LkOL AegNReWxcWMaqoTfme9IfrwYL2haQ6Sc4AK1or11oYNA/Mms4tnI/gL/owPGuz3R6ZTs 41It3xx+WpvL9wbKw1Z+wl3Ssx6J5nbhE1pg2OaZbNQTP+fEoPirRZQcpZ3vE1DkwOPa W4Hg== X-Gm-Message-State: AOAM531SJ6vtVi3prOHtsFsbpiJTcQQV+SZJLyJjY18spJZaWlBVRsdQ Cp/SBXlw35+wg96AdGFWxGLRifiFkmM2tfPkAejVBx7UiKb78w== X-Received: by 2002:a17:90b:fc4:: with SMTP id gd4mr3203582pjb.129.1601481312342; Wed, 30 Sep 2020 08:55:12 -0700 (PDT) MIME-Version: 1.0 References: <9152bb8be33e4192a7766eb53c6ca9af@asem.it> <22753b53cd7d4dfba4ef3610f71cc462@asem.it> <20200930130113.GQ3956970@smile.fi.intel.com> <2c26adae711145639d0b982a354aff3c@asem.it> In-Reply-To: <2c26adae711145639d0b982a354aff3c@asem.it> From: Andy Shevchenko Date: Wed, 30 Sep 2020 18:54:50 +0300 Message-ID: Subject: Re: How to use an ACPI declared GPIO in a userspace ... To: Flavio Suligoi Cc: Bartosz Golaszewski , "linux-gpio@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 30, 2020 at 6:39 PM Flavio Suligoi wrote: > > 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. ^^^^^^^ **DSDT**. > My SSDT table is: ^^^^ See the difference? I can't help here. > 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 ... Define "gpio-line-names" property in the *provider* (controller) device node _DSD(). -- With Best Regards, Andy Shevchenko