Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2142527rdd; Thu, 11 Jan 2024 23:58:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IHE3IbQDGAdjn4FKuiRQpZmY14VSHHl+KtFBU2NsPQ0tyeJOty8Xr12N52z6zB9MhekHbMd X-Received: by 2002:a05:6402:28a5:b0:558:85ec:33fd with SMTP id eg37-20020a05640228a500b0055885ec33fdmr382208edb.65.1705046323278; Thu, 11 Jan 2024 23:58:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705046323; cv=none; d=google.com; s=arc-20160816; b=P6/bXJSv0lLpXZ/+2Lvb+vC14+pVdSnK2mkL6OnYbv7SsRDoIdSjCk5v2Z97TtdltQ 0eE5WMLhBK6sVDD6tL/TwLK6BrOAbG0T4ALiRe4wOv5/aCu+2nN2VvUvgN12tRQmvjEs FISZBKTQ0cYe7tJBzk+NgAVX3cyAW1Ydxd9ziRZ+qvbYZdcdwhTG5q1u+UxZ9mDny0Fw V4y8z12VUZ5foUnVWAs7t727R40T5mXu69CXuBMkge+EY4oVIy+DFlzXJHwg2sabDPz3 XSx47dBiYpY7RAvWmHMCJMLu2IZ/dLAxvTZBkgow5yxs3eMGuXQqKkzcjzp6qwwCWHD5 7FdA== ARC-Message-Signature: i=1; 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=xAZp7ZoaXm8/c56Egwl/KnKo/Zvql0fqjDOgGvzctV8=; fh=2uvvNU5cfCQtk+KNttFeUpr3evcEvabyy3pgy2B2xXw=; b=M2M40gyicZ/x+P6WN7IgH8CgQgrDK+VkHUVa8YJDLBDO34KJb/1z+rVjXfTYds4Tze 5XGsMCqEhPna07IOkDUis+rHBNJKltP6GdwInpVNANKmV04v1qngmvxqrSdfdnTVPy/g 6Zhmle4R7ExHxlT1BUCrtMmBU5wJlSdIwrHaHNCWneq1Krq5gMgvPVBxJaTLpLI+uy7x ACkceN3Db2SXvHvtlg1MmPDz1PQmzmVKrRhpUZ6rkdZVmVI8COKrOZIvVqnmU9/uuCQF eXNYmo6ndrCdw76dNW75PC8Zo8BsIjvFyF3N8VbQu+9WU+OL4jL0ZLZeivktF/j5+2FW BRiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dwvZmfdc; spf=pass (google.com: domain of linux-kernel+bounces-24405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24405-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id t9-20020a056402240900b005527ae447f1si1241113eda.112.2024.01.11.23.58.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 23:58:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dwvZmfdc; spf=pass (google.com: domain of linux-kernel+bounces-24405-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24405-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0A83D1F24A66 for ; Fri, 12 Jan 2024 07:58:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3D2175D746; Fri, 12 Jan 2024 07:58:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dwvZmfdc" 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 67732812; Fri, 12 Jan 2024 07:58:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 722DFC433F1; Fri, 12 Jan 2024 07:58:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705046313; bh=fZ2vS676hdgJy+L7T0B/4nKQXB3hkTnrLtIFZBx9/60=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dwvZmfdcQJlvGab9ateNjc7FT47yJduv7igApmUMISm37PVKZgbPj1wCQhEDAVDoQ 1Unmbv/9wgNTiVzfHxRyz7ANRUdnHIJH7P3mONG02RYFr7w1X3OwWLTV7LBr0In0v6 P90t13blzz88t1F3i8Nk9ZO5JdM2A5hLzzOlSm/vawlOVsmA4J4CDrpmBsNv450cuF m/D39KJye/CbX3eJQygnIIwnAQaPkuvfG1UXhpP8rHTSgIJoQiv+f4zFV/eRwVD/Qa /YvRmaM72dkdwQKSIfROObtq3/JAuF89Va4a0e0WtxymirWZ72AMPaleWsmnzYHwNS eQqLmqxbABUJw== Date: Fri, 12 Jan 2024 07:58:28 +0000 From: Lee Jones To: Karel Balej Cc: Karel Balej , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Liam Girdwood , Mark Brown , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Duje =?utf-8?Q?Mihanovi=C4=87?= , ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org Subject: Re: [RFC PATCH 1/5] mfd: 88pm88x: differences with respect to the PMIC RFC series Message-ID: <20240112075828.GI1920897@google.com> References: <20231228100208.2932-1-karelb@gimli.ms.mff.cuni.cz> <20231228100208.2932-2-karelb@gimli.ms.mff.cuni.cz> <20240111105426.GA1678981@google.com> <20240111152549.GL1678981@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 Jan 2024, Karel Balej wrote: > On Thu Jan 11, 2024 at 4:25 PM CET, Lee Jones wrote: > > [...] > > > > > > diff --git a/include/linux/mfd/88pm88x.h b/include/linux/mfd/88pm88x.h > > > > > index a34c57447827..9a335f6b9c07 100644 > > > > > --- a/include/linux/mfd/88pm88x.h > > > > > +++ b/include/linux/mfd/88pm88x.h > > > > > @@ -49,6 +49,8 @@ struct pm88x_data { > > > > > unsigned int whoami; > > > > > struct reg_sequence *presets; > > > > > unsigned int num_presets; > > > > > + struct mfd_cell *devs; > > > > > + unsigned int num_devs; > > > > > > > > Why are you adding extra abstraction? > > > > > > Right, this is probably not necessary now since I'm only implementing > > > support for one of the chips - it's just that I keep thinking about it > > > as a driver for both of them and thus tend to write it a bit more > > > abstractly. Shall I then drop this and also the `presets` member which > > > is also chip-specific? > > > > Even if you were to support multiple devices, this strategy is unusual > > and isn't likely to be accepted. > > May I please ask what the recommended strategy is then? `switch`ing on > the chip ID? I have taken this approach because it seemed to produce a > cleaner/more straightforward code in comparison to that. Or are you only > talking about the chip cells/subdevices in particular? I'd have to see the implementation, but the general exception I'm taking here is storing the use-once MFD cell data inside a data structure. If you were to match on device ID it's *sometimes* acceptable to store the pointers in local variables. -- Lee Jones [李琼斯]