From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753454AbdAZQ4v (ORCPT ); Thu, 26 Jan 2017 11:56:51 -0500 Received: from mail.kernel.org ([198.145.29.136]:36666 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752700AbdAZQ4t (ORCPT ); Thu, 26 Jan 2017 11:56:49 -0500 MIME-Version: 1.0 In-Reply-To: References: <20170104205536.15963-1-d-gerlach@ti.com> <7bd282d9-df6f-f4c6-1f7f-c8ed81c78af3@ti.com> <3bb89649-fd2a-acc6-6968-e54a00842ce2@ti.com> <84d7d49b-933b-8b26-f18a-3a5054738cb1@ti.com> <0eaa9914-83f1-7716-cf04-1e3dd44df647@ti.com> <4cb25cf9-216f-2e18-f45d-ef7e48fa6c5e@ti.com> <58821CA2.4050701@ti.com> <23936395-d653-56c8-13f9-6dfeb6e9257b@ti.com> From: Rob Herring Date: Thu, 26 Jan 2017 10:00:32 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 2/4] dt-bindings: Add TI SCI PM Domains To: Dave Gerlach Cc: Ulf Hansson , Kevin Hilman , Tero Kristo , "Rafael J . Wysocki" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linux-pm@vger.kernel.org" , "devicetree@vger.kernel.org" , Nishanth Menon , Keerthy , Russell King , Sudeep Holla , Santosh Shilimkar , Lokesh Vutla Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 26, 2017 at 9:09 AM, Dave Gerlach wrote: > On 01/25/2017 04:32 PM, Rob Herring wrote: >> >> On Wed, Jan 25, 2017 at 10:59 AM, Dave Gerlach wrote: [...] >>> because genpd_xlate_simple only checks that the phandle is zero so that >>> it >>> can fail if it is not, but there's no functional reason it needs to do >>> this. >>> The genpd framework works as it did before no matter what the cells are >>> set >>> to if using of_genpd_add_provider_simple. Then in the attach_dev callback >>> inside the ti_sci_pm_domains driver instead of doing >>> >>> ret = of_property_read_u32(np, "ti,sci-id", &idx); >>> >>> to read the ti,sc-id for a device into idx we can now do: >>> >>> ret = of_parse_phandle_with_args(np, "power-domains", >>> "#power-domain-cells", 0, &pd_args); >>> idx = pd_args.args[0]; >>> >>> or even simpler from within our driver >>> >>> ret = of_property_read_u32_index(np, "power-domains", 1, &idx); >> >> >> This you should not be doing. The client driver shouldn't care how >> many cells or what their values are. > > > Client drivers in other places use xlate functions, like in the > drivers/reset framework, to interpret the cells. Is doing it this way really > that different? Oh, I was thinking the client driver, not the power domain controller driver. NM. Rob