Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp912177yba; Fri, 26 Apr 2019 10:48:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzF3M6DrLAt0XEkPm6fGvKRa0Aj2QvOC0VefVjfUnsAsTtM4iorzYo/CfRyFA8QraxXVbGN X-Received: by 2002:a62:1c87:: with SMTP id c129mr23568500pfc.113.1556300901473; Fri, 26 Apr 2019 10:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556300901; cv=none; d=google.com; s=arc-20160816; b=yzGaMAdSMgv9QncGnVriAOYVsfklN5AnJQBgZPOHW5Qn4QKYQpTTg7hFtZiBWN38Uv tVxmDzYT6gtwhvXY/UHr0byW2DPDv3bhP/4hwDC8GiwG1612Y+r04FbuCa6yVtFZbRIi SuYSx5YCWtPc4AeSYHMFEGoGLhHNRY6nSbcwpJt4iI3sxpy6izlThJyzr38v+8xyX19o NyC61oFD0k740QRLmSCRS0cRLMIgS6httT88DbkwMBRndQfA+Wqc6AyVsoGWH0qm+uqy BT4rprSFIYloRa1VGeb/eaYLK6y55z3UWXvRxzWKEHkHjcRkiUOm5sQ5ys6dBbRVqrfl ckZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=LG37QFwhXYZEYAua0BnCrURDS41kX/WKOIH1DK3ar6Y=; b=h31qv4FGkHcR6MFqOwu4DBZzoCRx2A+1J30mzjSOnO8cJielxJwNgd9djEVp2BgTei HHM/w2Yz9lwmjqo15bTWOHpp2QxstPyrFKHi9ZwO8q+mEvEt3HWdmxYFxEre2pNYCsR3 t8edOPZt4UNnSoOpuLMW1mdsGM/JmJrN8/bOAALi84mjbfz5S1l/yDi1FS1AuzeOlYHW nVUDrwKH8H0MDmeGaIyXB+XsBqrwTNRlQUoGi5c5Sa7CSsNDEgRlqe5ijY6PmEa1a6dB EOnNjciLYWAXBupTV71SxUCpp2fLGADmRzakJjVq8+fceJ8X4Pcw+0sFwaf5Bu3PH+aJ Ox0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=saq2xo4y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o33si26351772plb.189.2019.04.26.10.48.05; Fri, 26 Apr 2019 10:48:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=saq2xo4y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726308AbfDZRqz (ORCPT + 99 others); Fri, 26 Apr 2019 13:46:55 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:35586 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726116AbfDZRqy (ORCPT ); Fri, 26 Apr 2019 13:46:54 -0400 Received: by mail-pf1-f194.google.com with SMTP id t21so2077038pfh.2 for ; Fri, 26 Apr 2019 10:46:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=LG37QFwhXYZEYAua0BnCrURDS41kX/WKOIH1DK3ar6Y=; b=saq2xo4yo4tvxIgOaMXVKPJkCrOoDQ4AGWTIkle+IZCN90EVXHkdhqU1B1RQuBZ5aP JsBPCpe+QmsE0X+PAWPc6oIhQ16ic3WJsitEljNzLy/g9SgbNEtM2xk4ajkUKwScnGg+ 235COxs9JuHdU1RjloJJsODEE7a+X9Hq5YQQexGVxuOJAxyQomarAugW3MreE6G62MaT roYaPpjwZL9b8FPlHElP6DHM/aB/iKN4+Ss8t2n1KhMmEwVoMN3DI1Bo3Y5rjlb5+QKz zgdk9+Pd3G+MxLF1VdlDj6Ak5im9zpBFXyJB82sqWN0oqwnumteo6GzUosmE4mOL6JuB W+fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=LG37QFwhXYZEYAua0BnCrURDS41kX/WKOIH1DK3ar6Y=; b=beuU/VueXCsAIsIF8X+NsRcuUJO+Zdzy2lzOkZCxYiXgwgXJND76KOzlKi8+iQe3hM riWSb65ErsMmcjp4k/EYG8kvdTQpecrjBgqSb7TEylRoQnRGZv5I0vIrL9MCHbY2zHrz GKctx/NjBDSv5T+Ljy9pkpo5iHmWK/7YBj9iTxzyGqZYJn8QrmH5KxEln36y9JHaA1M2 2GnyrZJr69KdGlKAyYXWjqy6t+072B4PVj2pryXc2cE7wanvs51uT4pCcShb3y0mq/0i A6f8HxeeF5Gk/QxHPwJISbWPfLGBJxqhIooFICRn3BLR+vZrkdfk6DTaMSMGj4wV48FF 0j8A== X-Gm-Message-State: APjAAAXkkPw2Df35ucG0+BMvZIXVLzwhtSO5S0ZekZEn3WhjhtB9NcuT qnpfxCphTdQqR2c6zIrw+1co X-Received: by 2002:a63:7e10:: with SMTP id z16mr46092563pgc.40.1556300813859; Fri, 26 Apr 2019 10:46:53 -0700 (PDT) Received: from Mani-XPS-13-9360 ([2405:204:72c4:4b94:e0ad:83b0:3987:aa05]) by smtp.gmail.com with ESMTPSA id 9sm14461629pgv.5.2019.04.26.10.46.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Apr 2019 10:46:53 -0700 (PDT) Date: Fri, 26 Apr 2019 23:16:45 +0530 From: Manivannan Sadhasivam To: Jan Kiszka Cc: Andy Shevchenko , "Enrico Weigelt, metux IT consult" , Andy Shevchenko , Mika Westerberg , Linus Walleij , Bartosz Golaszewski , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , ACPI Devel Maling List , "Rafael J. Wysocki" Subject: Re: [PATCH 2/2] gpio: sch: Add interrupt support Message-ID: <20190426174645.GB31161@Mani-XPS-13-9360> References: <1200464b-f969-ebc2-ae82-1f8ca98aaca1@siemens.com> <20190424103306.GC2654@lahna.fi.intel.com> <9377620b-d74a-04d9-a51e-8590400b1c0f@siemens.com> <20190426130615.GT9224@smile.fi.intel.com> <2f3da791-4a10-c2c4-dc5a-22ad16ed7be6@siemens.com> <20190426173329.GA31161@Mani-XPS-13-9360> <534a4812-e6d3-9b16-5142-ab214da3d661@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <534a4812-e6d3-9b16-5142-ab214da3d661@siemens.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 26, 2019 at 07:39:56PM +0200, Jan Kiszka wrote: > On 26.04.19 19:33, Manivannan Sadhasivam wrote: > > On Fri, Apr 26, 2019 at 08:20:19PM +0300, Andy Shevchenko wrote: > > > On Fri, Apr 26, 2019 at 7:05 PM Jan Kiszka wrote: > > > > > > > > On 26.04.19 16:42, Enrico Weigelt, metux IT consult wrote: > > > > > On 26.04.19 15:36, Jan Kiszka wrote: > > > > > > > > > > > At the same time, there are no real alternatives - to my> knowledge - for the value it brings (various bindings) to simply > > > > > switch> the engine. > > > > > Which value exactly does that collection of crude wrappers and broken > > > > > attempts to buypass the kernel (driving gpios via /dev/mem *facepalm*) > > > > > provide ? > > > > > > > > Leaving that blunt hack aside: > > > > > > > > import mraa > > > > > > > > pin = mraa.Gpio(13) > > > > pin.dir(mraa.DIR_OUT) > > > > pin.write(1) > > > > > > > > And the same goes for nodejs, java and c++. > > > > > > > > Moreover, this allows you to abstract away where "Pin 13" actually came from on > > > > that board if the kernel changes (BSP -> upstream...) or the extension board or > > > > ... > > > > > > The problem here is opaque number. This has to be chip + *relative* pin number/ > > > See this: > > > https://stackoverflow.com/questions/55532410/how-do-linux-gpio-numbers-get-their-values/55579640#55579640 > > > > > > > But for platform like 96Boards we don't need controller specific lookup, these > > are all handled by the platform code [1] so that the users can use the standard > > pinout number to access GPIOs. For instance, pin 23 on the Low Speed expansion > > header is the GPIO for all 96Boards platform, so the user can access that pin > > using 23 itself in the application and it will run across all supported > > 96Boards. > > Can you ensure stable numbering when probing order changes, e.g. due to > adding an extension board? > Good point! For tackling this, I'm planning to introduce an API for accessing the GPIO by its line name. It will be tricky to implement but once done, it will serve. Regards, Mani > Jan > > > > > That's one of the reason why we prefer MRAA. > > > > Thanks, > > Mani > > > > [1] https://github.com/intel-iot-devkit/mraa/blob/master/src/arm/96boards.c#L75 > > > > > -- > > > With Best Regards, > > > Andy Shevchenko > > -- > Siemens AG, Corporate Technology, CT RDA IOT SES-DE > Corporate Competence Center Embedded Linux