Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4440018imw; Tue, 12 Jul 2022 08:01:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vP8jORpz+ySGwS64GBt+hjYWIxR1f8o56OQOTYXYtEYGUhiezheB1wtVmwa3zENNRhAkvO X-Received: by 2002:a17:902:f54e:b0:16c:5119:d4a8 with SMTP id h14-20020a170902f54e00b0016c5119d4a8mr7592671plf.22.1657638066281; Tue, 12 Jul 2022 08:01:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657638066; cv=none; d=google.com; s=arc-20160816; b=Bq25sYHqh312hB3dPJOO1VTWdhyOFoyFFDF6x+rdcPHztEasVHeiM2ZE3jE1kkzbyc bp38rPaOwhismyIzgrOMfWUrp9huzwX6uWeByNlQPRPKcOz30SKsuN9+FAQv8ArCKA1r KEkaKsLT01yFVoHaCY+T10iz7696DoalWbupstLmmfbjQdXcY5gZM8+MgFc4eRpiHDqf pSLc/gRxqyUwmQR1p254ue7RYs2CdMxjP5w5ezXYmjjt6BY9S85kXbXOz2PIBYo9wi+q YBsEoigA2frc/iVaUBxob3PMZ7NiUPhEFPpL4vDVSDyspglREwb2pVy2JTqwu/+sS9Xd 49ZA== 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=7iVcCSNEDPVXZO7KkmaQ6UWTAKgIuOoWOIi+ZoUvMiI=; b=LaMC5kqFSoyxxfP6WDCNz7+e0anhcejtmLsCK4T8FQ0ynIJpddA7g7ILCE4z9caYZ+ OwKPNxnoOaS7R5X0H7sY0j8o9n/jU/Fz2PuzxSyuVfwHokzmQMOAAjnhJD/q+/OlCs0l CXMeRB3aXzuQvSIa7bPnmQivpa61LnLu1OqFZBRIeL6BVQE8Y3ZcUsK7uTPxIP8sY055 K/cVQv7xWEY5Hvo6weonMENr2A7mm5XDIOyWOxJOBiPvuO2NVcUtbJcKF65EfVO+Xtxk iIQC1NXeIZtdkQXO4Ezwn443K5dv8Uhd2nTFt6yiO0noslXLtjKgc6Zslx6I6uI101+N SAVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kB6ipQhw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n15-20020a170903110f00b00163cb1c5462si13439155plh.99.2022.07.12.08.00.47; Tue, 12 Jul 2022 08:01:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kB6ipQhw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233730AbiGLOtx (ORCPT + 99 others); Tue, 12 Jul 2022 10:49:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229746AbiGLOtv (ORCPT ); Tue, 12 Jul 2022 10:49:51 -0400 Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3237B326D7; Tue, 12 Jul 2022 07:49:51 -0700 (PDT) Received: by mail-yb1-xb35.google.com with SMTP id 136so14322338ybl.5; Tue, 12 Jul 2022 07:49:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7iVcCSNEDPVXZO7KkmaQ6UWTAKgIuOoWOIi+ZoUvMiI=; b=kB6ipQhwRymVgL6MecvMix0v5bVQaqPiDDELB6uuhqJCgucni9ofmwnblXQsmy4Dwp YXT3QO3CX1F8odY9GwupzSdxv5lK8H8UceT/jiFlEyBKGMJgMLh1fIyDjp9Y9XV04xZm K0LZB3pZFNu9hBabtegxj9/z6ijGHSq0EarHW5ckbO65k2vp1ixBaIduwMSGx0NnuGEW m6K2YeamWHz+dlBWaOfTXUH5xG4qe/LemopGUnmCsaCZ4z5wjj74NOuniXI0tPkc06wX Xje/3nicZylu9l/L9bA2b6YRKBncHict54Or5qKgVT1KEsvFEAF4BqAGcdHaQBtk05gA w+Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7iVcCSNEDPVXZO7KkmaQ6UWTAKgIuOoWOIi+ZoUvMiI=; b=T7vT0xC5gYJc68YSTmnCefSk+7SZMCUeO5Tl6lQ1s1alG2sLQp9HMQJEf33Rth23ek 33yOkX1D8dPemuDkw0dGSn8kVxa3u2FdBbsMO6BPNRcEanajba4HX1svZJ/Rsu8LT108 AdUF9O1oE2lwv5zu+56RtEWL9whjc2/A118LQ44imyhjLAgtCQ9z8p7PTOTwyAUPUvue tU6cDp2JurKNBIKQueUtg4sr1M+j/WoT1Y3iC6Ks5qg1jJsRgoVigP5ij373oLq5270g djh0p9lkTmJpIOdD6Qi7xaT2IxRiXphn2jWLF48BjQziV/6Iowj1nNnckKAZit5YbHDN w3GQ== X-Gm-Message-State: AJIora/aAAOnSbV/s4QLyRafb4JWl7VFJsFO9pFakBLQuIqJ5bxuIAdN zOwiyY5Oz29nMNMwC/vxScm98fC26Y6HYGn0OyY= X-Received: by 2002:a05:6902:10c9:b0:668:e27c:8f7 with SMTP id w9-20020a05690210c900b00668e27c08f7mr22824445ybu.128.1657637390435; Tue, 12 Jul 2022 07:49:50 -0700 (PDT) MIME-Version: 1.0 References: <20220712143237.13992-1-henning.schild@siemens.com> <20220712143237.13992-2-henning.schild@siemens.com> In-Reply-To: <20220712143237.13992-2-henning.schild@siemens.com> From: Andy Shevchenko Date: Tue, 12 Jul 2022 16:49:13 +0200 Message-ID: Subject: Re: [PATCH v3 1/3] gpio: nct6116d: add new driver for several Nuvoton super io chips To: Henning Schild Cc: Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , Bartosz Golaszewski , Linus Walleij , Tasanakorn Phaipool , Sheng-Yuan Huang , Kuan-Wei Ho Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 12, 2022 at 4:32 PM Henning Schild wrote: > > This patch adds gpio support for several Nuvoton NCTXXX chips. These > Super-I/O chips offer multiple functions of which several already have > drivers in the kernel, i.e. hwmon and watchdog. ... > +#include > +#include > +#include > +#include > +#include + bits.h + types.h. ... > +static inline int superio_enter(int base) > +{ > + /* Don't step on other drivers' I/O space by accident. */ > + if (!request_muxed_region(base, 2, KBUILD_MODNAME)) { > + pr_err("I/O address 0x%04x already in use\n", base); > + return -EBUSY; > + } > + > + /* According to the datasheet the key must be send twice. */ sent > + outb(SIO_UNLOCK_KEY, base); > + outb(SIO_UNLOCK_KEY, base); > + > + return 0; > +} ... > +#define gpio_dir(base) ((base) + 0) > +#define gpio_data(base) ((base) + 1) Dunno, why haven't you changed this? It might be a hidden mine for the future GPIO library development. I recommend using namespace whenever it feels right, and here it's exactly the case. > + if (dir & 1 << offset) Another ignored comment... BIT(offset) I'm stopping here to let you double check what version you have sent. -- With Best Regards, Andy Shevchenko