Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1083778ybp; Fri, 4 Oct 2019 09:15:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLfxBMTO0vEHEe+iqdgbnz1ouTCdDG7uKPfOgvk5c+e6mWRDLci59Klal08fF9IEVmlkak X-Received: by 2002:a17:906:19c9:: with SMTP id h9mr13187429ejd.193.1570205756267; Fri, 04 Oct 2019 09:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570205756; cv=none; d=google.com; s=arc-20160816; b=b7iWkbXqfCvhy8zvZUDFEZiDXsC7MDxzNHtu3Ump8AqulkY3rA7E2AN1I5TOAnthd3 LoqFcZWFtEdBkfRTmBMOapS+3ueZlgqA1fht7zFCYzvUdlnAG8/RBKZKTfNuLfiBMnix KdoKnW2oQKC7CCr0dAcgeQtwJ3cvkFIKXOF3SZaDE5OWdL2vFr2UaEbjHuGmkp3i860/ hPpA0AOTe9i2yN16HyjGK/490VatreN05vKansQ0qM3Gk12nZdeARsKsLCbwlRXyxZqj Gs+rf4nV6/0lAbDjdobY9GrROWfltFKQ8S2yWxQIxq4rWmFGMEwHEnDmSmf+Y0eeKA6j 6IBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=0PAb9wQ779A+UUuanlZ/JxOdY2JJP1B4/U8SIFI1PX4=; b=fMoH/8X6+HcBGBtGnzxtXUhHZK7SZKT2zZv5XdGN+o0nyxrRVVfaphc2qfkddanoyD CYLe/E5ZR5IzA2g4FxvSO9ggNrmyBHzuiWu5k/gQMQypXZoKp0Va7hANrlF9yu9AyV2+ j3CKt5KPF/asehdtoxoS1jJkx3QwPP3HPbETXzQQM5rQ5RKao9n487MLkKXdy2RJVmnV /zIGnpPjn0lKprEMNnoh2H9Rs8OjY3hyD3Db6LNvi0u2Gd2Fd7HwCIFmq8pXqPkju2fm b4cav1RKFafpMhLkV/pfeuTu4nwI32HLiwe73mwnNzj7XdyzroYoF1vc6qqBiGbjrzog I0dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=jhTqWXoq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z5si4021740edk.157.2019.10.04.09.15.30; Fri, 04 Oct 2019 09:15:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=jhTqWXoq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390111AbfJDQNI (ORCPT + 99 others); Fri, 4 Oct 2019 12:13:08 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:39292 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389131AbfJDQNI (ORCPT ); Fri, 4 Oct 2019 12:13:08 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x94GCvqx072936; Fri, 4 Oct 2019 11:12:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1570205577; bh=0PAb9wQ779A+UUuanlZ/JxOdY2JJP1B4/U8SIFI1PX4=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=jhTqWXoqKdfQs2prUz5qSrpTe/i+PJ068NeZP5ioQbUlnGP0ZMB40KVgT5vc9NyD0 DSkdXI4EFzYxyFWptINVbhDHyaOm1CAn1How2no7p+crNP/iwrIYCcFM6cDKXFuFIr 6D2qf0r0gKQ4vwSYjFozQChr7cunbSYZh/IaYTQk= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x94GCv0L037657 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 4 Oct 2019 11:12:57 -0500 Received: from DFLE112.ent.ti.com (10.64.6.33) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 4 Oct 2019 11:12:55 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 4 Oct 2019 11:12:55 -0500 Received: from [10.250.99.146] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x94GCrQZ006137; Fri, 4 Oct 2019 11:12:53 -0500 Subject: Re: Should regulator core support parsing OF based fwnode? To: Mark Brown CC: , , Liam Girdwood , , Sebastian Reichel , , , , Jacek Anaszewski , , , , References: <62591735-9082-1fd7-d791-07929ddaa223@gmail.com> <20191003183554.GA37096@sirena.co.uk> <25b9614f-d6be-9da5-0fe5-eb58c8c93850@gmail.com> <20191003194140.GE6090@sirena.co.uk> <20191004113942.GB4866@sirena.co.uk> <20191004144029.GC4866@sirena.co.uk> <6df68ecb-f92e-fd9c-7f55-f66fa463263a@ti.com> <20191004155838.GE4866@sirena.co.uk> From: Jean-Jacques Hiblot Message-ID: <95a43632-57d0-2705-a2d3-d64827212692@ti.com> Date: Fri, 4 Oct 2019 18:12:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191004155838.GE4866@sirena.co.uk> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/10/2019 17:58, Mark Brown wrote: > On Fri, Oct 04, 2019 at 05:13:13PM +0200, Jean-Jacques Hiblot wrote: >> On 04/10/2019 16:40, Mark Brown wrote: >>> Why is the LED core populating anything? Is the LED core copying bits >>> out of the struct device for the actual device into a synthetic device >>> rather than passing the actual device in? That really doesn't seem like >>> a good idea, it's likely to lead to things like this where you don't >>> copy something that's required (or worse where something directly in the >>> struct device that can't be copied is needed). >> This is not a copy of a device of parent's of_node or something like that. >> You can think of a LED controller as a bus. It 'enumerates' its children >> LED, create the children devices (one per LED) and provides the functions to >> interact with them. >> The device node we are talking about here is a per-LED thing, it is a child >> node of the node of the LED controller. >> here is an example: >> >> ??? tlc59108: tlc59116@40 { /* this is the node for the LED controller */ >> ??? ??? status = "okay"; >> ??? ??? #address-cells = <1>; >> ??? ??? #size-cells = <0>; >> ??? ??? compatible = "ti,tlc59108"; >> ??? ??? reg = <0x40>; >> >> ??? ??? backlight_led: led@2 { /* this is the node of one LED attached to >> pin#2 of the LED controller */ >> ??? ??? ??? power-supply = <&bkl_fixed>; >> ??? ??? ??? reg = <0x2>; >> ??? ??? }; > Regulator supplies are supposed to be defined at the chip level rather > than subfunctions with names corresponding to the names on the chip. > This ensures that all chips look similar when you're mapping the > schematic into a DT, you shouldn't need to know about the binding for a > given chip to write a DT for it and if multiple people (perhaps working > on different OSs) write bindings for the same chip there should be a > good chance that they come up with the same mapping. The supply_alias > interface is there to allow mapping these through to subfunctions if > needed, it looks like the LED framework should be using this. In case of current-sink LED drivers, each LED can be powered by a different regulator, because the driver is only a switch between the LED cathod and the ground. > > That said if you are doing the above and the LEDs are appearing as > devices it's extremely surprising that their of_node might not be > initialized. That is because this is usually done by the platform core which is not involved here. JJ