Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp427555lqb; Tue, 28 May 2024 22:45:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVwSTSJQXmPzXmMv8HliGj48eiacVTy0gkGDO2OYJkP7jlsTJOs/yU26ZatjB3VjlXhv30YLnHtSwWP2lOWQlPQeJJQLUQr0H6CDrSkRQ== X-Google-Smtp-Source: AGHT+IHRg6Z434aL+VmHlT8UiEyGWyYlJlEffOmLAUcrdz2IcATV9YV//r1IVfe9JphY1HGbKfaC X-Received: by 2002:a50:d69c:0:b0:579:c0bb:1762 with SMTP id 4fb4d7f45d1cf-579cecac592mr5698420a12.40.1716961515237; Tue, 28 May 2024 22:45:15 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57862e0bfafsi5017459a12.651.2024.05.28.22.45.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 22:45:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193475-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=DxJgCyS8; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-193475-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193475-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C9E8A1F27C7B for ; Wed, 29 May 2024 05:45:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B339915CD6B; Wed, 29 May 2024 05:45:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DxJgCyS8" Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F02715B98B; Wed, 29 May 2024 05:45:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716961506; cv=none; b=hd5VDG/iPOm22McxYCWcrY4fNktP9E1CwfagxqysLc+bkm2ZowKRjlG+RJ5j5IsnZoR2z8hoDsUq4m3qemu57bNWcHfTRNlfb5cUnwF6qzoAXvhftw9/dx5Hck7djmmd+vWAsg+1CQy8HtIddkY55X2Ppjs1ofIZGDDJglP0ydI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716961506; c=relaxed/simple; bh=cNGxdNuzdI5pKIB6QCt+zvjbCDD1qiXHOix5B2DCynU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=unyFU+ZpPXMLmzB5zyUvNjH6MkkMaDJK4qalrP74o7e/qPxjDA0X1cbal4U+1AT0Mhnj/M4g1Q5/ABSh9DO+9kCaKhkbvyiD6HJKCnB6hBMV5oDuhHPiz0hfadum6vJW261i77f3CUkXnyCLE7LAnYsfcAcIgrhEftaqk7LBKKU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DxJgCyS8; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-354faf5f1b4so1552142f8f.1; Tue, 28 May 2024 22:45:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716961503; x=1717566303; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GZ4JX//TKbZ+BzdC73sUZxj+uGqXuXB1LCY+TXma+K0=; b=DxJgCyS8GrUzP++GE37DN5jzzC4SM/j7q48/BWnmn4SP/+LXsTCnZzSGSCuKkVOx7D nR+Aic5eOldIPNfvRdVxnDkgt/8TfERl9yVpq2joRq/18jhmgYqZYnT0VHySW0HQOanv a6joFTwZbQL7jiyJ5T1MCEx5AtMi1YPeT6r3ww7CLBrCpuzEm3x2pQYphR9+ak79htba Jq5Kn5N1aIzzo+d5gMHhBevonH4Al36/UB8N04ozWs3N33bIgLO6HUrm4NL5kde7fh0r rfRVPC+zBNGPrreb5+dHRXuK34MfEnUjePBbktHxIE/z7inxEHfJzl96h4F983H0wSVf q2Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716961503; x=1717566303; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GZ4JX//TKbZ+BzdC73sUZxj+uGqXuXB1LCY+TXma+K0=; b=qB7aupZu5iqgRe4NSIliPAl5PZXtUHnIHGtc/jUee5iiwHDx0UOV2ta2SIw+IWGYmB C8eEKueBqpURPXfQWnVHRHi2hsdhMoUOVYVjub56O738F25bxSOKZdo2wFdz9/n4qDuR ykYTmYJ9Br2+C/wUJO6oJ3yrJDdj06j0BSabNzoJ56eAvj05hlN6gqL3Kj940zZGJljK Ton5VDsanPvGI92T3HAjISmd+0ZWeoX3b4JpV6L4p38q01Kg0Bo5Kj/0vEd1wywzxL5w Cm1tGey6FA9gNUYT6N+qgfsQwy5SlZxlqhzLAV1WzOgeBAi/eJ/tsjb97TZo3NkoxvwF WXqA== X-Forwarded-Encrypted: i=1; AJvYcCVdgkIQx7ri29juaeQmbXmX47x6OwwrRIAuvXwl1mFvDWKmTZ6mtYOXRuWVT2/FHMZt6BApM+77HlhPtxJcimCCEdR0t6sHQ1DwKTdF0lpaHmrnafnLRTagOSXXzxLWmwUKR5SC+mqPJcpgED/806D8oEhjvDk4yD1i9R7KHsxUcec= X-Gm-Message-State: AOJu0YwrK77MsQizE61grd+k6tBTCoGHwnVn299p4yjldU+8Xr4usyUY sGZWLUarqLyRHp2c6/Ka5HvdNZbhcRvJjanqZGUR2xoa2ymXd88YKJW3afVyw1DDrRrvNDut6uk iAS2OA4ALd6pid/E2mAPOM/f2OAg= X-Received: by 2002:a5d:408d:0:b0:355:4cb:5048 with SMTP id ffacd0b85a97d-3552fe02949mr12133703f8f.43.1716961503182; Tue, 28 May 2024 22:45:03 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240528190315.3865-1-laurent.pinchart@ideasonboard.com> <20240528190315.3865-3-laurent.pinchart@ideasonboard.com> <20240528201326.GA8500@pendragon.ideasonboard.com> In-Reply-To: <20240528201326.GA8500@pendragon.ideasonboard.com> From: Andy Shevchenko Date: Wed, 29 May 2024 08:44:26 +0300 Message-ID: Subject: Re: [PATCH v2 2/4] mfd: adp5585: Add Analog Devices ADP5585 core support To: Laurent Pinchart Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org, Bartosz Golaszewski , Conor Dooley , Krzysztof Kozlowski , Lee Jones , Linus Walleij , Rob Herring , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Haibo Chen Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, May 28, 2024 at 11:13=E2=80=AFPM Laurent Pinchart wrote: > On Tue, May 28, 2024 at 10:27:34PM +0300, Andy Shevchenko wrote: > > Tue, May 28, 2024 at 10:03:12PM +0300, Laurent Pinchart kirjoitti: .. > > > + depends on I2C && OF > > > > Why OF? > > Because the driver works on OF systems only. > > > No COMPILE_TEST? > > The driver won't compile without CONFIG_I2C, so I can use > > depends on I2C > depends on OF || COMPILE_TEST > > Do you think that's better ? I think that dropping OF completely is the best. OF || COMPILE_TEST would work as well, but I still don't know why we need t= his. .. > > + array_size.h > > + device.h // e.g., devm_kzalloc() > > > > > +#include > > > +#include > > > +#include > > > +#include > > I'll drop those 3 headers, there's not needed anymore. > > > > +#include > > > > > +#include > > > +#include > > > > You don't need them, instead of proxying... > > of.h for of_device_get_match_data() and of_match_ptr(). I'll drop the > former, but I need the latter, so I'll keep of.h Why do you need of_match_ptr()? What for? > of_device.h for historical reasons probably, I'll drop it. > > > > +#include > > > +#include > > > > m is earlier than 'o', but with above drop no more issue :-) > > > > ...just include mod_devicetable.h. > > > > > +#include > > > > + types.h // e.g., u8 I assume that all marked with + in my previous reply you agree on? .. > > > +#define ADP5585_MAN_ID(v) (((v) & 0xf0) >> = 4) > > > > GENMASK() > > This is not a mask. Or do you mean > > (((v) & GENMASK(7, 4)) >> 4) > > ? Yes. > I think that's overkill. Why? You have a mask, use it for less error prone code. .. > > > +#define ADP5585_Rx_PULL_CFG_MASK (3) > > > > GENMASK() > > Not here, as this value is meant to be passed to ADP5585_Rx_PULL_CFG(). Why is it marked as a mask? Rename it to _ALL or alike. .. > > > +#define ADP5585_C4_EXTEND_CFG_MASK (1U << 6) > > > > > +#define ADP5585_R4_EXTEND_CFG_MASK (1U << 5) > > > > > +#define ADP5585_R3_EXTEND_CFG_MASK (3U << 2) > > > > > +#define ADP5585_R0_EXTEND_CFG_MASK (1U << 0) > > > > > +#define ADP5585_OSC_FREQ_MASK (3U << 5) > > > > BIT() / GENMASK() > > I'll use GENMASK for the masks. For a single bit the BIT() is okay, and TBH I don't remember if GENMASK() supports h =3D=3D l cases. --=20 With Best Regards, Andy Shevchenko