Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3818050pxv; Mon, 5 Jul 2021 06:31:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLNSyUUUH6T852s+DDx6XCf5WWrI9B9PlPju2G9eKfEPTxLJn57MLg8LClTVG/AVAF5NFR X-Received: by 2002:a17:906:c10c:: with SMTP id do12mr13703264ejc.0.1625491890573; Mon, 05 Jul 2021 06:31:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625491890; cv=none; d=google.com; s=arc-20160816; b=ugfV4YBCMhVdSMjwbewmVAo4gJLbFIzwkp4gFERx0m/DTIwBs20QnbBE8o2DxlQ7Bp oh4YK+h71l1XTNJagDzGRkzaCzMWj9Mzx2ox/ziOVAyBXKqOn52R+93QOC5rEXiCc45G qZfBeyTTqGyu7rCsYC8SemsbIgzDVe8MWM/l9KIwW4oMtsDJ4uhPHjoJVhBWTr34iG0l mad8hVvJKsUpX+x8xEaev8KPrF2McQ8U0Gp4FC4vTlEgTbZAWrZYUvnNKdDUUorRVAET iAID98u+Xx7PLBHP4amU5Un6hCtkWuQG0I6I2NZS0OtMfpvEVy0tsv8MPanf2eXscr+k ejdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=ddqwepprvqFiaW8VYgzbLNgNvkfzv1fsbM9mR4tb2MU=; b=SQQWgdhu90EXiUerpBkcafz/nvnyBaOMLbM4HkwUM4Ka1Egh8vdnIDHnr2W6gk0eMz eZLD4hy9nld6w1fILwOhfIfduWGiuQTuoTgMwh+jucdAeD83+QpEJUEHSoPFZZPg4G87 wxOMpDUff/8gVwqUgo/HGFHzgeO8Jsp0Ra9r86SoZqPsTgcY0O9sXP7cyt7+Gv8D+NUS k4SkDKxVa1tyZyoOcISG7/f8mS8SFhPR22Iuf6EdaV+/ieYctW5twh8lQB3h1Yv/83lD kKPlqQsgrW2H8gJr8r7NI0cJ0vfz1D2zwf3pvmU9bXofjLI/mpBzMq1zT7uDDkyHvwaF mkCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=KlKc6cuy; 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 a4si12166045edj.511.2021.07.05.06.31.07; Mon, 05 Jul 2021 06:31:30 -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=@walle.cc header.s=mail2016061301 header.b=KlKc6cuy; 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 S230500AbhGENcS (ORCPT + 99 others); Mon, 5 Jul 2021 09:32:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230188AbhGENcR (ORCPT ); Mon, 5 Jul 2021 09:32:17 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C02C4C06175F; Mon, 5 Jul 2021 06:29:40 -0700 (PDT) Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 5364D2224A; Mon, 5 Jul 2021 15:29:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1625491776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ddqwepprvqFiaW8VYgzbLNgNvkfzv1fsbM9mR4tb2MU=; b=KlKc6cuymWilnEHSiZybjsBCb7lqFMoM0B0qntA5wAIa83ZClp/T+yO2jhPZO3P097HPyx I9LJ4cgHjYs5tbZ1GkoFxLOWaMPYXOA7xBLcq+czcgCMWb6barEtcJBGF1+1tR/jQQHk1w GDVJF5uW3DqrkflWRAWNDdHoOV/WFvs= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 05 Jul 2021 15:29:35 +0200 From: Michael Walle To: Drew Fustini Cc: Andy Shevchenko , Rob Herring , Linus Walleij , Bartosz Golaszewski , Paul Walmsley , Palmer Dabbelt , Michael Zhu , Geert Uytterhoeven , Fu Wei , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , linux-riscv , devicetree , Emil Renner Berthing , Huan Feng Subject: Re: [RFC PATH 2/2] gpio: starfive-jh7100: Add StarFive JH7100 GPIO driver In-Reply-To: <20210702210622.GC1035183@x1> References: <20210701002037.912625-1-drew@beagleboard.org> <20210701002037.912625-3-drew@beagleboard.org> <20210702210622.GC1035183@x1> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <991dddfee40c5b358c07257b58a316f3@walle.cc> X-Sender: michael@walle.cc Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Drew, Am 2021-07-02 23:06, schrieb Drew Fustini: > On Fri, Jul 02, 2021 at 07:03:19PM +0300, Andy Shevchenko wrote: >> On Thu, Jul 1, 2021 at 3:23 AM Drew Fustini >> wrote: >> > >> > Add GPIO driver for the StarFive JH7100 SoC [1] used on the >> > BeagleV Starlight JH7100 board [2]. >> > >> > [1] https://github.com/starfive-tech/beaglev_doc/ >> > [2] https://github.com/beagleboard/beaglev-starlight >> >> > Signed-off-by: Emil Renner Berthing >> > Signed-off-by: Huan Feng >> > Signed-off-by: Drew Fustini >> >> Seems some Co-developed-by are missing. > > Thank you for suggesting this. Huan Feng originally wrote the driver. > Emil and I have made some changes to reorganize and clean it up for > submission. > > Do you think all three of us should list Co-developed-by: for our names > in addition to the SOB? > >> Brief look into the code brings the Q. Can't you utilize gpio-regmap >> here? Why not? > > Michael Walle asked about this yesterday and it was my first time > looking at regmap and gpio-regmap. I've been reading the code and it > does look like I should try convert this driver over to using > gpio-regmap. > > The open question in my mind is how to handle the interrupt type (edge > trigged on positive or negative, level triggered on high or low). > Hopefully I can find some other examples that can help me think about > how to do that correctly. Have a look at include/linux/regmap.h, there is "struct regmap_irq_type". If you're lucky, you can just supply the corresponding values that fits your hardware. If it doesn't match your hardware at all, then you can keep your own functions, or if its slightly different, then maybe you can add support for your quirk in regmap-irq. You don't necessarily have to use regmap-irq together with gpio-regmap. You can also just use regmap-irq or gpio-regmap independently. A quick grep for "type_rising_" lists drivers/mfd/max77650.c and drivers/mfd/rohm-bd70528.c for example. -michael