Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1277536pxk; Fri, 2 Oct 2020 05:50:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyW3aBSYGhIxjJHap8EkP3gRWJut8ta9SPobm809wOJ89V4zEM4Hfx/SSN03vqrssMIDmC4 X-Received: by 2002:a50:8e52:: with SMTP id 18mr2167739edx.28.1601643002741; Fri, 02 Oct 2020 05:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601643002; cv=none; d=google.com; s=arc-20160816; b=cy2HDI+5bSRcMCebuUdCaXUivbEzv594oTjruwQItN4z+kzCh4C9mccxVaZvvTtOmn jrgw/vkXP9aDG17hDX1gUcyNW0uPsEDneQCyW52DfYGHat91NKdFghHkpcqMXANof1Az 3XwwAwXpJO/quPxTxXcx8yqwJhYZGDo7iLwzSNkhd2pd6FyqJBMLz1/SlDJyVaijJy2r BfHHcpuG0u6ulAWteqFq+Uu66Gqu21OBwb4ZyC6vrTIBf+TrSbxq1SXlimaNlWLB59AK 91G5xHT6p4X/edssYHnRqO0SV0oXMgt4tbpXpFQzzLRoldrJR/W6dpt6VIY3d+r8HJyv J+nw== 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=RAIUPEHTeHS2U3+oSG9KsAR+ktrkLYIx+qWMYCIy9n4=; b=eJVHYt5bGNmyPynKtzaFAgUHh/+h8r0DNbi2nuSpYyF4MMjiNVKRa5MeBpBpZJtgLR cGXIafeC0EJWuy4XKEv3bLaKgC8ZBQFdCv3CCugElgiUQL7KbKE4XLIWNhXT5ddjvZFk 7H2eEIjHjWQ/+JQ/NM2qgaH+6tBqSyhgXU0gj53jZg1dErVvkSa0R+ADcbkZ9HqScRAL 56sx/Roxz6MfOBtGQIueDxE9i5hxS3Jmq5LCxsV7FZYQLgxLTZPaUlfGYD9sVvrupfEy 4QRuqquLRVZa9ZYjLGuNycHIZpYU8NYcy3boGHoxPyM/W7wyWHuWOK97Cci1J5iTy07q zyzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pDiADnxe; 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 l22si967171ejc.719.2020.10.02.05.49.39; Fri, 02 Oct 2020 05:50:02 -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=pDiADnxe; 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 S2387768AbgJBMsi (ORCPT + 99 others); Fri, 2 Oct 2020 08:48:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725964AbgJBMsi (ORCPT ); Fri, 2 Oct 2020 08:48:38 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18BE7C0613D0; Fri, 2 Oct 2020 05:48:38 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id u24so726176pgi.1; Fri, 02 Oct 2020 05:48:38 -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=RAIUPEHTeHS2U3+oSG9KsAR+ktrkLYIx+qWMYCIy9n4=; b=pDiADnxeBlW00Qq4p1x38xVCA2IAxrvhBBqq7PjoGlfS/UW4KbPrm2PZ0NiRlWxYtK asEOblO5qJLuHcyicxrc3tQSf/ovxhKsy+cWV7F9CzeZrD9RaAc4HKNUn0jZmbU62L/V byWKtx6C+lzEAN7NV8FeGnkYCQGDvZRkxqufVjJWOaV6Sq5zALqbcSZHwI8dnmp+DaXe 1rO1ZD2jfieTrLyLmV79xOoasLTcyoQxYT2qmUYFRS7H8twXyzdxNU2W3X6vlmK0kcke Wt9UrSZQJgFrUZLpDwjagpEsmOf55b2XMzGUrdxGToM6WQJ4jiZ25YOohO59PATj/grF dD2Q== 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=RAIUPEHTeHS2U3+oSG9KsAR+ktrkLYIx+qWMYCIy9n4=; b=N6gmZzRnRRV33B2Y8tq/ROGIl49sir7nwpfj5PRrSlYtHJEYebB4sbhQLrOAK6TFwP w8KBZ9CBj1y24HaSyhAuJdClaiCBiWUKeJaHBvhgBpPCWU05AQnEuy+gntLQpq3Kd+ht pwmcQoNQuDJhA2btW0mm058T8KU9EaUNgmZaf+3DUYdthsD9L1HFM/vKUrAJAHAIJz4k 8P2OsgYylD2MfwON+I3MXK/f9ANqkvxbgiDCbrW8KcPxSzhL0wclNxl2Fy57kWPPlu+/ Joz0ZJ5g25Y0/FvkYAV8YScA7dRVhbzi2kT27f2IwMokW16caf/76Jdc9PmnF1AAG/vI heZg== X-Gm-Message-State: AOAM531gjuUfL21ep1CGbTH1wGABe/EXduYDaACMl1bixRh3JPY+qCB2 /fy2d2mqlsyPxU2ihlICMRBtku6Rk9Fw7aLGf7U= X-Received: by 2002:a63:4c1d:: with SMTP id z29mr2069434pga.203.1601642917546; Fri, 02 Oct 2020 05:48:37 -0700 (PDT) MIME-Version: 1.0 References: <9152bb8be33e4192a7766eb53c6ca9af@asem.it> <22753b53cd7d4dfba4ef3610f71cc462@asem.it> <20200930130113.GQ3956970@smile.fi.intel.com> <2c26adae711145639d0b982a354aff3c@asem.it> <757023db21e642a3a4b6d33428c191cc@asem.it> In-Reply-To: <757023db21e642a3a4b6d33428c191cc@asem.it> From: Andy Shevchenko Date: Fri, 2 Oct 2020 15:48:18 +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 Fri, Oct 2, 2020 at 1:02 PM Flavio Suligoi wrote: > > > > My SSDT table is: > > > > > > ^^^^ See the difference? I can't help here. > > This is the DSDT table related to the GPIO controller of my board: > > Device (GPO1) > { > Name (_ADR, Zero) // _ADR: Address > Name (_HID, "INT3452") // _HID: Hardware ID > Name (_CID, "INT3452") // _CID: Compatible ID > Name (_DDN, "General Purpose Input/Output (GPIO) Controller - Northwest") // _DDN: DOS Device Name > Name (_UID, 0x02) // _UID: Unique ID > Name (RBUF, ResourceTemplate () > { > Memory32Fixed (ReadWrite, > 0x00000000, // Address Base > 0x00004000, // Address Length > _Y08) > Interrupt (ResourceConsumer, Level, ActiveLow, Shared, ,, ) > { > 0x0000000E, > } > }) > Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings > { > CreateDWordField (RBUF, \_SB.GPO1._Y08._BAS, B0BA) // _BAS: Base Address > CreateDWordField (RBUF, \_SB.GPO1._Y08._LEN, B0LN) // _LEN: Length > B0BA = GP1A /* \GP1A */ > B0LN = GP1L /* \GP1L */ > Return (RBUF) /* \_SB_.GPO1.RBUF */ > } > > Method (_STA, 0, NotSerialized) // _STA: Status > { > If ((OSYS < 0x07DC)) > { > Return (Zero) > } > > Return (0x0F) > } > } So, what about adding the following DefinitionBlock ("linename.aml", "SSDT", 5, "", "LINENAME", 1) { External (_SB_.GPO1, DeviceObj) Scope (\_SB.GPO1) { Name (_DSD, Package () { ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), Package () { Package () { "gpio-line-names", Package () { "Line0", "Line1", "Line2", ... } }, } }) } } ? (Replace '...' with meaningful line names or drop for now, but in any case you need to provide as much names as lines of such GPIO controller) -- With Best Regards, Andy Shevchenko