From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4A9CC001DB for ; Mon, 7 Aug 2023 18:26:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229526AbjHGS06 (ORCPT ); Mon, 7 Aug 2023 14:26:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbjHGS05 (ORCPT ); Mon, 7 Aug 2023 14:26:57 -0400 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77FDC8F; Mon, 7 Aug 2023 11:26:55 -0700 (PDT) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 377IQkUP090374; Mon, 7 Aug 2023 13:26:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1691432806; bh=2EnyPrs/cBI+rlI07B1v5rUd2uvloil8hm66/Q0Hrno=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=KxiPLkvWqdp1YG2KSWOT7IYVGlm5X5WTZi5O1lwkWLG68UERiqh/sTYOt2rAIpSKX 5nAm7YjJ98/Ur05hA9rQIZz5TIHS2BNG8HCa6np+Rj2bwU6cHV07eLj8OT1cHkX2Ed a8krfurCBFUMClwbyFuxULUW5wBi+iQdOPYSQQ4c= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 377IQj6Q095573 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 7 Aug 2023 13:26:46 -0500 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 7 Aug 2023 13:26:45 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 7 Aug 2023 13:26:45 -0500 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 377IQjNi058017; Mon, 7 Aug 2023 13:26:45 -0500 Date: Mon, 7 Aug 2023 13:26:45 -0500 From: Nishanth Menon To: Andrew Davis , Peter Rosin , Greg Kroah-Hartman CC: Peter Rosin , Rob Herring , Krzysztof Kozlowski , Vignesh Raghavendra , , Subject: Re: [PATCH v2] mux: mmio: use reg property when parent device is not a syscon Message-ID: <20230807182645.ct2uvkb3s2tuplon@improve> References: <20230605154153.24025-1-afd@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 15:12-20230713, Andrew Davis wrote: > On 6/5/23 10:41 AM, Andrew Davis wrote: > > The DT binding for the reg-mux compatible states it can be used when the > > "parent device of mux controller is not syscon device". It also allows > > for a reg property. When the reg property is provided, use that to > > identify the address space for this mux. If not provided fallback to > > using the parent device as a regmap provider. > > > > Signed-off-by: Andrew Davis > > --- > > Ping, still needed and applies cleanly on v6.5-rc1. > > Andrew > > > > > Changes from v1: > > - Flip logic as suggested in v1[0] > > > > [0] https://lore.kernel.org/lkml/1c27d9d4-b1cc-c158-90f7-f7e47e02c424@ti.com/T/ > > > > drivers/mux/mmio.c | 9 ++++++--- > > 1 file changed, 6 insertions(+), 3 deletions(-) Reviewed-by: Nishanth Menon Greg: looks like you were missed in CC Peter/Greg: Any chance of Looking at this? This is a basic corner stone for us to clean up much of the mess we have created up in the device tree syscon nodes and trying to transition those into simple-bus. > > > > diff --git a/drivers/mux/mmio.c b/drivers/mux/mmio.c > > index 44a7a0e885b8d..2c9e4df9d6f2c 100644 > > --- a/drivers/mux/mmio.c > > +++ b/drivers/mux/mmio.c > > @@ -44,10 +44,13 @@ static int mux_mmio_probe(struct platform_device *pdev) > > int ret; > > int i; > > - if (of_device_is_compatible(np, "mmio-mux")) > > + if (of_device_is_compatible(np, "mmio-mux")) { > > regmap = syscon_node_to_regmap(np->parent); > > - else > > - regmap = dev_get_regmap(dev->parent, NULL) ?: ERR_PTR(-ENODEV); > > + } else { > > + regmap = device_node_to_regmap(np); > > + if (IS_ERR(regmap)) > > + regmap = dev_get_regmap(dev->parent, NULL) ?: ERR_PTR(-ENODEV); > > + } > > if (IS_ERR(regmap)) { > > ret = PTR_ERR(regmap); > > dev_err(dev, "failed to get regmap: %d\n", ret); -- Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D