Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3128633pxv; Mon, 12 Jul 2021 09:57:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3/vYnDXMgBGFQPTsgnIdCMNmBsrs+mvFqMBxSbHO/Nd3oemSejQ/+rbtUddOr3Ni3/0FM X-Received: by 2002:a05:6402:3454:: with SMTP id l20mr24998566edc.170.1626109052514; Mon, 12 Jul 2021 09:57:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626109052; cv=none; d=google.com; s=arc-20160816; b=uu0qy5ObAB6gqpjZ85Q6/Crn4gImlGyeIcGfv7mnkGDcOlObCUNtw/DFdBr8SUk+lo c/J04dwQOzdMwRGAkFYoztIhrNX7bHvu01/2QpCCeKiHbJXPT0leh+/zPVMzXaA4ajCe hrGbQb87HoEO9uJ4dEFvMdkHDIAX4SSUXXEnHq/ziJSLeOc1UobJn3ZQB0IViH7L2PEX EencLaBuptX4UtAaV9CKXmHWIYntz6MRnP5XDpvVrscWQrSv0C2DAWmR6q+Rf4E8wWiI AK0IDlj1A57CUgAVApncEL7NyVLAZnoMvi4WwvZLKfwffQQloMEmtzpMSvBqEt9yNcAh eD3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Zt1wAPDi7dW0gAmmZpFMl+0A87agQH4calIGanfKapg=; b=TLRZdOK0sfzLk9pyvLsYW3A1vbcw5ftA0uFEZrWNooKUPg9xQ6qLcjg3e8aAwikL1u 0Arlb6RkLZledkx2Mo5mQ30XyX/w9fxjJNxwM3rosT/2raWTLfzcXKW7Jviu8ytu810W GO7bHwp4eItbVU4il7pGmYj3r6dmNzWTR4kgaFCc5YAVTBTSmUWswgn18kIUJilLp1vz B3p5wBbr0b3vmpdBcPRCkn+tE0zuEdnNlQJkD3RTZzww81J1NLaLefpaRbsomxC6LBkD KU1J9TLx5Rmo83xnotIj6ePEScopEwNqUXKuxN0++v5hOIgfHSwoJ1HvIdJjK5MB9bbS OAAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=UTWHk5c1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p26si17804384edx.381.2021.07.12.09.57.08; Mon, 12 Jul 2021 09:57:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=UTWHk5c1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234672AbhGLQ7B (ORCPT + 99 others); Mon, 12 Jul 2021 12:59:01 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:56160 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234208AbhGLQ65 (ORCPT ); Mon, 12 Jul 2021 12:58:57 -0400 Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CC46FCC; Mon, 12 Jul 2021 18:56:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626108968; bh=LnlGq5h8vhemkjb4YPOI1+jY+cg7vy+BSFWvwOxd3+U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UTWHk5c1ifR/hzOYihQbVOQ5lc1KjdKOCKfLJMxt+VSyA5LEJi2Q4Oiy5TXcUhqmf EuH/+uOYGXK7io9uxg2Tl4yiSoKvKNDx8xDrKt9bjUZNxxDw4qZfb1mm3wIzGQPBh6 bu4N2z1zmAA6BNtRzUqhIEd3hddy6BBl7oWt70ps= Date: Mon, 12 Jul 2021 19:55:21 +0300 From: Laurent Pinchart To: Mark Brown Cc: Daniel Scally , linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, hdegoede@redhat.com, mgross@linux.intel.com, luzmaximilian@gmail.com, lgirdwood@gmail.com, andy.shevchenko@gmail.com, kieran.bingham@ideasonboard.com Subject: Re: [RFC PATCH 0/2] Add software node support to regulator framework Message-ID: References: <20210708224226.457224-1-djrscally@gmail.com> <20210709170426.GC4112@sirena.org.uk> <20210712141528.GE4435@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210712141528.GE4435@sirena.org.uk> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mark, On Mon, Jul 12, 2021 at 03:15:28PM +0100, Mark Brown wrote: > On Sat, Jul 10, 2021 at 11:48:33PM +0100, Daniel Scally wrote: > > > I went with this approach because the ACPI isn't entirely lacking, it > > enumerates the TPS68470 as an i2c device for its driver to bind to > > without a problem which results in the regulator driver registering the > > regulator devices (7 of them for this chip), so I was thinking along the > > lines of repairing the problems with ACPI to give those rdevs the right > > init_data rather than sidestepping it altogether. I could register the > > platform devices for the regulator driver to bind to in a board file > > instead if that's the preferred option...usually this would involve > > using i2c_board_info I think but as ACPI will enumerate the i2c device > > for the chip independently we'd need to handle that somehow to stop them > > racing each other I guess. > > Like I said elsewhere it seems a lot easier to just have the I2C driver > set platform data based on parsing DMI information like we do elsewhere. > I really don't see any benefit to introducing an additional layer of > abstraction and binding here, it just seems to be making things more > fragile. The idea behind software nodes is that individual device drivers shouldn't care about where platform-specific data come from. They can use the same fwnode API, regardless of whether the device is described through OF, ACPI, or software nodes created by a board file in the kernel. It allows grouping all platform data that should be provided by firmware in a single place, conditioned by a DMI match, instead of distributing DMI matches to lots of drivers. > I'm not sure what you mean by "register the platform devices for the > regualtor to bind to" - if the PMIC is an I2C device it's going to need > to be an I2C device, and if the device is enumerated by firmware we'd > need to suppress that firmware enumeration to replace it. We can't. ACPI describes the device, and that's how it's enumerated. ACPI does provide information (as well as ACPI methods) needed by the driver, but fails to provide all the required information. That's why a mechanism to supplement the information provided by ACPI is needed. > > I'll take a look and see if I can make it work that way. > > > > >> I'm posting this to see if people agree it's a good approach for tackling the > > >> problem; I may be overthinking this and there's a much easier way that I should > > > I don't think I understand what the problem you are trying to solve is > > > so it's hard to say if this is a good approach to solving it. > > > > Hope this is a bit clearer now? -- Regards, Laurent Pinchart