Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp745392pxj; Thu, 3 Jun 2021 19:18:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOjxPHxHWKsIeXJX2YRt0F9hwrZK0iSDcIYVrA4ltIb88Wy7oL1j4wDESA2Ux6mSQPwIhe X-Received: by 2002:a17:907:7749:: with SMTP id kx9mr2069143ejc.90.1622773122361; Thu, 03 Jun 2021 19:18:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622773122; cv=none; d=google.com; s=arc-20160816; b=pHzFhm8VeTnyNeu8X6MVn52C5+HClS2bnHNMFaP2Nxeak+JfX+XZP91FuROmSs53UH IPammYuqL9GGGqew1opo+JY6FdmGkSEKIVeuahO6F3iXUyC3LdVTNKx2zowWxJOQ/F7P IIMJjcROzk5SrbzVfdd+BIcn0W+liii3C7HxUEAaSgVHopjVzjIc2Yi3sh18wQwYHpf9 Gif0efAeIPtrXHkP9h2VJQLnwC5crEAqYfFzJnl9t2DrXevUHyhnAtN30kHuKJJkLPhT LUFZGGnKeZK6Lo0G2JEa63xl+p+vrA1pnUB/cx+JNAj4NwoZzVFEajaRxfOatYee++95 1nzg== 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=bbPZPLJFgpeCsD0fcHHrkPrFxRci8AIzjpHUSqEPUYg=; b=ScdkvoJjKTFZMreInwXQDQ1JzFrx06ZmSmqctm/R1quuAHeKJrvoeTSmHmkjXHk1m5 lLLwASjmvh9+kk+dxYOaYPCoYBbUhjJTgzzWLIthpXOxwONFeXWxgJeaG9OzicbZiDXm P2W+f75O/57Q10pKNjncScBeYPgtokGRO85yQ/hnQJ7vEC48sXKp40qwpAiqX4yf+n9E b/9JZA2ZHLKJ3MlcT71vNSx82g3W3cWavTLRti3UDuVcaiphjkytWlh1QgO+f5arkISh 9kkNs25NBZDfcjHFwYuoksACltEeI4E8DGuIuAVmN7TbUdZKqShWEXQlHy8Eer0XeTnH BpFQ== 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 f12si4815410ejl.315.2021.06.03.19.18.19; Thu, 03 Jun 2021 19:18:42 -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 S230034AbhFDCQs (ORCPT + 99 others); Thu, 3 Jun 2021 22:16:48 -0400 Received: from twspam01.aspeedtech.com ([211.20.114.71]:53395 "EHLO twspam01.aspeedtech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbhFDCQs (ORCPT ); Thu, 3 Jun 2021 22:16:48 -0400 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 15420tHr031948; Fri, 4 Jun 2021 10:00:55 +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; Fri, 4 Jun 2021 10:14:26 +0800 Date: Fri, 4 Jun 2021 10:14:23 +0800 From: Steven Lee To: Andy Shevchenko CC: Linus Walleij , 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 , "Hongweiz@ami.com" , Ryan Chen , Billy Tsai Subject: Re: [PATCH v3 3/5] gpio: gpio-aspeed-sgpio: Add AST2600 sgpio support Message-ID: <20210604021422.GA25112@aspeedtech.com> References: <20210603101822.9645-1-steven_lee@aspeedtech.com> <20210603101822.9645-4-steven_lee@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 15420tHr031948 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The 06/03/2021 19:05, Andy Shevchenko wrote: > On Thu, Jun 3, 2021 at 1:19 PM Steven Lee wrote: > > > > AST2600 SoC has 2 SGPIO master interfaces one with 128 pins another one > > with 80 pins. > > In the current driver, the maximum number of gpio pins of SoC is hardcoded > > as 80 and the gpio pin count mask for GPIO Configuration register is > > hardcode as GENMASK(9,6). In addition, some functions uses the hardcoded > > use > > > value to calculate the gpio offset. > > The patch adds ast2600 compatibles and platform data that includes the > > max number of gpio pins supported by ast2600 and gpio pin count mask for > > GPIO Configuration register. > > The patch also modifies some functions to pass aspeed_sgpio struct for > > calculating gpio offset wihtout using the hardcoded value. > > without > > ... > > > +#include > > Why? > > ... > I will remove it as of_device_get_match_data() will be replaced to device_get_match_data() > > +#define GPIO_OFFSET(x) ((x) & 0x1f) > > GENMASK() > > ... > Do you mean the macro should be modified as follows? #define GPIO_OFFSET(x) ((x) & GENMASK(4, 0)) > > + pdata = of_device_get_match_data(&pdev->dev); > > device_get_match_data() > > I guess you may replace all those of_*() to the corresponding > device_*() or fwnode_*() calls. > Thanks for the reviews, I will add a new patch for replacing all of_*() to device_*(). > -- > With Best Regards, > Andy Shevchenko