Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp2575137imi; Mon, 25 Jul 2022 02:19:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uHoqx8xXXpfIvlW2MWa2Q1rVq2GtvL4zxcSJ8P9Yfg+B9zXbLP1PrKuVBNU1NmHkN2oMLb X-Received: by 2002:a05:6402:4315:b0:43a:d79e:117c with SMTP id m21-20020a056402431500b0043ad79e117cmr12189145edc.194.1658740767149; Mon, 25 Jul 2022 02:19:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658740767; cv=none; d=google.com; s=arc-20160816; b=VKC61DnA0LbNAd/krSu0JWXwEcJr5odzDuCXNuSoeXy1tA+A9PkOkUZ9NzhWpOU3cZ jRrbF3F9ZAoE176jTUMPLWRGSs/2u2KEyKB0yOhidNDbfxBJGCWQcShk0r6WJ3AsBPzn maOS14ItJ9AYld8OzyXfLRZpFdIFI+4Ow+s45HiyAKXnP7UQONkkt9db3sobcI+9hV1n xE7Lg1WFgYLCwzndLt4fD9GL4kQB6uZlA7KwORqMftJR+nQOO4hvHzlVOUj8fLoPSDe0 6Sm0Lf7rrf20aZXlZUVqpWkvhLgrKLWyddMT52a4YPJZK1IHMgXPrkuXUXa/RBfKKcDk oHuQ== 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=BSEtgg8+Hpw/EtiHjL5IRktNHYkZQ4l9B8QMcHNKzRs=; b=RtS+Ojl7scvaKecCYx9WvX6Zx0XKE8E/bUbqZe8gpDLTtFhpFO8mPJfnBv1yPGuCbe apIIwNVcef21XM4PMU3dpVJqdW4iaEkP5q0qNL4Asa4mKM7Ro80HRoUDr6EOPRN52M5j QTbo5+k+YIqGnbKYLn0AIJSKWALZEQiiGmlk8d/ABjSlP7fjSMJQ8lQrKn/IFDiy9na/ qy/qVIaO1YsqEome2PAnH1HEWL791OuS2WnFmyZ8hRExIDJVlBbeDlpJG90gOP6460Fa mxJXxgHAEx9cVkrU2L2lUy0XvjeP8BihkhluStqjTuI8D9eccejj7NhKz9h2tX42zc3p 86Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DvY9h9Do; 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 hp36-20020a1709073e2400b0072af7d4a334si14902257ejc.646.2022.07.25.02.19.02; Mon, 25 Jul 2022 02:19:27 -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=DvY9h9Do; 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 S233403AbiGYJKJ (ORCPT + 99 others); Mon, 25 Jul 2022 05:10:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231421AbiGYJKH (ORCPT ); Mon, 25 Jul 2022 05:10:07 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7557B140BD; Mon, 25 Jul 2022 02:10:05 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id l23so19409011ejr.5; Mon, 25 Jul 2022 02:10:05 -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=BSEtgg8+Hpw/EtiHjL5IRktNHYkZQ4l9B8QMcHNKzRs=; b=DvY9h9DoO0kblI5Gb7JOwMF5uAXyYh+0N98faLjkVtDpKYgYiZXw8rUpaon1Qsb+x/ y8PR5FRgsPRxbCvYRmi6JyQZHxlbh7MXccC1nAKDIdus48fm9phu/mVPu5c/7jnzpiUa CeYdC3SruNmPOz8QR4pQRYz+9lbX/PiafhwNwu9n1G7QLCs3uqxyNxwD3CM2frokPBsH DkjmmlsnQziUrFfN7mDBzyVBjS82vigYVYvIcaX8uI8LEUmNiadHmdk5ix5lNuZ/1UZ/ NGL0Cy1cT3KvSr2YKUSTaA8mjLj8kGwovaeEc5qHPC+CgkPbA4CYf9Td2TeI9EthK4eN F2CQ== 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=BSEtgg8+Hpw/EtiHjL5IRktNHYkZQ4l9B8QMcHNKzRs=; b=NslrMZ5f6I5mWX5JpKL7DuOYDqURoD3YpuEXmU1oZytERSQagJTrj0I4F41CB8iZCu 5e0iIcyVN28dlKxkbGucyXvZ6lJtrSkqnGKQmlfNy6xtYAHwGLG8tHsyKeIxE8ru9HyF 9DErc0ZbvY0UouD6yy5HWppQYzUkPXOG7ujfVUYU4ZSJdz0iG+wyBCIA5xFUb28loMIg o7X6AwFLu4cUtPcddtQ7D4ttza7Y4HuTlrWv2jtexYywisJ+B5hOTFLnp0cxUZfazDFG EX8GmNajUoxskItnRrxCulluUMHprqfwceJuBj3wdoD6T6hq6w5WOwezm0NjpnTx48YW YJFw== X-Gm-Message-State: AJIora9xNIqvD722EYwBt0oMcuhu/EvVZdvkb+WWLyTW7rUhzCeiwFjc NSPkfLDqoM4hF3AOJsxqY0RvYlrJcu3XEBpxfXY= X-Received: by 2002:a17:907:6297:b0:72f:9aad:fcb with SMTP id nd23-20020a170907629700b0072f9aad0fcbmr9108533ejc.161.1658740203874; Mon, 25 Jul 2022 02:10:03 -0700 (PDT) MIME-Version: 1.0 References: <20220722102407.2205-1-peterwu.pub@gmail.com> <20220722102407.2205-8-peterwu.pub@gmail.com> In-Reply-To: From: Andy Shevchenko Date: Mon, 25 Jul 2022 11:09:26 +0200 Message-ID: Subject: Re: [PATCH v6 07/13] mfd: mt6370: Add MediaTek MT6370 support To: ChiaEn Wu Cc: Lee Jones , Daniel Thompson , Jingoo Han , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , Sebastian Reichel , Chunfeng Yun , Greg Kroah-Hartman , Jonathan Cameron , Lars-Peter Clausen , Liam Girdwood , Mark Brown , Guenter Roeck , "Krogerus, Heikki" , Helge Deller , ChiaEn Wu , Alice Chen , cy_huang , dri-devel , Linux LED Subsystem , devicetree , linux-arm Mailing List , "moderated list:ARM/Mediatek SoC support" , Linux Kernel Mailing List , Linux PM , USB , linux-iio , "open list:FRAMEBUFFER LAYER" , szuni chen 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 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 Mon, Jul 25, 2022 at 11:06 AM ChiaEn Wu wrote: > On Mon, Jul 25, 2022 at 4:43 PM Andy Shevchenko > wrote: ... > > > > > +#define MT6370_REG_DEV_INFO 0x100 > > > > > +#define MT6370_REG_CHG_IRQ1 0x1C0 > > > > > +#define MT6370_REG_CHG_MASK1 0x1E0 > > > > > + > > > > > +#define MT6370_VENID_MASK GENMASK(7, 4) > > > > > + > > > > > +#define MT6370_NUM_IRQREGS 16 > > > > > +#define MT6370_USBC_I2CADDR 0x4E > > > > > > > > > +#define MT6370_REG_ADDRLEN 2 > > > > > +#define MT6370_REG_MAXADDR 0x1FF > > > > > > > > These two more logically to have near to other _REG_* definitions above. ... > > You lost me. Namespace has a meaning, i.e. grouping items of a kind. > > In your proposal I don't see that. If REG_MAXADDR and REG_ADDRLEN are > > _not_ of the _REG_ kind as per above, why do they have this namespace > > in the first place? > oh... Sorry, I just got the wrong meaning > maybe it should be revised like this, right?? I don't know. I am not an author of the code, I do not have access (and don't want to) to the hardware datasheets, all up to you. From the style perspective below looks good. > ------------------------------------------------------------------- > #define MT6370_REG_DEV_INFO 0x100 > #define MT6370_REG_CHG_IRQ1 0x1C0 > #define MT6370_REG_CHG_MASK1 0x1E0 > #define MT6370_REG_MAXADDR 0x1FF // Move it to here > > #define MT6370_VENID_MASK GENMASK(7, 4) > > #define MT6370_NUM_IRQREGS 16 > #define MT6370_USBC_I2CADDR 0x4E > > #define MT6370_MAX_ADDRLEN 2 // Rename -- With Best Regards, Andy Shevchenko