Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp99857lqj; Thu, 11 Apr 2024 10:56:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXWpoEvlnwUNmAdqn4SWEw6QNIijcjlbdRKiMG5oxESzESVkrNsYJpneN8sN/UlBBue0BT16g7yJdKcBqit7et0ud/zsB98kHZEFCNnpw== X-Google-Smtp-Source: AGHT+IHdHPhb9aco1ccUHCnxr7akHPULMCeK1AWvfVcW8p/iNZ7FptdlLZihN/QY1oc+8cSLmnFv X-Received: by 2002:a05:620a:21c3:b0:78d:6e6f:9004 with SMTP id h3-20020a05620a21c300b0078d6e6f9004mr387026qka.59.1712858186521; Thu, 11 Apr 2024 10:56:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712858186; cv=pass; d=google.com; s=arc-20160816; b=ea+k+UrCXwruEAmK2h2wyqjkDg4ntGVn6n68xVBJbomN9OnoGIrDrlJ1V8gXgDNv94 zxVZvDQCztb6wQNob4JWCRb4xL0vK7IT8WrQF0b/DKsDW80JEix3t66oEetHK/KiwN6t x1h/Qz6eTqY4BF/VIOkmG4wuojTLBjoGzjY44QsRc9BuiE/vGt1Z54XoIS2UBzfwGvKs AcUCcmoIE66ZXQ70BEQ6htMUipk/qwtxT9JoOvbKizwGavnZw6ZF821V6Azn/2DP519Q tNko8nnVQqiEKp0QE/1OuQSjdFpAjhp0kXCcq9jd6s7t+u1ijf59HPrn4GY3LEvHVsLp 7lhw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=95g0KUXdEwuJE+cPEu3zpXpD8zlhaQ9Uj4ocDj7LqqM=; fh=km/pszfCGNby6AKq7uDloz7ZpKJsAYmnmqOlA5kXAbk=; b=a4TkjVMt/bpxoK97A+dM74YSwlreUNwtMqyqBSz3MIwpsaY/wMHw8GsG6iqwTMdeRS 7+jARVvI5TAz4dBJpx3c223djsUG+FEY8HWNOdwmW8B3qaSuZoUSI5ztCADxNyA3m+zg CVG7L8OReMTHYBpfdQV9YSA3E6odP6rPv/qZ4WAgf/xUtg2YFk1Ew4Kizl9cU2Txaeht qRmlfV3QuodGVQ0syavFNDU83Do1xBFdQscxkAy8lqstHyeeEaTFcJrJR/HisqylYflY B7rxjvv9irz82+h0iHWsrgRnDSdhHPcWXfealyN3NWVaHTTf4TEjltDmbqgylvVQWbHC JJQA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Rn0ESlg4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-141334-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141334-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id vu15-20020a05620a560f00b0078d61bb734asi1953123qkn.49.2024.04.11.10.56.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 10:56:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141334-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Rn0ESlg4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-141334-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141334-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4252F1C23A2A for ; Thu, 11 Apr 2024 17:56:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C8291BAA90; Thu, 11 Apr 2024 16:39:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Rn0ESlg4" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FFF243ADA; Thu, 11 Apr 2024 16:39:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712853557; cv=none; b=RImuLkac/YCLXivnif8Ng+yO3HgKinxRNiplY9ON4IUVXqPfkzr2LzlwsqiJBiN+LlD1pbeBDOVuhNkRvTQDtmp3fwhgrzbGrVqReprvERWIjR8howD/aPTb50/yLLcDYPFGLKZCpFMHj9swEvpdAMvjVKeu+d1Ms/qysdpWAEs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712853557; c=relaxed/simple; bh=KA0gmwx5RKIsM+SMGYg8VxRvhIzvngglfYJ4j6bCzqA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qSV/lMdgt325tSH8x0W5DukmEMcO1LENLQeV0iGl57EK2xpHy678lkbVe2pmSXSzB/Di0kZVRKCTuF5FD2Uwcw0Gkr3F3pegd5KOrSJTOCDfs52BoHSy4BuI4Ec3KA4Kiq2Ap2Ne0dazSSNYIG4ig2QOdIzogGNyDOQC7RD0XKQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Rn0ESlg4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A48EC072AA; Thu, 11 Apr 2024 16:39:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712853557; bh=KA0gmwx5RKIsM+SMGYg8VxRvhIzvngglfYJ4j6bCzqA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Rn0ESlg4jtpBagbAkT5po/N7qvhzWQy6/9Sx7TaKfeWCIsILTCVpTiBNXjaZwIQBG dyjURdnyg0YlITzPxqnTPvyR0/mVD34GWYx4jFShg7xGGgWqNtbUu1HvVp2/pHmHSd Ru+piYEQ1rOrjDwuFrfO6kOW31UPGdCScil/+mNQDF3MvZyN4zgGI0oX8VDb3hW7ut ZMmND06bgNpHIdPEh0aEzN6sh9nTCKBtTEmZdvOc8rXqjKzK3+0ekK7nVjFQl2fWjY /AXmrcieLHDYX7M+JUFH9RyUIRk+6cUUpGXvqIcoekPvjG2XR0ESXlmmLrh/OBwN39 k1OcPMGHmRnpA== Date: Thu, 11 Apr 2024 17:39:11 +0100 From: Lee Jones To: Karel Balej Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Dmitry Torokhov , Liam Girdwood , Mark Brown , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Duje =?utf-8?Q?Mihanovi=C4=87?= , ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org Subject: Re: [PATCH 2/5] mfd: add driver for Marvell 88PM886 PMIC Message-ID: <20240411163911.GJ2399047@google.com> References: <20240331105608.7338-2-balejk@matfyz.cz> <20240331105608.7338-4-balejk@matfyz.cz> <20240411113726.GH1980182@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu, 11 Apr 2024, Karel Balej wrote: > Lee Jones, 2024-04-11T12:37:26+01:00: > [...] > > > diff --git a/drivers/mfd/88pm886.c b/drivers/mfd/88pm886.c > > > new file mode 100644 > > > index 000000000000..e06d418a5da9 > > > --- /dev/null > > > +++ b/drivers/mfd/88pm886.c > > > @@ -0,0 +1,157 @@ > > > +// SPDX-License-Identifier: GPL-2.0-only > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > +#include > > > + > > > +#include > > > + > > > +#define PM886_REG_INT_STATUS1 0x05 > > > + > > > +#define PM886_REG_INT_ENA_1 0x0a > > > +#define PM886_INT_ENA1_ONKEY BIT(0) > > > + > > > +#define PM886_IRQ_ONKEY 0 > > > + > > > +#define PM886_REGMAP_CONF_MAX_REG 0xef > > > > Why have you split the defines up between here and the header? > > I tried to keep defines tied to the code which uses them and only put > defines needed in multiple places in the header. With the exception of > closely related things, such as register bits which I am keeping > together with the respective register definitions for clarity. Does that > not make sense? It makes sense and it's a nice thought, but I think it's nicer to keep them all together, rather than have to worry about which ones are and which ones are not used here or there. Also, there will be holes in the definitions, etc. > > Please place them all in the header. > > Would you then also have me move all the definitions from the regulators > driver there? I think it would be nice to have them all nice and contiguous. So, yes. > [...] > > > > + err = devm_mfd_add_devices(dev, 0, pm886_devs, ARRAY_SIZE(pm886_devs), > > > > Why 0? > > PLATFORM_DEVID_AUTO then? Or will PLATFORM_DEVID_NONE suffice since the > cells all have different names now (it would probably cause problems > though if the driver was used multiple times for some reason, wouldn't > it?)? You tell me. Please try and understand the code you author. :) -- Lee Jones [李琼斯]