Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp332646pxj; Thu, 10 Jun 2021 01:41:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVo4/Iy7QwJu97JKdHwVtU9jIZxZMyR3i/F9E2jlgiwbWdHrrRuCFAJ0rxIR+AT12ihuny X-Received: by 2002:aa7:dd1a:: with SMTP id i26mr3596762edv.358.1623314513124; Thu, 10 Jun 2021 01:41:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623314513; cv=none; d=google.com; s=arc-20160816; b=XEClvn5drNggjtWjnbj1kxn7x9dd05yNjGgWe64bLX7B84TuOixcbGDkQd51/cy5I/ PR/SEL/Eahy495vflQynJuLAFNpBUH/BayS+eonwxpsi+/kqNo28ai5pRLdkWCUfM9Iz pSlzA/MVKfebZT/i3001rU9L8yWDFwvKiL7KgfNYfofxbV9Yd53ARPONPcmE0lyJZWKF ciuFLaJTaRPLu9AQfm0gRyyCmIpcf8xe48912sM3V9/MzB63AROnzUY5hRd7z7ESkyUv Tgz5BMuGSLQR2CjMXz/7aXt8e2t2XC0+W5thNUqe9nWKuzAGcICI4b1sQCFTaPVhN7DG 1/pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=EQsr+jRvGot3b2VWGVe3/Dt0ZnAyszohzz8MKnXHJy4=; b=WsrXZWRzBEzv5Qai64kvdA4bZ+p+FU+MM2mAWzzdv/8uJ68JGne6nLclDKW9Iqu6Vh zWcPoFa79onWJEIk5t2e4b1pvpc4SnK/RlhAtGedH93aRIbOmCFhIU+J4abFGJHy7QP4 th37LDgpEZZ7IWfBXqQaomWaGjFxuJk5PnqeA9U/316sYh4PRJhMvswjWxPaPeGzjWbq e3DHXJftLwkxwe1yqSiLKebE7e+5sghyfjEJAmGuxEd1fmldURLIYUqAjByzp5CU2JI8 91GTSAFQehuFHtDtGuka6dz7IXjC1PftIRceup/c3qayYh3rfU89pBnEHogroDY/lF/H 8tcw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x19si1839635ejs.382.2021.06.10.01.41.30; Thu, 10 Jun 2021 01:41:53 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230255AbhFJIli (ORCPT + 99 others); Thu, 10 Jun 2021 04:41:38 -0400 Received: from twspam01.aspeedtech.com ([211.20.114.71]:22170 "EHLO twspam01.aspeedtech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229910AbhFJIlh (ORCPT ); Thu, 10 Jun 2021 04:41:37 -0400 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 15A8Pde1068923; Thu, 10 Jun 2021 16:25:39 +0800 (GMT-8) (envelope-from steven_lee@aspeedtech.com) Received: from aspeedtech.com (192.168.100.253) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 10 Jun 2021 16:39:33 +0800 Date: Thu, 10 Jun 2021 16:39:32 +0800 From: Steven Lee To: Linus Walleij CC: Bartosz Golaszewski , Rob Herring , Joel Stanley , Andrew Jeffery , "open list:GPIO SUBSYSTEM" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "moderated list:ARM/ASPEED MACHINE SUPPORT" , "moderated list:ARM/ASPEED MACHINE SUPPORT" , open list , Hongwei Zhang , Ryan Chen , Billy Tsai Subject: Re: [PATCH v5 00/10] ASPEED sgpio driver enhancement. Message-ID: <20210610083932.GA30360@aspeedtech.com> References: <20210608102547.4880-1-steven_lee@aspeedtech.com> <20210610022416.GA27188@aspeedtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [192.168.100.253] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 15A8Pde1068923 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The 06/10/2021 15:50, Linus Walleij wrote: > On Thu, Jun 10, 2021 at 4:24 AM Steven Lee wrote: > > > Per the comment in the following mail > > https://lkml.org/lkml/2021/6/9/317 > > > > I was wondering if I should prepare v6 for the currnet solution or > > I should drop this patch series then prepare another patch for the > > new solution(piar GPIO input/output) which breaks userspace but is > > better than the current solution. > > I would say just go ahead with the new solution. AFAIK Aspeed > has pretty tight control over what kind of userspace run on these > systems. > > BTW please influence Aspeed to use the GPIO character device > and ligpiod > https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/ > if you are doing any kind of userspace GPIO control (which I > suspect that you do). > We currently use gpioset and gpioget that provided by libgpiod to test aspeed gpio and sgpio drivers. For the current solution on AST2600, the valid range of input pins is 0 ~ 127, the valid range of output pins is 128 ~ 255. So we access input pins by the following command ``` gpioget $chipId 0 1 2 3 4 ... 127 ``` and access output pins by the following command ``` gpioset $chipId 128=1 129=0 130=1 131=1 ... 255=1 ``` The new solution will change the gpio id order as follows Input: ``` gpioget $chipId 0 2 4 6 8 ... 254 ``` Output: ``` gpioset $chipId 1=1 3=0 5=1 7=1 ... 255=1 ``` Thanks, Steven > Yours, > Linus Walleij